Fabien Papet Fabien Papet - 4 months ago 203x
PHP Question

Get product URL using Prestashop API

I have two stores using Prestashop. I would like to import a products URLs list from the first to the second.

I can access to the product list by using


I can also access to the product information by using


By this way I can access to all products data but I can't find product URL.

Is there a way to retrieve a product URL from Prestashop ?


You can generate the product URL from the product ID:

$productUrl = 'http://mydomain.com/index.php?controller=product&id_product=' . $productId;

If Friendly URL is turned on then the URL will be rewritten.