Rumah > Soal Jawab > teks badan
Di sini sahaja saya terjebak dengan masalah yang saya tidak faham!
Saya cuba memulihkan semua yang berfungsi dengan baik:
$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);
Kecuali saya hanya perlu memaparkan produk dengan ID yang telah ditetapkan.
P粉4102398192024-03-30 15:20:32
Lulus id_product
获取特定的Product
contoh menggunakan pembina.
/** @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 }