Jump to content

Problème SELECT relance panier type reOrder


Recommended Posts

Hello,

J'ai l'impression qu'il y a un bug dans les ralances panier :

pour la relance de type : reOrder
dans /modules/followup/followup.php ligne 275, on a :

SELECT o.id_order, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email
       FROM '._DB_PREFIX_.'orders o
       LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = o.id_customer)
       LEFT JOIN '._DB_PREFIX_.'cart c ON (c.id_cart = o.id_cart)
       WHERE o.valid = 1 AND c.date_add >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) AND o.id_order NOT IN 
       (SELECT id_order FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 2)



Seulement pour le SELECT dans la table log_mail, il n'y a pas de champ id_order.
Mais ce qui me fait douter c'est qu'il n'y a pas d'erreur MySql

ne serait-ce t'il pas plutôt :

SELECT o.id_order, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email
       FROM '._DB_PREFIX_.'orders o
       LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = o.id_customer)
       LEFT JOIN '._DB_PREFIX_.'cart c ON (c.id_cart = o.id_cart)
       WHERE o.valid = 1 AND c.date_add >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) AND o.id_cart NOT IN 
       (SELECT id_cart FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 2)

Link to comment
Share on other sites

  • 1 month later...

en effet,

en ce qui me concerne j'ai fait ceci et cela fonctionne maintenant :

        SELECT o.id_order, o.id_cart, o.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email
       FROM '._DB_PREFIX_.'orders o
       LEFT JOIN '._DB_PREFIX_.'customer cu ON (cu.id_customer = o.id_customer)
       WHERE  o.valid = 1 AND o.date_add >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) AND o.id_cart NOT IN 
       (SELECT id_cart FROM '._DB_PREFIX_.'log_email WHERE id_email_type = 2)');




j'avoue que je ne comprend toujours pas pourquoi utiliser la table "Cart" pour faire ce genre de requête et c'est pour cela que je ne n'utilise pas ici....

voir aussi ce post : http://www.prestashop.com/forums/viewthread/42460/developpement_et_modules/module_erreur_dans_modules_followup/

JMS

Link to comment
Share on other sites

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