Jump to content

Utiliser module Alertes Email pour produits Hors Stock mais commandable


Recommended Posts

Bonjour, je désirerais pouvoir afficher "Prévenez-moi lorsque le produit est disponible" du module Alertes Email pour les produits qui sont hors stock mais disponibles à la commande sur ma boutique.

Dans mon cas présent l'alerte email ne s'affiche que si le produit est hors stock et qu'il est configuré sur "Refuser les commandes"

Est-ce normal et ai-je une solution de réaliser ce que je désire ?

Merci d'avance

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...
  • 2 months later...
  • 2 months later...

Alors je viens de trouver une astuce qui marche.


 


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 fonctionne chez moi en 1.6.


  • Like 1
Link to comment
Share on other sites

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