【问题标题】:Opencart custom product field autocompleteOpencart 自定义产品字段自动完成
【发布时间】:2013-10-28 06:57:09
【问题描述】:

我正在尝试在 admin ->category-> 自定义产品字段 (product_availability) 的产品列表中执行 autocomplete results

下面是我的代码

<script type="text/javascript"><!--

$('input[name=\'filter_product_availability\']').autocomplete({
    delay: 500,
    source: function(request, response) {
        $.ajax({
            url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_product_availability=' +  encodeURIComponent(request.term),
            dataType: 'json',
            success: function(json) {       
                response($.map(json, function(item) {
                    return {
                        label: product_availability,
                        value: product_id
                    }
                }));
            }
        });
    }, 
    select: function(event, ui) {
        $('input[name=\'filter_anandtronicspartno\']').val(ui.item.label);

        return false;
    },
    focus: function(event, ui) {
        return false;
    }
});

我没有收到任何自动填充结果。 有谁知道我在哪里做错了吗?

【问题讨论】:

    标签: autocomplete opencart custom-fields product


    【解决方案1】:

    检查您的 $token 变量。你可能还没有设置这个。

    【讨论】:

      猜你喜欢
      • 2018-01-10
      • 1970-01-01
      • 2021-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多