Jump to content

[Resolu] Bug dans le suivi des commandes


Recommended Posts

Bonjour à la communauté.

Je développe une petite boutique pour la vente de produits traditionnels en Roumanie, où je suis installé.

J'ai un soucis depuis la mise à jour de Prestashop (je suis en 1.3.1.1 hébergé chez OVH).

Lorsque je veux accéder au suivi des commandes, le site affiche :

tity_refunded` = `quantity_refunded` + '.intval($quantity).' WHERE `id_customization` = '.intval($id_customization).' AND `id_cart` = '.intval($this->id_cart).' AND `id_product` = '.intval($orderDetail->product_id)); if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customization` SET `quantity` = `quantity` - '.intval($quantity).' WHERE `id_customization` = '.intval($id_customization).' AND `id_cart` = '.intval($this->id_cart).' AND `id_product` = '.intval($orderDetail->product_id))) return false; if (!Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `quantity` = 0')) return false; return $this->_deleteProduct($orderDetail, intval($quantity)); } /** * Get order history * * @param integer $id_lang Language id * * @return array History entries ordered by date DESC */ public function getHistory($id_lang, $id_order_state = false, $no_hidden = false) { $id_lang = $id_lang ? intval($id_lang) : 'o.`id_lang`'; $query = ' SELECT oh.*, e.`firstname` AS employee_firstname, e.`lastname` AS employee_lastname, osl.`name` AS ostate_name FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON o.`id_order` = oh.`id_order` LEFT JOIN `'._DB_PREFIX_.'order_state` os ON os.`id_order_state` = oh.`id_order_state` LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = oh.`id_employee` WHERE oh.id_order = '.intval($this->id).' '.($no_hidden ? ' AND os.hidden = 0' : ''); if (intval($id_order_state)) $query.= ' AND oh.`id_order_state` = '.intval($id_order_state); $query.= ' ORDER BY oh.date_add DESC, oh.id_order_history DESC'; return Db::getInstance()->ExecuteS($query); } public function getProductsDetail() { return Db::getInstance()->ExecuteS(' SELECT * FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = '.intval($this->id)); } public function getLastMessage() { $sql = 'SELECT `message` FROM `'._DB_PREFIX_.'message` WHERE `id_order` = '.intval($this->id).' ORDER BY `id_message` desc'; $result = Db::getInstance()->getRow($sql); return $result['message']; } public function getFirstMessage() { $sql = 'SELECT `message` FROM `'._DB_PREFIX_.'message` WHERE `id_order` = '.intval($this->id).' ORDER BY `id_message` asc'; $result = Db::getInstance()->getRow($sql); return $result['message']; } /** * Get order products * * @return array Products with price, quantity (with taxe and without) */ public function getProducts($products = false, $selectedProducts = false, $selectedQty = false) { if (!$products) $products = $this->getProductsDetail(); $resultArray = array(); foreach ($products AS $k => $row) { // Change qty if selected if ($selectedQty) { $row['product_quantity'] = 0; foreach ($selectedProducts AS $key => $id_product) if ($row['id_order_detail'] == $id_product) $row['product_quantity'] = intval($selectedQty[$key]); if (!$row['product_quantity']) continue ; } $price = $row['product_price']; if ($this->_taxCalculationMethod == PS_TAX_EXC) $price = Tools::ps_round($price, 2); $row['product_price_wt'] = Tools::ps_round($price * (1 + ($row['tax_rate'] * 0.01)), 2); $row['total_wt'] = $row['product_quantity'] * $row['product_price_wt']; $row['total_price'] = $row['product_quantity'] * $row['product_price_wt']; /* Add information for virtual product */ if ($row['download_hash'] AND !empty($row['download_hash'])) $row['filename'] = ProductDownload::getFilenameFromIdProduct($row['product_id']); /* Stock product */ $resultArray[intval($row['id_order_detail'])] = $row; } return $resultArray; } /** * Count virtual products in order * * @return int number of virtual products */ public function getVirtualPr



En fait, c'est juste un aperçu du bug, car c'est bien plus long que ça :-/

Le bug s'affiche également quand je veux accéder au fichier lang depuis l'admin dans la rubrique "Traduction nom des champs".

Avez-vous une idée de ce qui se passe et comment je peux résoudre ce problème ?

Merci d'avance.

Christophe

Topic déplacé -yoya971

Link to comment
Share on other sites

Hello et bienvenue à toi Christophe.
Je dirais a vu de nez ue c'est ta class Order.php qui a un pete : essaye dans un premier temps de remplacer /classes/Order.php par une toute belle :) (tu télécharges la 1.3.1.1, tu decompresses en local chez toi et tu l'envoie par FTP en remplacement de celle sur ton serveur.)

A bientot,
Cdlt,
Pierre.

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