Eutanasio Posted October 5, 2023 Share Posted October 5, 2023 (edited) Hi Anybody knows how to include the stock level (in stock OR out of stock) that has each product at the moment a customer places an order so it appears in the order confirmation email? as a proof for us and the customer to be aware of the availability of the products he ordered. PS v1.7 Regards Edited October 5, 2023 by Eutanasio PS v1.7 (see edit history) Link to comment Share on other sites More sharing options...
Eutanasio Posted October 6, 2023 Author Share Posted October 6, 2023 Well I did it,in case someone is interested.... in /classes/PaymentModule.php before this: $product_var_tpl = array you can add this: // Get product stock to add availability in email order confirmation $real_stock_quantity = StockAvailable::getQuantityAvailableByProduct($product['id_product'], $product['id_product_attribute']); if ($real_stock_quantity > 0) { $availability_label = $this->trans('In stock', array(), 'Shop.Theme.Catalog'); } elseif (isset($product['availability_date']) && $product['availability_date']) { $availability_label = $this->trans('Available on: ', array(), 'Shop.Theme.Catalog') . $product['availability_date']; } else { $availability_label = "Sur commande"; } Then for this info to appear in the email confirmation, in themes/YourTheme/mails/YourLanguage/order_conf_product_list.tpl Add this: ({$product['product_stock']}) Here like this: <font size="2" face="Open-sans, sans-serif" color="#555454"> <strong>{$product['name']}</strong> ({$product['product_stock']}) </font> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now