Andrejkov Posted June 20, 2023 Share Posted June 20, 2023 Hello, We have problem with product avaibility notofication in Mail Alerts module. When we are Guest and we add e-mail address on checkout page, next we back to the product and click "Notify me when available", we got error "Your email address is invalid". https://www.youtube.com/watch?v=F_DB8SS6KII But when we are logged in or we dont add e-mail address in checkout all work perfect. Any idea how to fix it? Regards Link to comment Share on other sites More sharing options...
s4lvozesta Posted June 26, 2023 Share Posted June 26, 2023 Hi, I watch your video, check the website and find it quite different. Screenshot attached. I think it says email invalid because email field is not filled. But, somehow, your video does not show the email field. Yes, I see that you simulate ordering as guest. What I tried was different, I go access homepage, go directly into a product, and email field appear. I guess there is a logic to 'hide' email field when it is guest or customer, which might be in js. I am afraid only possible to check by accessing the shop's code. 1 Link to comment Share on other sites More sharing options...
Andrejkov Posted June 27, 2023 Author Share Posted June 27, 2023 17 hours ago, s4lvozesta said: Hi, I watch your video, check the website and find it quite different. Screenshot attached. I think it says email invalid because email field is not filled. But, somehow, your video does not show the email field. Yes, I see that you simulate ordering as guest. What I tried was different, I go access homepage, go directly into a product, and email field appear. I guess there is a logic to 'hide' email field when it is guest or customer, which might be in js. I am afraid only possible to check by accessing the shop's code. Hello, This problem only occurs after entering the email address in the shopping cart regards. Link to comment Share on other sites More sharing options...
ps8modules Posted June 28, 2023 Share Posted June 28, 2023 Hi. I agree @s4lvozestathat you need to see the tpl templates if there are correct hooks to display the email field. In this case, the Mail alert module has no restrictions for logged in or for guests. Link to comment Share on other sites More sharing options...
Andrejkov Posted June 29, 2023 Author Share Posted June 29, 2023 On 6/28/2023 at 3:43 AM, ps8moduly.cz said: Hi. I agree @s4lvozestathat you need to see the tpl templates if there are correct hooks to display the email field. In this case, the Mail alert module has no restrictions for logged in or for guests. Hello, In product-additional-info.tpl i have only <div class="product-additional-info"> {hook h='displayProductAdditionalInfo' product=$product} </div> In ps_emailalerts/views/templates/hook/product.tpl i have: <div class="tabs"> <div class="js-mailalert text-center" data-url="{url entity='module' name='ps_emailalerts' controller='actions' params=['process' => 'add']}"> {if empty($has_notification)} {if !empty($email)} <input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}"/> {/if} {if !empty($id_module)} {capture name='gdprContent'}{hook h='displayGDPRConsent' id_module=$id_module}{/capture} {if $smarty.capture.gdprContent != ''} <div class="gdpr_consent_wrapper mt-1">{$smarty.capture.gdprContent nofilter}</div> {/if} {/if} <button data-product="{$product.id_product}" data-product-attribute="{$product.id_product_attribute}" class="btn btn-primary js-mailalert-add mt-1" rel="nofollow"> {l s='Notify me when available' d='Modules.Emailalerts.Shop'} </button> <div class="js-mailalert-alerts"></div> {else} <article class="mt-1 alert alert-info" role="alert">{l s='You will be notified when this product is available.' d='Modules.Emailalerts.Shop'}</article> {/if} </div> </div> Link to comment Share on other sites More sharing options...
ps8modules Posted June 29, 2023 Share Posted June 29, 2023 Hi, this condition {if !empty($email)} prohibits display if the email is not known. Link to comment Share on other sites More sharing options...
s4lvozesta Posted June 30, 2023 Share Posted June 30, 2023 On 6/27/2023 at 1:07 PM, Andrejkov said: This problem only occurs after entering the email address in the shopping cart When this has happened, check if : 10 hours ago, Andrejkov said: {if !empty($email)} this condition is true or false. You should be good after that. Anyway, do you have cache active? 1 Link to comment Share on other sites More sharing options...
ps8modules Posted June 30, 2023 Share Posted June 30, 2023 (edited) this: {if !empty($email)} <input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}"/> {/if} change to: <input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}" value="{if !empty($email)}{$customer.email}{/if}"/> Edited June 30, 2023 by ps8moduly.cz (see edit history) 1 Link to comment Share on other sites More sharing options...
Andrejkov Posted June 30, 2023 Author Share Posted June 30, 2023 5 hours ago, ps8moduly.cz said: this: {if !empty($email)} <input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}"/> {/if} change to: <input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}" value="{if !empty($email)}{$customer.email}{/if}"/> It works, thank you! Regards 1 Link to comment Share on other sites More sharing options...
ps8modules Posted June 30, 2023 Share Posted June 30, 2023 I gladly helped 😉 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