1

admin ->category-> カスタム製品フィールド ( product_availability ) の製品リストで結果をオートコンプリートしようとしています。

以下は私のコードです

<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;
    }
});

オートコンプリートの結果が得られません。私がどこで間違っているのか誰かが知っていましたか?

4

1 に答える 1