Vali Iacobescu Posted July 13, 2016 Share Posted July 13, 2016 Hi, Can someone, please, explain step by step, how to add a product reference number in the out of stock e-mail notification template, because I have products with the same name and I would prefer to see the product reference number, in order to identify the product easier. Thanks! Link to comment Share on other sites More sharing options...
rocky Posted July 14, 2016 Share Posted July 14, 2016 Find the following code at around line 518 of modules/mailalerts/mailalerts.php: $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang); $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name ); Then change it to: $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang); $product = new Product($id_product); $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name, '{reference}' => $product->reference ); You should then be able to use {reference} inside modules/mailalerts/mails/<lang_iso>/productoutofstock.html and productoutofstock.txt. 4 2 Link to comment Share on other sites More sharing options...
Vali Iacobescu Posted July 14, 2016 Author Share Posted July 14, 2016 Thank you very much Rocky, it works! 1 Link to comment Share on other sites More sharing options...
coMegaWebMaster Posted March 13, 2018 Share Posted March 13, 2018 How to get the reference of the combination products? The combination names are correct in the email, but the reference is from the main product, I try somethings with $id_product_attribute->reference but it does not work or the return is 0. Hope someone or rocky can help With kind regrads, Alexander. Link to comment Share on other sites More sharing options...
Miss-Yvonne Posted May 19, 2019 Share Posted May 19, 2019 Looking for the same solution (Adding product reference number) for presta 1.7.5.2 Yvonne Link to comment Share on other sites More sharing options...
rtony30 Posted July 7, 2020 Share Posted July 7, 2020 Hello how to display the references of the product variations? Thank you Link to comment Share on other sites More sharing options...
madpugger Posted February 22, 2021 Share Posted February 22, 2021 This solution does not appear to work for 1.7.7. Can anyone help? Link to comment Share on other sites More sharing options...
Federico Masiero Posted March 26, 2021 Share Posted March 26, 2021 In Prestashop 1.7.7 you need to navigate into modules/ps_emailalerts/ps_emailalerts.php Find the following code, around line 573: $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name, ); Then change it to: $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name, '{reference}' => $product->reference ); Now, you should be able to use {reference} in your "product out of stock" e-mail templates. 1 1 Link to comment Share on other sites More sharing options...
madpugger Posted April 2, 2021 Share Posted April 2, 2021 Thanks for this, I'll give it a go. The issue I have, is I don't even have a product name in the email. I wonder if this is to do with only having ENGB on site, as I see the email template for the EN(US) is completely different... There is also an error in the GB template for customer emails too {first name} is spelt wrong - but that's another issue! Link to comment Share on other sites More sharing options...
madpugger Posted April 2, 2021 Share Posted April 2, 2021 On 3/26/2021 at 11:43 AM, Federico Masiero said: In Prestashop 1.7.7 you need to navigate into modules/ps_emailalerts/ps_emailalerts.php Find the following code, around line 573: $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name, ); Then change it to: $template_vars = array( '{qty}' => $quantity, '{last_qty}' => $ma_last_qties, '{product}' => $product_name, '{reference}' => $product->reference ); Now, you should be able to use {reference} in your "product out of stock" e-mail templates. OK thanks, I have now at least managed to get a product name into the email (it's not there in the the Classic / GB template). But {reference} is not working? Link to comment Share on other sites More sharing options...
jimmiler Posted April 9, 2021 Share Posted April 9, 2021 (edited) Thanks for this solution. Its for me and my b2b project. I also use https://belkins.io/appointment-setting for B2B appointment setting. Edited April 12, 2021 by jimmiler (see edit history) Link to comment Share on other sites More sharing options...
dandumit Posted June 10, 2021 Share Posted June 10, 2021 I need to send in out of stock email what products are missing or if those have higher delivery terms. Any ideea how to implement this ? Thank you, Daniel Link to comment Share on other sites More sharing options...
mariana790 Posted September 17, 2021 Share Posted September 17, 2021 Good solution. I also sometimes use https://pdfliner.com/features to work with PDF files Link to comment Share on other sites More sharing options...
pShark Posted March 24, 2022 Share Posted March 24, 2022 (edited) On 3/13/2018 at 6:38 PM, coMegaWebMaster said: How to get the reference of the combination products? The combination names are correct in the email, but the reference is from the main product, I try somethings with $id_product_attribute->reference but it does not work or the return is 0. Hope someone or rocky can help With kind regrads, Alexander. I managed to get the product reference as you indicated, but I need the reference of the combination (prestashop 1.7.6.9). Any solution? Thx!! Edited March 24, 2022 by pShark (see edit history) Link to comment Share on other sites More sharing options...
pShark Posted April 4, 2022 Share Posted April 4, 2022 On 3/24/2022 at 8:43 AM, pShark said: I managed to get the product reference as you indicated, but I need the reference of the combination (prestashop 1.7.6.9). Any solution? Thx!! Doesn't anyone know a solution? It would be useful to add the EAN of the combination. 1 Link to comment Share on other sites More sharing options...
Mediacom87 Posted December 11, 2023 Share Posted December 11, 2023 il y a 11 minutes, Teone a dit : Ciao, sto cercando di inserire nella mail anche il link del prodotto, ma non riesco a recuperare il dato... puoi aiutarmi? Ciao, la tua richiesta non ha nulla a che fare con l'argomento iniziale di questo topic, ti preghiamo di creare una richiesta propria Link to comment Share on other sites More sharing options...
Mediacom87 Posted December 11, 2023 Share Posted December 11, 2023 il y a 12 minutes, Teone a dit : come non ha nulla a che fare? io sto usando questo codice per recuperare i dati nella mail alert dei prodotti esauriti, grazie a questo script ho recuoperato il codice di riferimento, ma non riesco a recuperare l'url del prodotto "esaurito"! Ho usato '{link}' => $url, ma non va! Aprite un topic tutto vostro invece di postare su un argomento che non ha nulla a che fare con la vostra richiesta. 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