【问题标题】:Prestashop category URLPrestashop 类别 URL
【发布时间】:2016-01-11 22:37:28
【问题描述】:

有谁知道 PRESTASHOP 的分类 URL 是什么形式的?

如果我想使用分页和产品数量等其他参数来获取每个请求怎么办?

例如,我需要获取 category_id = 33、page = 5 和每页 10 个产品下的产品?

我希望有类似于产品 URL 的内容。

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

非常感谢您的任何帮助。这是高度赞赏。

【问题讨论】:

    标签: php prestashop


    【解决方案1】:

    基本类别网址是

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

    理论上变量np 应该分别控制产品的数量和页码,但是我无法让它们很好地工作。

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

    根据你在做什么,你可以使用类似的东西

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

    在模板中生成 URL。

    【讨论】:

    • 约翰,非常感谢你。我将出于展示目的的产品带到另一个站点。我为此使用了ajax,而您的答案是我需要的难题的最后一部分。谢谢你!
    【解决方案2】:

    这对我有用$this-&gt;context-&gt;link-&gt;getCategoryLink($categoryIdentifier)

    【讨论】:

      猜你喜欢
      • 2013-01-15
      • 1970-01-01
      • 2013-10-23
      • 2018-04-18
      • 2018-04-11
      • 2018-06-27
      • 2021-12-12
      • 1970-01-01
      • 2013-04-03
      相关资源
      最近更新 更多