【发布时间】:2019-03-11 16:26:18
【问题描述】:
在 CS-Cart 版本 4.8.2.SP2 中,我正在尝试编辑前端常规搜索排序的参数。我试图在代码中找到设置的位置,以便我可以找到要使用的钩子以及它需要的格式。
谁能帮忙?
【问题讨论】:
在 CS-Cart 版本 4.8.2.SP2 中,我正在尝试编辑前端常规搜索排序的参数。我试图在代码中找到设置的位置,以便我可以找到要使用的钩子以及它需要的格式。
谁能帮忙?
【问题讨论】:
查看函数fn_search,它应该包含所有必要的信息;
您可能想要使用的钩子是:additional_fields_in_search。
在 hookbase (https://helpdesk.cs-cart.com/api) 中它的原型如下:
Executed for each part of a search query; it allows to modify the SQL conditions of the search
$params array List of parameters passed to fn_get_products functions
$fields array List of fields for retrieving
$sortings array Sorting fields
$condition string String containing SQL-query condition possibly prepended with a logical operator (AND or OR)
$join string String with the complete JOIN information (JOIN type, tables and fields) for an SQL-query
$sorting string String containing the SQL-query ORDER BY clause. This variable isn't used; it remains only for backward compatibility.
$group_by string String containing the SQL-query GROUP BY field. This variable isn't used; it remains only for backward compatibility.
$tmp string String containing SQL-query search condition by piece
$piece string Part of the search query
$having array HAVING condition
【讨论】: