Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Article HFN - Classer par marque et référence les produits dans le BL et la facture Prestashop -
class OrderInvoice extends OrderInvoiceCore {
public function getProductsDetail() {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT od.*, p.*, ps.*
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id
LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer`= p.`id_manufacturer`
WHERE od.`id_order` = '.(int)$this->id_order.'
AND od.`id_order_invoice` = '.(int)$this->id .'
ORDER BY, p.reference');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment