comodino Posted April 30, 2020 Share Posted April 30, 2020 hi, i'm trying to generate and list url of all combinations of a product....but it doesn't work! i do this $prodottoFeed['link'] = $link->getProductLink($product->id, $product->link_rewrite, null, null, null, null, $combinazione['id_attribute'],Configuration::get('PS_REWRITING_SETTINGS'), false, true); but generate an url that doesn't work Link to comment Share on other sites More sharing options...
Chill_user Posted May 1, 2020 Share Posted May 1, 2020 (edited) How I did it: $context = Context::getContext(); $product = new Product ($id_product, $id_lang); $combinations = $product->getAttributeCombinations($id_lang); //and for urls something like $link = new Link(); $url = $link->getProductLink($product); Edited May 1, 2020 by Amantha Bill (see edit history) Link to comment Share on other sites More sharing options...
comodino Posted May 1, 2020 Author Share Posted May 1, 2020 it return url of product father and not correct url for every combinations; i have solved this: with this for product without combinations: Context::getContext()->link->getProductLink( $product->id ); and for every combinations: Context::getContext()->getProductLink($product, null, null, null, null, null, $combination['id_product_attribute']); this work! 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