只是在这里我陷入了一个我不太理解的问题!
我尝试恢复所有运行良好的产品:
$id_lang = (int)Context::getContext()->language->id;
$start = 0;
$limit = 100;
$order_by = 'id_product';
$order_way = 'DESC';
$id_category = false;
$only_active = true;
$context = null;
$all_products = Product::getProducts($id_lang, $start, $limit, $order_by, $order_way, $id_category, $only_active, $context);
除了我只需要显示具有预定义 ID 的产品。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
使用构造函数通过
id_product获取特定的Product实例。/** @var int Specific Product ID */ $id_product = 1337; /** @var Product Specific Product instance */ $specific_product = new Product($id_product); if(false !== $specific_product) { // Product found in database, so can use instance } else { // Product does not exist }