2016-11-04 11 views
0

Ich möchte alle Produkte meines Prestashop 1.6 bekommen.prestashop 1.6 Alle Produkte erhalten

Kann jemand mich lernen, alle Produkte zu bekommen? So etwas wie

$products = Controller::getAllProducts(); 

oder

$products = Controller::getProducts(); 

Und wenn dies nicht möglich ist, wie die Produkte nach Kategorie erhalten ein HTML wählen verwenden?

Antwort

1

in Ihrem Modul oder kundenspezifische Steuerungstyp:

$products = Product::getProducts($this->context->language->id, 1, 5000, 'name', 'ASC'); 

Der Prototyp getProducts() Methode:

/** 
    * Get all available products 
    * 
    * @param int $id_lang Language id 
    * @param int $start Start number 
    * @param int $limit Number of products to return 
    * @param string $order_by Field for ordering 
    * @param string $order_way Way for ordering (ASC or DESC) 
    * @return array Products details 
    */ 
    public static function getProducts($id_lang, $start, $limit, $order_by, $order_way, $id_category = false, $only_active = false, Context $context = null) 
Verwandte Themen