Warm tip: This article is reproduced from serverfault.com, please click

Prestashop category URL

发布于 2016-01-11 22:37:28

Does anyone know what is the form of PRESTASHOP's category URLs?

What if I want to use other parameters like pagination and number of products to get per request?

For instance, I need to get products under category_id = 33, page = 5, and 10 products per page?

I am hoping there is something similar to the URL of a product.

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

Thank you so much in advanced for any help. It is highly appreciated.

Questioner
user2581369
Viewed
0
John C 2016-01-12 10:56:47

The basic category URL is

index.php?controller=category&id_category=<categoryId>

In theory the variables n and p should control the number of products and the page number respectively, but I haven't been able to get them to work very well.

index.php?controller=category&id_category=2&n=4&p=2

Depending on what you are doing, you may be able to use something like

{$link->getCategoryLink({$cat.id_category})}

in a template to generate a URL instead.