【问题标题】:How to override the fncatelog.php function in cscart如何覆盖cs购物车中的catalog.php函数
【发布时间】:2015-04-07 12:36:56
【问题描述】:

我需要在我的新插件中覆盖 cscart 中的 fncatelog.php。

 My addon files :-

  1.  app/addons/newaddon/frontend/controllers/frontend/categories.post.php
  2. design/themes/response/templates/addons/newaddon/overrides/blocks/product_filters/original.tpl

  In func.php 

          I need to override the fn_get_filters_products_count() this function in my newaddon.

我该怎么办。请帮帮我。

【问题讨论】:

    标签: php cs-cart


    【解决方案1】:

    你不能覆盖整个函数。但是您可以使用钩子来修改输入参数和返回参数。 在你的情况下,钩子是

    1. get_filters_products_count_pre 修改输入参数,
    2. get_filters_products_count_before_select_filters 更改查询参数

    要了解有关 cscart 钩子的更多信息,请使用此链接 - http://docs.cs-cart.com/4.3.x/developer_guide/core/coding_standards/hooks.html

    【讨论】:

      【解决方案2】:

      您可以使用以下钩子之一来修改此函数返回的数据: get_filters_products_count_pre get_filters_products_count_before_select_filters get_product_filter_fields

      您可以在http://docs.cs-cart.com/4.2.x/addons/hooking/index.html 页面阅读更多关于 CS-Cart 中的钩子系统的信息。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-04-03
        • 2017-04-05
        • 1970-01-01
        • 2013-12-02
        • 1970-01-01
        相关资源
        最近更新 更多