1

我一直在寻找,似乎无法找到解决方案。我在灯组上运行 6.5.15 CE,我在模块生成器中创建了 2 个自定义模块并在工作室中对其进行了编辑。客户和订单,订单模块显示为客户模块的子面板。我的全球搜索在客户模块上工作得很好,但在订单模块上却不行。首先,我尝试了一个示例,说明创建以下页面 /custom/Extension/modules/cb_orders/ext/Vardefs/customGlobalSearchFields.php 不起作用,因此我已将模块和字段名称添加到 custom/modules/cb_orders/EXT /vardefs/vardefs.php

<?php
// define custom fields to be included in the search algorithm!
$dictionary['cb_orders']['unified_search'] = true;
$dictionary['cb_orders']['unified_search_default_enabled'] = true;
// order number
$dictionary['cb_orders']['fields']['cb_order_number']['rname'] = 'cb_order_number';
$dictionary['cb_orders']['fields']['cb_order_number']['vname'] = 'LBL_CB_ORDER_NUMBER';
$dictionary['cb_orders']['fields']['cb_order_number']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['cb_order_number']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['cb_order_number']['table'] = 'cb_orders';
$dictionary['cb_orders']['fields']['cb_order_number']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// tracking number
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['rname'] =    'cb_shipping_tracking_number';
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['vname'] = 'LBL_CB_SHIPPING_TRACKING_NUMBER';
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['table'] = 'cb_orders';
$dictionary['cb_orders']['fields']['cb_shipping_tracking_number']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// order description
$dictionary['cb_orders']['fields']['order_description']['rname'] = 'order_description';
$dictionary['cb_orders']['fields']['order_description']['vname'] = 'LBL_ORDER_DESCRIPTION';
$dictionary['cb_orders']['fields']['order_description']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['order_description']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['order_description']['table'] = 'cb_orders';
$dictionary['cb_orders']['fields']['order_description']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// shipping company used
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['rname'] = 'cb_orders_shipping_company';
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['vname'] = 'LBL_CB_ORDERS_SHIPPING_COMPANY';
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['table'] = 'cb_orders';
$dictionary['cb_orders']['fields']['cb_orders_shipping_company']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// which cart the order came from
$dictionary['cb_orders']['fields']['cb_referrer_c']['rname'] = 'cb_referrer_c';
$dictionary['cb_orders']['fields']['cb_referrer_c']['vname'] = 'LBL_CB_REFERRER';
$dictionary['cb_orders']['fields']['cb_referrer_c']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['cb_referrer_c']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['cb_referrer_c']['table'] = 'cb_orders';
$dictionary['cb_orders']['fields']['cb_referrer_c']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// date and time ordered
$dictionary['cb_orders']['fields']['date_time_ordered_c']['rname'] = 'date_time_ordered_c';
$dictionary['cb_orders']['fields']['date_time_ordered_c']['vname'] = 'LBL_DATE_TIME_ORDERED';
$dictionary['cb_orders']['fields']['date_time_ordered_c']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['date_time_ordered_c']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['date_time_ordered_c']['table'] = 'cb_orders_cstm';
$dictionary['cb_orders']['fields']['date_time_ordered_c']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;
// last four of social
$dictionary['cb_orders']['fields']['cb_lastfour_c']['rname'] = 'cb_lastfour_c';
$dictionary['cb_orders']['fields']['cb_lastfour_c']['vname'] = 'LBL_CB_LASTFOUR';
$dictionary['cb_orders']['fields']['cb_lastfour_c']['type'] = 'TextField';
$dictionary['cb_orders']['fields']['cb_lastfour_c']['dbType'] = 'varchar';
$dictionary['cb_orders']['fields']['cb_lastfour_c']['table'] = 'cb_orders_cstm';
$dictionary['cb_orders']['fields']['cb_lastfour_c']['unified_search_default_enabled'] = true;
//$dictionary['cb_orders']['unified_search'] = true;

文件和 custom/modules/cb_orders/metadata/searchfields.php 文件,如糖论坛上的示例所示。

$searchFields['cb_orders']['cb_order_number'] = array('query_type' => 'default');
$searchFields['cb_orders']['cb_shipping_tracking_number'] = array('query_type' => 'default');
$searchFields['cb_orders']['order_description'] = array('query_type' => 'default');
$searchFields['cb_orders']['cb_orders_shipping_company'] = array('query_type' => 'default');
$searchFields['cb_orders']['cb_referrer_c'] = array('query_type' => 'default');
$searchFields['cb_orders']['date_time_ordered_c'] = array('query_type' => 'default');

重建后,我似乎仍然无法搜索该模块。

这可能是由于一对多关系(一个客户对多个订单)造成的吗?

4

2 回答 2

2

我不知道你是否有这个工作,但我注意到你有,作为你的路径

custom/modules/cb_orders/metadata/searchfields.php

什么时候应该

custom/modules/cb_orders/metadata/SearchFields.php

(SearchFields.php 中的大写字母 S 和 F)

至于第一条路

custom/Extension/modules/cb_orders/ext/Vardefs/customGlobalSearchFields.php

你可以使用任何文件名,它不必是 vardefs.php 检查

custom/modules/cb_orders/Ext/Vardefs/vardefs.ext.php 

文件以确认在修复和重建中捕获了添加,无论文件名如何。

你有没有在不需要做的情况下完成这个工作admin -> Global Search -> Drag&Drop

于 2014-03-06T12:23:36.867 回答
1

我必须另外删除 /cache/modules/unified_search_modules.php 才能使其正常工作。删除后搜索后会再次生成。

于 2015-10-01T13:56:41.210 回答