如何在Opencart中更改布局自动完成下拉列表


How to change layout autocomplete dropdown list in Opencart

当我们在opencart管理中使用自动完成时,它会显示产品名称的下拉列表(就像特色产品模块一样)。我想显示型号而不是产品名称。如果有人知道我该怎么做?

提前谢谢。

我认为您需要在产品名称上显示型号名称或其他内容。转到admin-->controller-->module-->featured modules(any other)转到编码

if ($product_info) {
                $this->data['products'][] = array(
                    'product_id' => $product_info['product_id'],
                    'name'       => $product_info['product_name']
                );
            }

将其替换为您需要的

if ($product_info) {
                $this->data['products'][] = array(
                    'product_id' => $product_info['product_id'],
                    'name'       => $product_info['model']
                );
            }

现在你只需要刷新它。产品名称将在管理面板中替换为型号名称。

'name' => strip_tags(html_entity_decode(
    $result['model'] . ' - ' . $result['name'],
    ENT_QUOTES,
    'UTF-8'
)),

给出型号和名称。