Product link ecommerce

Permalink 1 user found helpful
Hi everyone!

I hope I'm in the right forum section. How can I get the link to a specific product with the ecommerce addon?

For example, this is how I get the title of one product :

$products[$i]->getProductName();

where "$i" is part of a "for loop" for each of my products.

Thank you!

 
Cocolabaloune replied on at Permalink Best Answer Reply
I just figured out a way that works for me. Here is the solution I used if anybody need it :

$linksTo = Page::getByID($products[$i]->getProductCollectionID());
echo Loader::helper('navigation')->getLinkToCollection($linksTo);

where $products[$i] is your product and the second line display the url of the product.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.