在 Magento 中,如何跨多个商店复制 URL 重写的创建?
到目前为止,这是我的想法:
创建自定义模块,当管理 Magento 网站触发事件时,该模块由事件侦听器触发:
controller_action_predispatch_adminhtml_urlrewrite_save
到目前为止一切顺利...
问题 1 如何从观察者类中获取与我需要能够在每个活动存储中复制此请求的数据相关的方法?
问题2 我意识到我需要一个 Helper 类来获取所有需要的网站 第二个问题是有一个 magento 类/函数可以获取安装中的网站列表吗?
问题3 除了添加逻辑来检查所选产品/类别在每个进行新重写的商店中是否有关联的产品/目录之外,我还应该进行其他检查吗?
This is my thinking so far:
Create Custom module which is fired by an event listener when Admin Magento Website triggers event:
controller_action_predispatch_adminhtml_urlrewrite_save
So far so good...
QUESTION 1
How do I get the methods from the observer class which relate to the data I need to be able to replicate this request across every active store?
QUESTION 2
I realise I will need a Helper class to fetch all the websites which need to be
As a secondary question is there a magento class/function which fetches list of websites in an install?
QUESTION 3
Apart from adding logic to check if the chosen product/category has an associated product/catalog in each of the store which is getting the new rewrite, are there any other checks I should make?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案 1:var_dump($observer) 是一个好的开始
但这将允许我检索数据以准备复制:
$request = Mage::app()->getFrontController()->getRequest()->getPost();
ANSWER 1: var_dump($observer) is a good start
but this will allow me to retrieve the data in preparation for replication:
$request = Mage::app()->getFrontController()->getRequest()->getPost();