mltcorp Posted January 6, 2015 Share Posted January 6, 2015 Hi friends, Have a lot of posts because this problem with module mail alert (prestashop official), about as show only product out of stock: Insert this code in line 450 more or less: <!-- Out of stock hook --> {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} <div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}> </div> {$HOOK_PRODUCT_OOS} {/if} I use prestashop 1.6.0.9 Link to comment Share on other sites More sharing options...
vekia Posted January 11, 2015 Share Posted January 11, 2015 regarding to Rules specific to the "Free modules" forumThis forum is not about the functionalities that are included for free in PrestaShop, but about the modules that you might give away to the Community for free.All topics here should start with an answer, not a question.You can use (almost) all other sections of the forum to ask for help or anything you need related to PrestaShop, but here you're the one who gives us tips and good practices. Any module you may provide should be attached directly in your post Meaning: not with a link to an external website. The modules you are posting here are 100% free. Thus, you can share them just by attaching the ZIP file to the topic. Posts with an external link will be moderated and taken down. Please use your common sense to make this section pleasant for everyone (respect others, be benevolent). i moved this topic to proper forum section. with regards, Milos Link to comment Share on other sites More sharing options...
wer_ru Posted March 12, 2015 Share Posted March 12, 2015 mltcorp, your solution look good But It dosen't work on my site (1.6.13). If i Even I just write {$HOOK_PRODUCT_OOS} there is no any information then i allow out of stock products ordering. Hi friends, Have a lot of posts because this problem with module mail alert (prestashop official), about as show only product out of stock: Insert this code in line 450 more or less: <!-- Out of stock hook --> {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} <div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}> </div> {$HOOK_PRODUCT_OOS} {/if} I use prestashop 1.6.0.9 Link to comment Share on other sites More sharing options...
audiophonics Posted July 27, 2017 Share Posted July 27, 2017 The solution above do not display Mailalert when oosp is allowed In my case I would like to hide mail alert when oosp is refuse, and show it when it's allowed. I only added ! to line 465 in mailalerts.php module (before Product::isAvailableWhenOutOfStock ) public function hookActionProductOutOfStock($params) { if (!$this->customer_qty || !Configuration::get('PS_STOCK_MANAGEMENT') || !Product::isAvailableWhenOutOfStock($params['product']->out_of_stock)) return; Link to comment Share on other sites More sharing options...
beoutside Posted September 8, 2017 Share Posted September 8, 2017 @audiophonics I would like to allow the mail alert when oosp is allowed too but your solution doesn't display the message on the product page when I add the ! I have Prestashop 1.6.1.10 Is there something I'm missing ? Link to comment Share on other sites More sharing options...
Nicko500 Posted September 14, 2017 Share Posted September 14, 2017 (edited) I tested again and adding ! before the function Product::isAvailableWhenOutOfStock correctly reverse display. But now that I activated cache, I have a problem with variable $product->available_for_order in TPL It's only working one time after flush cache... then no more. So I added the condition into mailalert.php : || ($params['product']->available_for_order) == 0 It look like to work Edited September 14, 2017 by Nicko500 (see edit history) 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