Jump to content

Mail Alerts module Bug, PS 1.7.8


Andrejkov

Recommended Posts

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

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. 

 

image.thumb.png.42345b028f2c4ea68c6a7baba2462fe3.png

  • Like 1
Link to comment
Share on other sites

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. 

 

image.thumb.png.42345b028f2c4ea68c6a7baba2462fe3.png

Hello,

This problem only occurs after entering the email address in the shopping cart

 

regards.

Link to comment
Share on other sites

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

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?

  • Thanks 1
Link to comment
Share on other sites

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 by ps8moduly.cz (see edit history)
  • Thanks 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...