Magento

Magento电子商务平台用户的问答

4
将列添加到网格(观察者)-where子句中的列“ store_id”含糊不清
我正在使用观察者方法在订单网格中添加一列: 在活动上-> sales_order_grid_collection_load_before我正在向集合中添加一个联接 在事件上-> core_block_abstract_prepare_layout_before我正在向网格添加一列 编辑更多信息: 活动(1): public function salesOrderGridCollectionLoadBefore($observer) { $collection = $observer->getOrderGridCollection(); $collection->addFilterToMap('store_id', 'main_table.store_id'); $select = $collection->getSelect(); $select->joinLeft(array('oe' => $collection->getTable('sales/order')), 'oe.entity_id=main_table.entity_id', array('oe.customer_group_id')); } 活动(2): public function appendCustomColumn(Varien_Event_Observer $observer) { $block = $observer->getBlock(); if (!isset($block)) { return $this; } if ($block->getType() == 'adminhtml/sales_order_grid') { /* @var $block Mage_Adminhtml_Block_Customer_Grid */ …

1
为什么我的SOAP v2 WS-I调用这么慢(每个产品更新需要7-10秒)?
我们将Magento SOAP v2 API与WS-I结合使用。 问题是,SOAP调用非常慢(每个产品7-10秒!)。我们称没有图像的catalogProductUpdate。商店本身运行良好,只是SOAP调用很慢。我们激活了Cache并降低了Index的性能,以提高性能(这在SOAP导入速度很慢时可以帮助许多其他商店)。 我将日志消息放入各种文件中,以找出错误所在。这是来自函数调用和调度事件的组合日志: 20.03.2013 14:17:43: Mage_Api_V2_SoapController 20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch_api_v2_soap_index 20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch_api 20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch 20.03.2013 14:17:43: dispatchEvent: controller_front_send_response_before 20.03.2013 14:17:43: dispatchEvent: http_response_send_before 20.03.2013 14:17:43: dispatchEvent: controller_front_send_response_after 20.03.2013 14:17:43: Mage::run 20.03.2013 14:17:51: dispatchEvent: resource_get_tablename 20.03.2013 14:17:51: dispatchEvent: resource_get_tablename 20.03.2013 14:17:51: dispatchEvent: resource_get_tablename 20.03.2013 14:17:51: …

2
Magento自动缓存洞察
我们正在使用memcache运行Magento EE 1.11。每个memcahce服务器2GB,总计4GB。我们有大约24万种产品。 可用内存:6GB 核心数:16 线程:32 这是一笔交易,每天都会添加更多新产品,并且每天都会对产品进行更改,当然,每次在后端添加/修改新产品时,缓存都会失效,特别是“全页缓存”。 启用Magentos自动缓存生成后,大约需要2天的时间来建立缓存,并为抓取器分配了8个线程。2天后,内存缓存在两个ram磁盘之间约2GB左右浮动。 问题是,每天对产品进行修改时,缓存将变得无效,并且一旦刷新“全页缓存”,这些2GB的缓存就会恢复为1到0的平方,并且Magentos自动缓存的粘性周期再次开始。现在,不仅缓存恢复为0,而且CPU使用率飙升至90%,网站变成等待5-10 +秒的等待游戏,您可以忘记尝试请求具有100多种版本的产品,如果没有缓存,第一次加载需要几分钟,这太荒谬了。 所以,我对社区的提问。 Magento是否有一种方法可以在无效时自动“更新”缓存,而无需重新构建整个缓存并从0开始?我知道缓存无效时,Magento知道某些内容已更改,但不完全是缓存中的什么地方(如果我错了,请纠正我)。是否有模块/配置可以绕过整个缓存的重建? 在侧面说明中,我们正在使用Tiny Bricks LightSpeed模块。 Magentos自动缓存生成可以通过cronjob进行时间控制吗?说,从晚上10点-早上6点开始爬行。 解决这种情况的最佳方法是什么?,正如您所了解的那样,每天重建一个千兆字节的缓存是不可接受的。

2
使用NGINX的性能优势
考虑使用NGINX服务于magento,我不关心实现细节,但想知道是否有人对它有好(坏)的评价。还特别感兴趣的是使用NGINX来负载均衡magento。

3
Magento 1测试框架
在任何可能的地方,我都喜欢按照测试驱动开发(TDD)方法开发软件。通常,在PHP中这意味着使用PHPUnit。 理想情况下,我想编写细粒度和粗粒度的测试。单元测试可帮助指导我的代码的设计和质量,集成测试可确保所有代码并在一起,而高层测试则可在验收测试中确保我确实交付了客户要求我交付的内容。 是否有针对Magento量身定制的测试框架可以促进TDD?

6
无效的模板文件-从2.2.6升级到2.2.7或2.3的问题
我已经将2.2.6版本升级到2.2.7版本,但是在我的网站上显示以下错误。 1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp2/htdocs/magento2/demo1/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js' Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp2/htdocs/magento2/demo1/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js' #0 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\View\Element\Template.php(300): Magento\Framework\View\Element\Template->fetchView('C:/xampp2/htdoc...') #1 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\View\Element\AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml() #2 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\View\Result\Page.php(248): Magento\Framework\View\Element\AbstractBlock->toHtml() #3 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\View\Result\Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor)) #4 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor)) #5 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array) #6 C:\xampp2\htdocs\magento2\demo1\vendor\magento\framework\Interception\Interceptor.php(153): …

5
如何在Magento 2中获取产品图片和URL?
这是我的观察者: public function execute(\Magento\Framework\Event\Observer $observer) { $orderIds = $observer->getEvent()->getOrderIds(); $order = $this->_orderRepositoryInterface->get($orderIds[0]); $items =$order->getAllVisibleItems(); $productQuantity = array(); $productPrice = array(); $productName = array(); $productIds = array(); foreach($items as $item) { $productIds[]= $item->getProductId(); $productName[]= $item->getSku(); $productPrice[] = $item->getPrice(); $productQuantity[]= floor($item->getQtyOrdered()); } } 如何从商品中获取商品图片和商品网址?

2
Magento网格组件未正确排序
我已经在Magento中配置了网格组件-排序行为似乎已损坏。我在哪里可以在javascript级别上调试它,和/或其他人不知道为什么会发生这种情况吗? 如果我对网格进行一次排序,则会发出ajax请求,并且一切都正确排序。 但是,第二种排序方法没有ajax请求,将使用所有相同的ID呈现网格。 在Magento核心网格上不会重复此行为,因此,我很确定这是我正在做的事情。我只是不太了解ui组件系统,所以不知道从哪里开始调试。

2
如何在magento 2中创建变体对象?
在magento 1中,我们可以像这样创建varien对象 $collection = new Varien_Data_Collection(); $varienObject = new Varien_Object(); $varienObject->setData($data); $varienObject->setItem($item); $collection->addItem($varienObject); 如何在magento 2中创建对象?
16 magento2  object 

2
Magento 2:每个区域设置不同的静态内容文件?
在Magento 2中,静态内容网址如下所示 http://magento-2-with-keys.dev/static/adminhtml/Magento/science/en_US/Pulsestorm_FrontendTutorial1/hello.js 这包括en_US语言环境部分。这强烈暗示着 Magento 2允许您根据语言环境创建不同的静态内容文件 Magento 2处理语言环境/ gettext字符串的静态内容文件 以上哪一项是正确的?还是都是真的?还是没有? 作为Magento模块开发人员,我如何在每个区域设置基础上提供静态内容文件?如果我是主题开发人员,这会有所不同吗?


3
如何在magento 2中获取事件/观察者
在Magento 1中,我可以通过如下所示的调试dispatchEvent()方法获取事件/观察者列表Mage.php。 /** * Dispatch event * * Calls all observer callbacks registered for this event * and multiple observers matching event name pattern * * @param string $name * @param array $data * @return Mage_Core_Model_App */ public static function dispatchEvent($name, array $data = array()) { Mage::log($name,null,'Events'); Varien_Profiler::start('DISPATCH EVENT:'.$name); $result …

2
如何在CMS页面Magento 2中调用PHTML文件?
Magento 2 我已经安装了从Magestore下载的示例Bannerslider模块。 当我调用bannerslider.phtmlCMS主页时,它在主页上显示了不可靠的错误。 {{block class="Magento\Bannerslider\Block\Slideshow" template="bannerslider.phtml"}} 错误消息是 We're sorry, an error has occurred while generating this email. 我也更改了块类,但仍然显示相同的错误。你能建议我一个正确的方法吗? 如果您需要更多代码详细信息,请在评论中提及我。我真的被困在这里。 uncoment之后SetEnv MAGE_MODE developer在.htaccess文件错误消息是改变并示出 Error filtering template: Invalid block type: Magento\Bannerslider\Block\Slideshow 顺便说一句,这个模块的管理部分工作正常。 积木类 namespace Magento\Bannerslider\Block; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; use Magento\Framework\Filesystem; use Magento\Framework\App\Filesystem\DirectoryList; class Slideshow extends Template { public function __construct( …

3
一些Magento表不是InnoDB,将所有表转换为InnoDB是否安全?
我正在使用AWS RDS只读副本。Magento的内存引擎表经常出现问题。对于备份和只读副本,RDS喜欢InnoDB。我可以安全地将所有表更改为InnoDB吗? 此外,我从AWS收到以下警告: 数据库实例magento-monin-prod-db包含尚未迁移到InnoDB的MyISAM表。这些表可能会影响您执行时间点还原的能力。考虑将这些表转换为InnoDB。请参考http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.CommonDBATasks.html#MySQL.CommonDBATasks.Tables 合理答案 仍对反馈感兴趣。如果接下来的24小时内没有发现任何问题,我将以此为答案。到目前为止,我在下面执行的步骤似乎是安全的。我最大的担心是Magento的Memory Engine表(以in_tmp结尾的表)及其对索引的影响。 这是我所做的: SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE (ENGINE = 'Memory' OR ENGINE='MyIsam') AND TABLE_SCHEMA='magento_db' 对我来说,这主要是返回了临时索引表和magento模块表,因此没有太多要关注的关键核心表,也没有足够的表供我轻松地执行另一个alter table(如果有问题的话)。 对于返回的每个表,我执行: Alter table {table-name} ENGINE=InnoDB; 如果您的表都不是InnoDB,我很想尝试一下。但是,正如我之前说过的,我的实例上只有几个核心表需要修改。

2
销售订单网格Magento 2中的订单状态未更改
我使用的是fedex运送方式,并且在生成货运后,状态显示在订单视图页面中。但是,销售订单网格中仍显示“处理中”状态。请检查以下屏幕截图。你们可以帮我!!! 此订单是使用authorize.net付款方式下达的。当有人使用授权付款方式下订单时,我已设置了处理状态。因此,我该如何在管理网格中设置完整状态。请帮助!!!!!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.