Questions tagged «ee-1.12.0.2»

4
使用查询字符串重定向到URL
在我的模块中,执行脚本后,我需要重定向到URL中带有查询字符串的页面。 这是我所拥有的: $redirectUrl = 'http://magento.local/en_en/shop/index'; $redirectArgs = array('test' => '1'); $this->_redirect($redirectUrl, $redirectArgs); 我也尝试过: Mage::app()->getFrontController()->getResponse()->setRedirect($redirectUrl, $redirectArgs)->sendResponse(); 两种方法均会引发错误:处理您的请求时出错 我期望被重定向到 http://magento.local/en_en/shop/index?test=1 有人知道我能做到吗? 编辑: 按照建议,我尝试过: $redirectUrl = 'http://magento.local/en_en/shop/index?test=1'; Mage::app()->getResponse()->setRedirect($redirectUrl); 没有错误,但没有任何反应。我不在控制器中。 编辑2: 我最终使用: $redirectUrl = 'http://magento.local/en_en/shop/index?test=1'; Mage::app()->getResponse()->setRedirect($redirectUrl)->sendResponse(); 这按预期工作!谢谢。

2
catalog_product_save_after和catalog_product_save_commit_after之间的区别?
任何人都可以解释这些事件之间的区别。请快速而肮脏。谢谢。 我有一个类似的Observer方法: public function detectProductChanges($observer) { $product = $observer->getProduct(); $old = $product->getOrigData(); $new = $product->getData(); if ($product->hasDataChanges() && $old['status'] == 1 && $new['status'] == 2) { $this->_sendStatusMail($product); } } 没到 sendStatusMail() 我很喜欢这个事件: <events> <catalog_product_save_after> <observers> <productchange> <type>singleton</type> <class>A_ProductNotification_Model_Observer</class> <method>detectProductChanges</method> </productchange> </observers> </catalog_product_save_after> </events> 我应该使用: catalog_product_save_commit_after 目标: 禁用产品后发送电子邮件。 private function _sendStatusMail($product) …
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.