StrangeAttractor Posted August 5, 2014 Share Posted August 5, 2014 (edited) 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 August 5, 2014 by StrangeAttractor (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted August 5, 2014 Share Posted August 5, 2014 Not sure, but I think in <main shop folder>/js/admin.js. And there probably function function copy2friendlyURL() Give it a try. Let us know :-) My $0.02, pascal. Link to comment Share on other sites More sharing options...
StrangeAttractor Posted August 6, 2014 Author Share Posted August 6, 2014 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 More sharing options...
PascalVG Posted August 8, 2014 Share Posted August 8, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now