phunter121 Posted May 10, 2011 Share Posted May 10, 2011 I am trying to use this in a .tpl file as follows: getProductLink($id_product)|escape:'htmlall':'UTF-8'}">{l s='View Product Detail'} But it is returning the non-friendly URL, how would I change this to get the friendly URL? Link to comment Share on other sites More sharing options...
RJGonzalez Posted May 10, 2011 Share Posted May 10, 2011 I have notice that you have an error on your code bla bla A should have a commandTry to edit this line to do what you need it to do see if it works {$product.name|escape:htmlall:'UTF-8'} Link to comment Share on other sites More sharing options...
Asenar Posted May 11, 2011 Share Posted May 11, 2011 Hi,it's important to use $link->getProductLink() and not directly the link (this way this will be the correct url (if friendly url enabled) getProductLink($id_product)|escape:'htmlall':'UTF-8'}">{l s='View Product Detail'} {l s='View Product Detail'} You can copy/past a link example from a tpl file in default theme, prestashop/product-list.tpl for example Link to comment Share on other sites More sharing options...
phunter121 Posted May 11, 2011 Author Share Posted May 11, 2011 Thanks for that, I now have:This resolved the problem: {$link->getProductLink($smarty.get.id_product, $smarty.get.id_product.link_rewrite)|escape:'htmlall':'UTF-8'} Link to comment Share on other sites More sharing options...
A-Z Hosting Posted May 25, 2011 Share Posted May 25, 2011 What if we want to tell it what product id to return the friendly link for? Link to comment Share on other sites More sharing options...
Asenar Posted May 25, 2011 Share Posted May 25, 2011 URL rewrite is automatically chosen if you enable it in thé back office Link to comment Share on other sites More sharing options...
A-Z Hosting Posted May 25, 2011 Share Posted May 25, 2011 This was more what I was after but thank you. Something simple to return the product link info. Omitting the rewrite-string returns the non-friendly dynamic version.<a href="{$link->getProductLink('1', 'rewrite-string', '')}" > 1 Link to comment Share on other sites More sharing options...
Asenar Posted May 26, 2011 Share Posted May 26, 2011 Yes, that's it HyperConx, thanks you.Sorry the forum ate half characters I had written. Link to comment Share on other sites More sharing options...
Recommended Posts