Duplication of product URL segment is a problem
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Duplication of product URL segment is a problem
Hi!
I case I have 2 or more products with the same product name then I have the same product URL segments by default - and this is a problem, since all these products have totally the same URLs. Could you please advice what is the best way to change the default method of URL segment creation? Say I'd like to have the product's name + product's code as its URL segment. For instance,
/product_name_product_code - see the snapshot
Laravel 6.20.27
aimeos/aimeos-core 2020.10.24
PHP 7.4
I case I have 2 or more products with the same product name then I have the same product URL segments by default - and this is a problem, since all these products have totally the same URLs. Could you please advice what is the best way to change the default method of URL segment creation? Say I'd like to have the product's name + product's code as its URL segment. For instance,
/product_name_product_code - see the snapshot
Laravel 6.20.27
aimeos/aimeos-core 2020.10.24
PHP 7.4
- Attachments
-
- Screenshot_55.jpg (18.26 KiB) Viewed 1318 times
Re: Duplication of product URL segment is a problem
And when I set my custom URL using setUrl() function (for instance $item->setUrl($item->getURL() . '-' .$item->getCode()))
then on the catalog detail page there is error "No value for key "detailProductItem" found"
To fix this error I need just to save the product details page (/admin/default/jqadm/get/product/23168?lang=en) via standard Save button - and then everything's ok.
It seems the setUrl method doesn't update the mshop_index_text with new URLs.
So the question is the same: what is the correct way to update the product URL.segment value inside the code?
then on the catalog detail page there is error "No value for key "detailProductItem" found"
To fix this error I need just to save the product details page (/admin/default/jqadm/get/product/23168?lang=en) via standard Save button - and then everything's ok.
It seems the setUrl method doesn't update the mshop_index_text with new URLs.
So the question is the same: what is the correct way to update the product URL.segment value inside the code?
Re: Duplication of product URL segment is a problem
Set this configuration to an empty array:
https://aimeos.org/docs/2021.x/config/c ... il/#filter
i.e.:
Then, the product ID is part of the URL and will be used instead of the URL segment.
https://aimeos.org/docs/2021.x/config/c ... il/#filter
i.e.:
Code: Select all
'client' => [
'html' => [
'catalog' => [
'detail' => [
'filter' => []
]
]
]
]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star