Jump to content

Help Modifing MailAlerts Module


Recommended Posts

Hello, I want to modify the original module prestashop (Mailalerts), to make it work also from the product-list, I think that would be a good usability improvement, there are some things that escape me, see if you can help out me and published module for all.

 

The first thing that I have no very clear is that if we call the hook, {$ HOOK_PRODUCT_OOS}, not loaded from pruct list. The quantity condition is true but does not load the Hook, I do not know if the {$ HOOK_PRODUCT_OOS} is unique to the product view.

 

<p id="oosHook"{if $product.quantity > 0} style="display: none;"{/if}>
                               {$HOOK_PRODUCT_OOS}
                               </p>

 

To go forward, instead of calling the hook, I copied the product.tpl code of the module of mailalerts, and it correctly displays the message "Notify me when available".

 

Finally I see mailalerts works with the $ id_product, so I assigned within the FOREACH of product-list to create the variable $ id_product

 

{assign var='id_product' value=$product.id_product}

 

This works but wrong, MailAlert assigned in the list of the latest product announcements without stock of the product list.

 

This is where I've been lost, since $ id_product is correct but the reason that happens the last $ id_product generated, how I can send the $ mailalerts-ajax_add.php id_product right?

 

Thank you!

Link to comment
Share on other sites

×
×
  • Create New...