razvy Posted February 4, 2020 Posted February 4, 2020 Hi, I want to add in the order confirmation email a column with the product availability (in stock, on order) along with the information that is already shown (product code, name, quantity, price). The text I want to add lies in the table "ps_product_lang", column "available_now". I have tried to modify the mailalerts.php, but I don't know how to make it get the info from this table. Anyone could help me? The shop is on PS 1.6.1.1. Thank you! Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 I'd like this as well - I know it shows at checkout, but customers sometimes miss this, so it would be great to include this in the order confirmation email the customer gets when placing an order. Has anyone done this successfully? Can't think that it's not an improvement that would benefit most sellers and reduce customer calls asking what was out of stock as they didn't notice the message at checkout! Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 (edited) Do you need to display it in the email order_conf = email that the customer will receive after the order? Do you need to display it in the email new_order = mailalert module, which will be received by the store administrator? Only for Prestashop 1.6.1 ? Edited March 8, 2021 by Guest (see edit history) Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 (edited) Hi Daniel - thanks for the reply...It's the email order_conf that the customer gets after ordering. Yes only for Prestashop 1.6.1 Edited March 8, 2021 by ukbaz (see edit history) Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 Ok. Do you want to add information under the product name or under quantity? Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 Hi Daniel, preferably under product name - but under quantity is OK too - as long as it's there Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 And do you want to display the text there? E.g. in stock (46) or not in stock? Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 Hi Daniel - preferably just not in stock against items that are out of stock Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 Basically same message that appears in shopping cart product line template where it says in stock or out of stock Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 (edited) Prestashop 1.6.1.1 1. open ./classes/PaymentModule.php 2. find $product_var_tpl = array( 3. add before $product_in_stock = ''; $qty_stock = Product::getQuantity($product['id_product'], $product['id_product_attribute']); if ($qty_stock > 0){ $product_in_stock = 'In stock'; } else { $product_in_stock = 'Out of stock'; } 4. add after 'quantity' => $product['quantity'], 5. availability .'<br />'.$product_in_stock, full sample in image: full sample PaymentModule.php PaymentModule.php Edited March 8, 2021 by Guest (see edit history) Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 Don't forget to clear the cache! Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 If you need multilingual text, change part of the code to: if ($qty_stock > 0){ $product_in_stock = $this->l('In stock'); } else { $product_in_stock = $this->l('Out of stock'); } Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 Perfect - Thanks Daniel! Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 There is another option, but what I wrote you is the fastest way 😉 Share this post Link to post Share on other sites More sharing options...
Guest Posted March 8, 2021 Posted March 8, 2021 (edited) You can like my posts. Just click on the gray heart below my posts. I gladly helped 😉 Edited March 8, 2021 by Guest (see edit history) Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 8, 2021 Posted March 8, 2021 Fastest works for me Thanks again!! Baz Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 10, 2021 Posted March 10, 2021 Hi Daniel - Me again! Quick question... I have various 'out of stock' messages set in quantities tab for product, the se show in Shopping Cart product line at checkout. They use the variables {$product->available_now} & {$product->available_later} to determine correct message to display. Is there a way to use these values rather than 'in stock' and 'out of stock'? Baz Share this post Link to post Share on other sites More sharing options...
Guest Posted March 10, 2021 Posted March 10, 2021 Hi, Quick Reply. Yes, it can be done. Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 10, 2021 Posted March 10, 2021 Does it involve changing much Daniel? Any chance of a less quick reply to my quick question? Thanks Baz Share this post Link to post Share on other sites More sharing options...
Guest Posted March 10, 2021 Posted March 10, 2021 ????? These texts ????? Share this post Link to post Share on other sites More sharing options...
Guest Posted March 10, 2021 Posted March 10, 2021 change: if ($qty_stock > 0){ $product_in_stock = $this->l('In stock'); } else { $product_in_stock = $this->l('Out of stock'); } to: if ($qty_stock > 0){ if ($product['available_now']){ $product_in_stock = $product['available_now']; } else { $product_in_stock = $this->l('In stock'); } } else { if ($product['available_later']){ $product_in_stock = $product['available_later']; } else { $product_in_stock = $this->l('Out of stock'); } } Share this post Link to post Share on other sites More sharing options...
ukbaz Posted March 10, 2021 Posted March 10, 2021 Brilliant Daniel! Thanks!! Baz Share this post Link to post Share on other sites More sharing options...
Guest Posted March 10, 2021 Posted March 10, 2021 I gladly helped 😉 Share this post Link to post Share on other sites More sharing options...
KunnSistemas Posted September 9, 2021 Posted September 9, 2021 Is it possible to add this for prestashop 1.7? Thanks in advance, Share this post Link to post Share on other sites More sharing options...
ukbaz Posted November 29, 2021 Posted November 29, 2021 Id like to add this for 1.7 as well - anyone? Thanks, Baz Share this post Link to post Share on other sites More sharing options...
keshva Posted January 5 Posted January 5 mails/_partials replace file code order_conf_product_list.tpl to and clear cache and check replace your text you Beställningsvara 3-7 dagar and Sista produkten i lager need any help contact skype id : keshva.thakur {** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <[email protected]> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) *} {foreach $list as $product} <tr> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['reference']} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> <strong>{$product['name']}</strong> {if count($product['customization']) == 1} <br> {foreach $product['customization'] as $customization} {$customization['customization_text']} {/foreach} {/if} {hook h='displayProductPriceBlock' product=$product type="unit_price"} <br/> {if $product['quantity'] > 0} {if $product['available_now']} {$product['available_now']} {else} Beställningsvara 3-7 dagar {/if} {else} {if $product['available_later']} {$product['available_later']} {else} Sista produkten i lager {/if} {/if} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td align="right"> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['unit_price']} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td align="right"> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['quantity']} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td align="right"> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['price']} </font> </td> <td width="5"> </td> </tr> </table> </td> </tr> {if count($product['customization']) > 1} {foreach $product['customization'] as $customization} <tr> <td colspan="3" style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$customization['customization_text']} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="5"> </td> <td align="right"> <font size="2" face="Open-sans, sans-serif" color="#555454"> {if count($product['customization']) > 1} {$customization['customization_quantity']} {/if} </font> </td> <td width="5"> </td> </tr> </table> </td> <td style="border:1px solid #D6D4D4;"></td> </tr> {/foreach} {/if} {/foreach} Share this post Link to post 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