jomcdonald Posted June 16, 2014 Share Posted June 16, 2014 Bonjour, Voila mon problème, j'autorise la commande de produits hors stock mais je souhaite que le client puisse rentrer son adresse email dans la fiche produit pour être prévenu du réapprovisionnement du produit. Hors cela n'est pas possible sur la version 1.6 de prestashop. Le hook $HOOK_PRODUCT_OOS n'est pas appelé si la fonction "Autoriser la commande de produits en rupture de stock" est activée. J'ai retourné tous les fichiers du module mailalert sans pouvoir trouver ce qui bloque. Avez vous une solution? Merci Link to comment Share on other sites More sharing options...
Virk Posted June 29, 2015 Share Posted June 29, 2015 Pareil Link to comment Share on other sites More sharing options...
jomcdonald Posted June 29, 2015 Author Share Posted June 29, 2015 Alors j'avais abandonné mais votre message m'a fait rechercher à nouveau une solution et je viens de trouver une astuce qui semble marcher. A tester chez vous: Fichier mailalerts.php qui se trouve dans le module mailalerts -> ligne 451 Enlever || Product::isAvailableWhenOutOfStock($params['product']->out_of_stock) ce qui donne au final public function hookActionProductOutOfStock($params) { if (!$this->customer_qty || !Configuration::get('PS_STOCK_MANAGEMENT')) return; $context = Context::getContext(); $id_product = (int)$params['product']->id; $id_product_attribute = 0; $id_customer = (int)$context->customer->id; if ((int)$context->customer->id <= 0) $this->context->smarty->assign('email', 1); elseif (MailAlert::customerHasNotification($id_customer, $id_product, $id_product_attribute, (int)$context->shop->id)) return; $this->context->smarty->assign( array( 'id_product' => $id_product, 'id_product_attribute' => $id_product_attribute ) ); return $this->display(__FILE__, 'product.tpl'); } Ça semble fonctionner chez moi mais je teste encore. Link to comment Share on other sites More sharing options...
jomcdonald Posted June 29, 2015 Author Share Posted June 29, 2015 Après un test poussé, tout fonctionne donc c'est la bonne solution. Link to comment Share on other sites More sharing options...
beoutside Posted September 11, 2017 Share Posted September 11, 2017 (edited) Bonjour, J'ai le même problème et j'ai aussi vu la solution de mettre le point d'exclamation devant cette ligne mais les deux solutions ne marchent pas pour moi ! J'ai PS 1.6.1.10 et lorsque je fais ces manipulations, même en réinitialisant et compagnie, ça ne fonctionne pas. J'ai manqué quelque chose à faire ?? Edited September 11, 2017 by beoutside (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