Article URL also with article code (instead of label only)

Help for integrating the Laravel package
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!
columbo
Advanced
Posts: 129
Joined: 09 Oct 2019, 09:42

Article URL also with article code (instead of label only)

Post by columbo » 13 May 2024, 14:03

Hi,

article URLs are derived from the article name (label).
  • Article label: 'Top Product A'
  • Article code: 1234
URL -> ..shop.com/top-product-a

This works well and we don't want to change it

There are some business cases where we need to change the product label (marketing etc.) but the product code (SKU) remains the same
  • Article label: 'NEW Product Z'
  • Article code: 1234
The article is now available at a new URL: ..shop.com/new-product-z
-> This causes problems with printed URLs such as QR codes.


Consideration / question:

Redirect from article code to the correct article URL
  1. generate QR code from the article code, eg. shop.com/code/1234
  2. scan QR code
  3. redirect to: shop.com/new-product-z
What do you think about this?
Does aimeos already have this or a similar feature?
How would you recommend implementing it?

Thank you!

User avatar
aimeos
Administrator
Posts: 8004
Joined: 01 Jan 1970, 00:00

Re: Article URL also with article code (instead of label only)

Post by aimeos » 15 May 2024, 06:54

This is one possible option but it doesn't exists in Aimeos yet you have have to build it on your own.

Another option would be to use the product ID in the URL by removing "d_prodid" from the "client/html/catalog/detail/url/filter" option:
https://github.com/aimeos/aimeos-larave ... t.php#L159

The later one only works for new QR codes which contains the product ID because the product ID has a higher precedence than the URL segment. From the SEO point of view adding the product ID to the URL will create new URLs for Google, so the existing ranking for product detail pages would be lost.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Advanced
Posts: 129
Joined: 09 Oct 2019, 09:42

Re: Article URL also with article code (instead of label only)

Post by columbo » 21 May 2024, 11:34

Is it possible to change d_prodid to prodcode? (prodcode would be our SKU and more meaningful)

= = =

If we have to build a solution: What's your recommendation?
Which aimeos manager is the best to extend?
Or using the Laravel function (new route entry, controller with lookup path in mshop_product table)?

Thank you!

User avatar
aimeos
Administrator
Posts: 8004
Joined: 01 Jan 1970, 00:00

Re: Article URL also with article code (instead of label only)

Post by aimeos » 22 May 2024, 12:47

columbo wrote: 21 May 2024, 11:34 Is it possible to change d_prodid to prodcode? (prodcode would be our SKU and more meaningful)
No, only the product ID.
columbo wrote: 21 May 2024, 11:34 Or using the Laravel function (new route entry, controller with lookup path in mshop_product table)?
Since it's a totally new endpoint, an own Laravel controller for that is best. You can use the Aimeos product manager in the controller to get the product:
https://aimeos.org/docs/latest/laravel/ ... os-objects
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply