vinay123 Posted July 23, 2012 Share Posted July 23, 2012 Hello, I have enable friendly url in my prestashop admin. I created a module slide show module in which i use the following code to generate the link to the product page : $obj = new product($product_id); $page_link = $obj->getLink(); which generates the link as such : http://localhost/dem...als-on-mp3.html My question is how can i add an extra parameter in the url example http://localhost/demo/en/EXTRAPARAMETER/14-deals-on-mp3.html and being able to retrieve the extra parameter via : Tool::getValue in on my productController page. Thank you Link to comment Share on other sites More sharing options...
math_php Posted July 25, 2012 Share Posted July 25, 2012 Hello, To get your parameter with Tool::getValue, means that your parameters have been url rewritten. Then yes the way you want it, ask you to modify rewrite engine along prestashop. Now I am scared. What is the final purpose of your parameters, there is perhaps a simplier and safer way to get the behaviour you want. Have a nice day. Link to comment Share on other sites More sharing options...
rrdavik Posted November 9, 2012 Share Posted November 9, 2012 I think i have the same problem... I need to difference between models of the same product.... I used combinations for this, so I got my product, and a list of models ( made like combinations.... ) The problem arrives with the list function... I can only change the image of the product... on mouse over... but I dont have any functionality that let me select one model... to send it to the shopcart... I always send the first model... so I started to change the product logic so I can send models to the url... so product controller can difference between different models of the same product... so the shopcart can do it too... I dont know if I explain myself.... But I see sending another parameter to the url as a solution... maybe I can use a data estructure to save the selection of the model... and use this data always i need to create a linkt with this product... but we loose the firendly-url information with this solution.... Link to comment Share on other sites More sharing options...
mister_j Posted January 22, 2016 Share Posted January 22, 2016 Hello, very old post, but i managed to solve it. To add parameter to link in product list I use : {$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, $product.ean13, null, null, $product.id_product_attribute)} Product-list.tpl But first, you have to add product attribute, to product. Where all products are assigned. And append add to cart button &id_product_attribute={$product.id_product_attribute} on same tpl. Hope this solves someone problem 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted May 8, 2017 Share Posted May 8, 2017 (edited) I just want to say that I achieved what i want with this code $link->getProductLink($product.id, $product.link_rewrite, null, null, null, null, <<<<your product id attribute >>>>, false ,false, true) just change <<<<your product id attribute >>>> to yours id_product_attribute and that's all. Edited May 8, 2017 by hakeryk2 (see edit history) 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