Fabien Papet Fabien Papet - 1 year ago 947
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 ?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download