{"id":7521,"date":"2019-10-11T08:30:59","date_gmt":"2019-10-11T03:00:59","guid":{"rendered":"https:\/\/www.hiddentechies.com\/blog\/?p=7521"},"modified":"2020-10-08T19:42:22","modified_gmt":"2020-10-08T14:12:22","slug":"get-product-url-by-product-id-in-prestashop","status":"publish","type":"post","link":"https:\/\/www.hiddentechies.com\/blog\/prestashop\/get-product-url-by-product-id-in-prestashop\/","title":{"rendered":"How to get Product Url by Product Id in PrestaShop 1.7"},"content":{"rendered":"<p>In this post I am going to explain how Get Product Url by Product Id in PrestaShop 1.7.<\/p>\n<pre class=\"lang:default decode:true \">\/\/ Your Product id\r\n$id_product = 10;\r\n\r\n\/\/ Language id\r\n$id_lang = (int) Configuration::get('PS_LANG_DEFAULT');\r\n\r\n\/\/ Load Product object\r\n$product = new Product($id_product, false, $id_lang);\r\n\r\n\/\/ Validate Product object\r\nif (Validate::isLoadedObject($product)) {\r\n\t\/\/ Initialize the Link Object\r\n\t$link = new Link();\r\n\r\n\t\/\/ Get Product URL\r\n\t$url = $link-&gt;getProductLink($product);\r\n\r\n\techo $url;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<div class=\"angwp_12010 _ning_cont _ning_hidden _ning_outer _align_center responsive\" data-size=\"custom\" data-bid=\"12010\" data-aid=\"0\" style=\"max-width:800px; width:100%;height:inherit;\"><div class=\"_ning_label _left\" style=\"\"><\/div><div class=\"_ning_inner\" style=\"\"><a href=\"https:\/\/www.hiddentechies.com\/blog?_dnlink=12010&t=1776038083\" class=\"strack_cli _ning_link\" target=\"_blank\">&nbsp;<\/a><div class=\"_ning_elmt\"><img decoding=\"async\" src=\"https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/angwp\/items\/12010\/Banner-2.png\" \/><\/div><\/div><\/div><div class=\"clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>In this post I am going to explain how Get Product Url by Product Id in PrestaShop 1.7. \/\/ Your Product id $id_product = 10; \/\/ Language id $id_lang = (int) Configuration::get(&#8216;PS_LANG_DEFAULT&#8217;); \/\/ Load Product object $product = new Product($id_product, false, $id_lang); \/\/ Validate Product object if (Validate::isLoadedObject($product)) { \/\/ Initialize the Link Object $link&#8230; <\/p>\n<div class=\"actions\"><a href=\"https:\/\/www.hiddentechies.com\/blog\/prestashop\/get-product-url-by-product-id-in-prestashop\/\">Continue Reading<\/a><\/div>\n","protected":false},"author":1,"featured_media":7526,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221,222,2139],"tags":[313,329],"_links":{"self":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7521"}],"collection":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/comments?post=7521"}],"version-history":[{"count":1,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7521\/revisions"}],"predecessor-version":[{"id":7522,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7521\/revisions\/7522"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media\/7526"}],"wp:attachment":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media?parent=7521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/categories?post=7521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/tags?post=7521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}