Search code examples
phpprestashopprestashop-1.5

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 http://example.com/api/products
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?


Solution

  • 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.