Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyword "{id_product_attribute}" required for route "product_rule" #12048

Closed
Goalfair opened this issue Jan 7, 2019 · 8 comments
Closed

Keyword "{id_product_attribute}" required for route "product_rule" #12048

Goalfair opened this issue Jan 7, 2019 · 8 comments
Labels
1.7.5.0 Affects versions BO Category: Back Office No change required Resolution: issue closed because expected as is SEO & URLs Label: Which BO under menu is concerned

Comments

@Goalfair
Copy link

Goalfair commented Jan 7, 2019

After otherwise successful migration from PS 1.6 to 1.7.5 when turning on "URL rewriting" (in "Shop Parameters - Traffic & SEO") I get the following error message:

Keyword "{id_product_attribute}" required for route "product_rule" (rule: "{category:/}{id}-{rewrite}{-:ean13}")

I can't switch on url rewrite because of that and I can't edit the URL scheme either, it is just not there.
I am using default prestashop modules and classic template.

Rewrite settings in old version (1.6) were as follows:

Route to products: {category:/}{id}-{rewrite}{-:ean13}
Route to category: {id}-{rewrite}
Route to category which has the "selected_filter" attribute for the "Layered Navigation" (blocklayered) module: {id}-{rewrite}{/:selected_filters}
Route to supplier: {id}__{rewrite}
Route to manufacturer: {id}_{rewrite}
Route to CMS page: content/{id}-{rewrite}
Route to CMS category: content/category/{id}-{rewrite}
Route to modules: module/{module}{/:controller}

Would it help if I change the "Route to products" to
{category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}
before upgrading from 1.6 to 1.7?

How to change that after the upgrade?

Additional information
PrestaShop version: 1.7.5.0
PHP version: 7.2.13
2019-01-07_prestashop01

@khouloudbelguith
Copy link
Contributor

Hi @Goalfair,

In the SEO&URLs page, in the Schema of URLs part, you can find the route to products:
The {-:id_product_attribute} is required, you need to add it.
image
Thanks to check & feedback.

@khouloudbelguith khouloudbelguith added BO Category: Back Office NMI Status: issue needs more information SEO & URLs Label: Which BO under menu is concerned 1.7.5.0 Affects versions labels Jan 7, 2019
@khouloudbelguith
Copy link
Contributor

Related to #12026

@Goalfair
Copy link
Author

Goalfair commented Jan 7, 2019

This whole section is missing in 1.7 (it was there in 1.6).

The following sections are present in menu item "traffic & seo":
• SEO & URLs
• Set up URLs
• Set shop URL
• Robots file generation

I do not have a "Schema of URLs", presumably because I can not turn on the "URL rewrite"?

@khouloudbelguith
Copy link
Contributor

@Goalfair, in your case "Friendly in disabled.
Could you please enable Friendly URLs Manually => you can do it in the database under the PREFIX_configuration table => search for the entry with name field equal to PREFIX_REWRITING_SETTINGS & edit the value to 1.
Or you can run this request SQL: UPDATE PREFIX_configurationSETvalue= '1' WHEREPREFIX_configuration.id_configuration = 9;

PS: PREFIX is the prefix of your tables, it could be for example ps.

Then you need to add {-:id_product_attribute} to the product route.
Thanks to check & feedback.

@Goalfair
Copy link
Author

Goalfair commented Jan 7, 2019

The command did not work, however I looked up the entry manually and changed it from 0 to 1.

Now the "Schema of URLs" section is available in "Traffic & SEO", and after changing the "Route to products" to
{category:/}{id}{-:id_product_attribute}-{rewrite}
I finally can enable URL rewrite. Thanks!

The last thing I had to do (just if someone else experiences a similar problem) was to use the same URL for "Shop domain" and "SSL domain". Previously the "Shop domain" had a www in front of it and the "SSL domain" did not, which meant when enabling "url rewrite" all the images would not be displayed (because of wrong URL).

@Goalfair Goalfair closed this as completed Jan 7, 2019
@khouloudbelguith
Copy link
Contributor

@Goalfair, thanks for your feedback.
Feel free to open a new one when needed.
Thanks!

@khouloudbelguith khouloudbelguith added No change required Resolution: issue closed because expected as is and removed NMI Status: issue needs more information labels Jan 7, 2019
@aecarlosae
Copy link

aecarlosae commented Mar 10, 2022

Hi @Goalfair,

In the SEO&URLs page, in the Schema of URLs part, you can find the route to products: The {-:id_product_attribute} is required, you need to add it. image Thanks to check & feedback.

This generates duplicated content... it's bad for SEO.

@smarzougui
Copy link

THis genrates internal Redirections 302, to the URL with the attribute ID.
And this very bad for SEO.
Any solutions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.5.0 Affects versions BO Category: Back Office No change required Resolution: issue closed because expected as is SEO & URLs Label: Which BO under menu is concerned
Projects
None yet
Development

No branches or pull requests

4 participants