如何在magento中添加制造商在产品的URL中?

发布于 2024-09-14 20:00:59 字数 239 浏览 6 评论 0原文

我如何更改 magento 以便:

{site}/category-name/sub-category/product-name 

变成

{site}/category-name/sub-category/manufacturer/product-name 

标准 Magento 制造商属性在哪里?

谢谢 :)

How can I change magento so that:

{site}/category-name/sub-category/product-name 

becomes

{site}/category-name/sub-category/manufacturer/product-name 

Where is the standard Magento manufacturer attribute?

Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花想c 2024-09-21 20:00:59

您需要覆盖系统的 url 重写才能做到这一点。您可以扩展首先创建产品重写的类(它可能发生在管理站点的产品控制器中的某个位置),或者创建一个事件观察器,在保存产品后更新重写。

You would need to overwrite the system's url rewrites to do that. You could either extend the class that creates the product rewrites in the first place (it probably happens somewhere in the product controller in the admin site) or create an event observer which updates the rewrites after the product is saved.

树深时见影 2024-09-21 20:00:59

如果您想使用它们,您将需要在管理面板中为制造商等创建任何必要的属性,但这并不能真正解决这个问题。我明白你想要做什么,但是搞乱产品 URL 的解析似乎不是一个好主意(你可能会遇到问题)。您可以将数据库中的产品网址(通常保存为“some-product-name.html”)更改为“manufacturer-name/some-product-name.html”。我看不出有什么直接原因说明这行不通,尽管允许客户自己改变可能并不是一件小事。

希望有帮助!

谢谢,

You will need to create any necessary attributes for manufacturer, etc, in the admin panel if you want to use them, but that won't really solve this problem. I understand what you're looking to do, but messing with the parsing of product URLs doesn't seem like a great idea (you're likely to run into problems). You could probably change the product url in the database (usually saved as 'some-product-name.html') to something along the lines of 'manufacturer-name/some-product-name.html'. I don't see any immediate reason why that wouldn't work, though allowing the customer to change that themselves may not be trivial.

Hope that helps!

Thanks,
Joe

不甘平庸 2024-09-21 20:00:59

这是一种解决方法,但您可以创建一个制造商子类别并将产品放在其中吗?

所以:

root ->子类别->制造商子类别 ->产品

因为根据约瑟夫的回答,我认为你试图做的事情会有点混乱。

It is a workaround, but you could create a manufacturer subcategory and place the products in there?

So:

root -> subcategory -> manufacturer-subcategory -> product

?

Because as per Joseph's answer, I think what you're attempting to do would be a little messy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文