且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento更改产品网址

更新时间:2023-11-30 11:28:16

要实现这一点将非常棘手.产品的URL以及按类别的产品在索引系统的深处生成.当您将产品或类别保存为场景时,重新索引会开始,其中包括生成许多 core/url_rewrite 模型的任务,这些模型存储在 core_url_rewrite 表中.这些模型构成了"SEO友好" URL.因此,您需要找到该代码,并在其中添加自定义逻辑以生成正确的重写模型

That's going to be tricky to pull off. The URLs for products, as well as products-by-categories are generated somewhere deep in the indexing system. When you save a product or category being the scenes, the re-indexing that kicks off includes tasks that generate a number of core/url_rewrite models, stored in the core_url_rewrite table. These models are what make the "SEO Friendly" urls. So you'd need to find that code, and add your custom logic there to generate the correct rewrite models

然后,您需要检查URL帮助器,以确保它们生成正确的URL.我不确定这些方法是否查询重写表(这会很好),或者它们是否预知了Magento的URL的结构).

Then you'd need to check the URL helpers to ensure they were generating the correct URLs. I'm not sure if these methods consult the rewrite table (which would be good), or if they act with foreknowledge abou how Magento's URLs would be structured).

祝你好运.