1
Как получить продукты с условием, например, все продукты с количеством 0? Я использую функцию getProducts, но нет условия для условия.Prestashop - получить продукцию с условием
/**
* Get all available products
*
* @param integer $id_lang Language id
* @param integer $start Start number
* @param integer $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) {...}
Я думал о том, чтобы добавить состояние после ГЭТ, но она поглощала больше ресурсов:
$products = $category->getProducts($this->context->language->id, 1, 100);
$condition_products;
foreach ($products as $key => $product)
{
if (condition)
{
$condition_products .= $product
}
}