コード例 #1
0
ファイル: Categories.php プロジェクト: dioscouri/f3-shop
 public function gmTaxonomyForSelection()
 {
     $term = $this->input->get('q', null, 'default');
     $results = \Shop\Models\GoogleMerchantTaxonomy::forSelection($term);
     $response = new \stdClass();
     $response->more = false;
     $response->term = $term;
     $response->results = $results;
     return $this->outputJson($response);
 }
コード例 #2
0
ファイル: fields_gm.php プロジェクト: dioscouri/f3-shop
        minimumInputLength: 3,
        ajax: {
            url: "./admin/shop/categories/google-merchant/forSelection",
            dataType: 'json',
            data: function (term, page) {
                return {
                    q: term
                };
            },
            results: function (data, page) {
                return {results: data.results};
            }
        }
        <?php 
if ($flash->old('gm_product_category')) {
    ?>
        , initSelection : function (element, callback) {
            var data = <?php 
    echo json_encode(\Shop\Models\GoogleMerchantTaxonomy::forSelection($flash->old('gm_product_category')));
    ?>
;
            callback(data[0]);            
        }
        <?php 
}
?>
    
    });

});
</script>