Jump to content

Problèmes D'affichage Avec Le Module Mailalert


Recommended Posts

Bonjour,

 

J'utilise prestashop 1.5.4 et j'aimerais mettre en place le module mailalert afin de prévenir mes clientes lorsqu'un produit est de nouveau en stock.

 

Mon problème vient du fait que j'utilise des déclinaisons. Par exemple, sur une fiche produit, je peux avoir 15 déclinaisons dont 13 en stock (et donc, deux en rupture).

 

J'aimerais que le champ mail + "prévenez moi lorsque le produit sera en stock" ne s'affiche que pour les variations en rupture mais, j'ai beau essayer avec des if + else, des if tout court ou autre, soit cela s'affiche pour toutes les variations, soit cela ne s'affiche pas !

 

Pouvez-vous m'aider ?

 

Merci d'avance =)

 

p.s. : si cela peut aider, voici ce que j'ai dans mes fichiers (il s'agit des fichiers de base, sans mes modifs puisqu'elles ne fonctionnent pas)

 

base>modules>mailarlerts>views>templates>hook>product.tpl

<!-- MODULE MailAlerts -->
    {if isset($email) AND $email}
        <input type="text" id="oos_customer_email" name="customer_email" size="20" value="{l s='[email protected]' mod='mailalerts'}" class="mailalerts_oos_email" onclick="clearText();" /><br />
    {/if}
    <a href="#" title="{l s='Notify me when available' mod='mailalerts'}" onclick="return addNotification();" id="mailalert_link" rel="nofollow">{l s='Notify me when available' mod='mailalerts'}</a>
    <span id="oos_customer_email_result" style="display:none;"></span>
<!-- END : MODULE MailAlerts -->

et theme>xxxx>product.tpl

 <div class="ratings">
                                <p class="rating-links" id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
                                    {$HOOK_PRODUCT_OOS}
                                </p>
                            </div> 

(qui, pour être précis, vient de :)

                        {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
                        <!-- add to cart form-->
                        <form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post">
                            <!-- hidden datas -->
                            <p class="hidden">
                                <input type="hidden" name="token" value="{$static_token}" />
                                <input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
                                <input type="hidden" name="add" value="1" />
                                <input type="hidden" name="id_product_attribute" id="idCombination" value="" />
                            </p>
                            <div class="ratings">
                                <p class="rating-links" id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
                                    {$HOOK_PRODUCT_OOS}
                                </p>
                            </div>  
                            <div class="product_attributes">
                                <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}>
                                    <label for="product_reference">{l s='Reference:'} </label>
                                    <span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span>
                                </p>
                                <!-- minimal quantity wanted -->
                                <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
                                    {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'}
                                </p>
                                {if $product->minimal_quantity > 1}
                                    <script type="text/javascript">
                                            checkMinimalQuantity();
                                    </script>
                                {/if}
Link to comment
Share on other sites

  • 5 months later...

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...