изменить новые продукты, чтобы отобразить все продукты на домашней странице pestashop
Я хочу изменить новые продукты, чтобы отобразить весь продукт на домашней странице с помощью этой функции:
Product::getProducts((int) $this->context->language->id, 0,0, 'id_product', 'DESC', 0);
Оригинальная функция:
$newProducts = Product::getNewProducts((int) $this->context->language->id, 0);
Я покажу эти данные в файле product-list.tpl
.
Но когда я использую Product::getProducts()
функцию, массив продуктов показано, как это:
array (size=61)
'id_product' => string '32' (length=2)
'id_supplier' => string '10' (length=2)
'id_manufacturer' => string '0' (length=1)
'id_category_default' => string '2' (length=1)
'id_shop_default' => string '1' (length=1)
'id_tax_rules_group' => string '1' (length=1)
'on_sale' => string '0' (length=1)
'online_only' => string '0' (length=1)
'ean13' => string '' (length=0)
'upc' => string '' (length=0)
'ecotax' => string '0.000000' (length=8)
'quantity' => string '0' (length=1)
'minimal_quantity' => string '1' (length=1)
'price' => string '174.900000' (length=10)
'wholesale_price' => string '0.000000' (length=8)
'unity' => string '' (length=0)
'unit_price_ratio' => string '0.000000' (length=8)
'additional_shipping_cost' => string '0.00' (length=4)
'reference' => string '' (length=0)
'supplier_reference' => string '' (length=0)
'location' => string '' (length=0)
'width' => string '0.000000' (length=8)
'height' => string '0.000000' (length=8)
'depth' => string '0.000000' (length=8)
'weight' => string '0.000000' (length=8)
'out_of_stock' => string '2' (length=1)
'quantity_discount' => string '0' (length=1)
'customizable' => string '0' (length=1)
'uploadable_files' => string '0' (length=1)
'text_fields' => string '0' (length=1)
'active' => string '1' (length=1)
'redirect_type' => string '' (length=0)
'id_product_redirected' => string '0' (length=1)
'available_for_order' => string '1' (length=1)
'available_date' => string '0000-00-00' (length=10)
'condition' => string 'new' (length=3)
'show_price' => string '1' (length=1)
'indexed' => string '0' (length=1)
'visibility' => string 'both' (length=4)
'cache_is_pack' => string '0' (length=1)
'cache_has_attachments' => string '0' (length=1)
'is_virtual' => string '0' (length=1)
'cache_default_attribute' => string '0' (length=1)
'date_add' => string '2016-02-10 03:20:06' (length=19)
'date_upd' => string '2016-02-10 03:20:30' (length=19)
'advanced_stock_management' => string '0' (length=1)
'id_shop' => string '1' (length=1)
'id_lang' => string '1' (length=1)
'description' => string '<p><span> LEGO Mos Eisley Cantina</span></p><p><span>Age 8-14</span></p><p><span><br /></span></p><p><span>Recreate iconic Star Wars scenes at Mos Eisley Cantina™!</span></p><p><span>Welcome to the noisy and dangerous Mos Eisley Cantina™ on the desert world of Tatooine! Park the landspeeder and enter, staying clear of the giant dewback drinking from the trough outside. Make sure Luke, Han and Obi-Wan have their weapons with them as they enter through the sliding door and walk past the droid scanner. Op'... (length=2342)
'description_short' => string '' (length=0)
'link_rewrite' => string 'lego-75052' (length=10)
'meta_description' => string '' (length=0)
'meta_keywords' => string '' (length=0)
'meta_title' => string '' (length=0)
'name' => string 'LEGO 75052' (length=10)
'available_now' => string '' (length=0)
'available_later' => string '' (length=0)
'manufacturer_name' => null
'supplier_name' => string 'Kids World' (length=10)
'rate' => float 0
'tax_name' => string '' (length=0)
И используя Product::getNewProducts()
функцию, массив продуктов показано, как это:
array (size=80)
'id_product' => string '30' (length=2)
'id_supplier' => string '10' (length=2)
'id_manufacturer' => string '0' (length=1)
'id_category_default' => string '2' (length=1)
'id_shop_default' => string '1' (length=1)
'id_tax_rules_group' => string '1' (length=1)
'on_sale' => string '0' (length=1)
'online_only' => string '0' (length=1)
'ean13' => string '' (length=0)
'upc' => string '' (length=0)
'ecotax' => string '0.000000' (length=8)
'quantity' => int 1
'minimal_quantity' => string '1' (length=1)
'price' => float 172.9
'wholesale_price' => string '0.000000' (length=8)
'unity' => string '' (length=0)
'unit_price_ratio' => string '0.000000' (length=8)
'additional_shipping_cost' => string '0.00' (length=4)
'reference' => string '' (length=0)
'supplier_reference' => string '' (length=0)
'location' => string '' (length=0)
'width' => string '0.000000' (length=8)
'height' => string '0.000000' (length=8)
'depth' => string '0.000000' (length=8)
'weight' => string '0.000000' (length=8)
'out_of_stock' => string '0' (length=1)
'quantity_discount' => string '0' (length=1)
'customizable' => string '0' (length=1)
'uploadable_files' => string '0' (length=1)
'text_fields' => string '0' (length=1)
'active' => string '1' (length=1)
'redirect_type' => string '' (length=0)
'id_product_redirected' => string '0' (length=1)
'available_for_order' => string '1' (length=1)
'available_date' => string '0000-00-00' (length=10)
'condition' => string 'new' (length=3)
'show_price' => string '1' (length=1)
'indexed' => string '0' (length=1)
'visibility' => string 'both' (length=4)
'cache_is_pack' => string '0' (length=1)
'cache_has_attachments' => string '0' (length=1)
'is_virtual' => string '0' (length=1)
'cache_default_attribute' => string '0' (length=1)
'date_add' => string '2016-02-10 03:20:06' (length=19)
'date_upd' => string '2016-02-10 03:20:17' (length=19)
'advanced_stock_management' => string '0' (length=1)
'id_shop' => string '1' (length=1)
'description' => string '<p><span>LEGO Super Secret Police Dr</span></p><p><span>Age 9-14</span></p><p><span>Pursue Emmet and the Master Builders in the awesome Dropship!</span></p><p><span>Lord Business’ Robo Police have invaded Cloud Cuckoo Land in their high-tech Dropship and are in hot pursuit of Emmet, Batman™, Green Ninja and Johnny Thunder! With a pair of Robo SWATs at the controls in the dual cockpit, fire up the rocket boosters for lift-off. Once airborne, turn the rear control to rotate the boosters and surge forward '... (length=2259)
'description_short' => string '' (length=0)
'link_rewrite' => string 'lego-70815' (length=10)
'meta_description' => string '' (length=0)
'meta_keywords' => string '' (length=0)
'meta_title' => string '' (length=0)
'name' => string 'LEGO 70815' (length=10)
'available_now' => string '' (length=0)
'available_later' => string '' (length=0)
'id_image' => string '30-367' (length=6)
'legend' => string '' (length=0)
'manufacturer_name' => null
'new' => string '1' (length=1)
'product_attribute_minimal_quantity' => null
'id_product_attribute' => string '0' (length=1)
'allow_oosp' => int 0
'category' => string 'home' (length=4)
'link' => string 'http://192.168.120.9/shop168.com/index.php?id_product=30&controller=product&id_lang=1' (length=85)
'attribute_price' => int 0
'price_tax_exc' => float 172.9
'price_without_reduction' => float 172.9
'reduction' => float 0
'specific_prices' =>
array (size=0)
empty
'quantity_all_versions' => int 1
'features' =>
array (size=0)
empty
'attachments' =>
array (size=0)
empty
'virtual' => int 0
'pack' => int 0
'packItems' =>
array (size=0)
empty
'nopackprice' => int 0
'customization_required' => boolean false
'rate' => float 0
'tax_name' => string '' (length=0)
Если я использую Product::getProducts()
Я могу получить 61 значение массива, но когда я использую функцию Product::getNewProducts()
, я могу получить 80 значений массива. Так как я могу получить 80 значений массива, используя функцию Product::getProducts()
?
Благодарности теперь работает я измените его на эту функцию '$ category = new Category (Context :: getContext() -> shop-> getCategory(), (int) Context :: getContext() -> language-> id); return $ products = $ category-> getProducts ((int) Context :: getContext() -> language-> id, ($ st? $ St: 0), ($ nb? $ Nb: 100), 'id_product' , 'DESC'); ' –