Jump to content

Špatný Výpočet "celkem Zaplatil Od Registrace:"


kiteboarder

Recommended Posts

Je to proste, jedna z klasickcyh chyb standardnich Prestashopu. Ve tride classes/Customer.php je funkce getStats ktera vypocet zajistuje, ovsem berou vsechny validni objednavky, bez ohledu na jejich stav. Dotaz je proto potreba omezit napr. pouze na objednavky odeslane ci dorucene, zkratka objednavky, ktere opravdu probehly. Napr. nejak takto:

 

AND (
           SELECT oh.`id_order_state`
          		 FROM `'._DB_PREFIX_.'orders` oo
          		 LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON oh.`id_order` = oo.`id_order`
          		 LEFT JOIN `'._DB_PREFIX_.'order_state` os ON os.`id_order_state` = oh.`id_order_state`
          		 WHERE oo.`id_order` = o.`id_order`
          		 ORDER BY oh.`date_add` DESC, oh.`id_order_history` DESC
          		 LIMIT 1


) IN (4,5)

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