Jump to content

Disable URL rewriting once it's set manually


mushegh
 Share

Recommended Posts

Hi,

 

I have two questions regarding URLs and languages and will appreciate any help.

 

Prestashop generates SEO friendly URLs when the option is turned on, however whenever I change the page name it rewrites the URL again. I need so that once the URL is set (manually or automatically) it can't change when I change the page name. The change can be done only manually. 

 

Any chance to do that. 

 

Second question is - adding lang file (theme -> lang - > lang.php file) had very weird effect on the site. Whatever I had translated before (product names and product titles) all disappeared. It's like it reset all things for that language. Is that possible? 

 

Thanks beforehand. I really need help for the first one. 

Share this post


Link to post
Share on other sites

For your first question, assuming you're using PrestaShop v1.6.1.5, it is lines 42-43 of admin/themes/default/controllers/products/input_text_lang.tpl that copies the product name to the friendly URL:

			onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"
			onblur="updateLinkRewrite();"

I suggest that you override the file and then change those lines to:

{if isset($smarty.get.add_product)}
			onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"
			onblur="updateLinkRewrite();"
{/if}

This will make it so the friendly URL is only updated when adding a new product.

Share this post


Link to post
Share on other sites

  • 5 years later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More