In this post I am going to explain how Get Product Url by Product Id in PrestaShop 1.7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | // Your Product id $id_product = 10; // Language id $id_lang = (int) Configuration::get('PS_LANG_DEFAULT'); // Load Product object $product = new Product($id_product, false, $id_lang); // Validate Product object if (Validate::isLoadedObject($product)) { // Initialize the Link Object $link = new Link(); // Get Product URL $url = $link->getProductLink($product); echo $url; } |
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!
Leave a Reply