In this post I am going to explain how to get product stock information in PrestaShop 1.7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | // Your product id $id_product = 10; // Language id $lang_id = (int) Configuration::get('PS_LANG_DEFAULT'); // Load product object $product = new Product($id_product, false, $lang_id); // Validate product object if (Validate::isLoadedObject($product)) { // Get product Quanity echo $product->quantity; // Get product minimum quantity echo $product->minimal_quantity; // Get product low stock threshold echo $product->low_stock_threshold; // Get product low stock alert echo $product->low_stock_alert; // Print Product Object echo "<pre>"; print_r($product); echo "</pre>"; } |
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!
Leave a Reply