Jump to content

Where can I change goods URLs generation logic?


StrangeAttractor

Recommended Posts

PrestaShop implements some logic (bare transliteration and string cleaning as far as I can see) to generate human-readable ("SEO friendly") URLs from product names.

 

I would like to adjust this behaviour to fit my preferences. For example I'd like it to include the product reference code (or the EAN code, I have not decided yet) and always derive from the English product name (I have 3 languages incl. English at my store) instead generating a completely different URL for every language.

 

In what particular PrestaShop code file is this logic implemented and can be changed?

Edited by StrangeAttractor (see edit history)
Link to comment
Share on other sites

Looks like that's there. Would you also be so kind to tell me where is $ defined?

 

It uses expressions like $('#link_rewrite_' + id_language) and $('#name_' + id_language) to store and retreive fields, I am cruious about finding the whole list fo these fields (I'd like to access reference and ean codes for example).

Link to comment
Share on other sites

The $(#link_rewrite_'+id_language) will give you a reference to the object (defined by it's name #link_rewrite'+id_language, which first translates to something like '#line_rewrite_0', '#link_rewrite_1'). So a short way to get to the objects in your form etc.

 

More details here:

http://stackoverflow.com/questions/10787342/why-does-jquery-have-dollar-signs-everywhere

or:

http://stackoverflow.com/questions/205853/why-would-a-javascript-variable-start-with-a-dollar-sign

 

 

Hope this helps,

pascal.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...