Replies: 1 comment
-
Hello Yes could be nice to restore old behavior about default product url, I don't see any use where id_product_attribute could be useful. I presume was to simplify router/dispatcher rules, but without conviction. Have a nice day |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The problem
As you know, standard product URL includes ID of product, ID of combination and in most cases #anchor to selected attributes. Something like this:
/15-120-some-product.html#/1-size-s/10-color-red
That is really useful for URLs pointing to non-default combinations. When a product page is accessed via URL with a combination identifier, required attributes are automatically pre-selected.
But this rule also applies to URLs that are pointing to default combinations. However this is not required at all.
Let's say combination 125 is the default combination of product 15.
In this case both of these links will point to exactly same page with same pre-selected attributes:
/15-125-some-product.html#/1-size-m/15-color-orange
/15-some-product.html
Obviously 2nd link is better.
If you open any category page on a standard PS installation, you will notice, that most of product URLs include default combination identifiers that are useless. Once again - they are useless for default combinations, but they are useful for non-default combinations.
The solution
I am planning to submit a PR for removing default combination IDs from URLs.
There can be different ways to achieve that behavior:
getProductURL()
inProductLazyArray.php
This fix will work for most of themes. But it will update URLs everywhere, including cart summary.
Probably default combination identifiers should remain in cart summary.
Override
getURL()
only forProductListingLazyArray.php
Same as above, it will update URLs in cart summary
Modify
/miniatures/product.tpl
in classic themeThis fix will work only on actual product listing pages like category, new-products, etc...
But many existing shops will not benefit from this update, because most of them use custom themes, and not all of them update their themes regularly. Moreover, it can take a while before custom theme developers update their tpls.
So, what do you think would be the most optimal way to go?
Do you plan to work on this subject?
Beta Was this translation helpful? Give feedback.
All reactions