Jump to content

How to Add Product Short Description into invoice pdf?


Recommended Posts

Tried

classes/order/OrderInvoice.php:
change:
        public function getProductsDetail()
        {
                return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
                SELECT *
                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)
                WHERE od.`id_order` = '.(int)$this->id_order.'
                AND od.`id_order_invoice` = '.(int)$this->id);
        }
 
to:
 
        public function getProductsDetail()
        {
                return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
                SELECT *
                FROM `'._DB_PREFIX_.'order_detail` od
                LEFT JOIN `'._DB_PREFIX_.'product` p
                ON p.id_product = od.product_id
                LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
                ON pl.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)
                WHERE od.`id_order` = '.(int)$this->id_order.'
                AND od.`id_order_invoice` = '.(int)$this->id);
        }

Didn't work 1.6.0.9

Link to comment
Share on other sites

 

I would rather create a static method and call it in the template. Something like:

public static function getProductDescription($id_lang, $id_product, $id_product_attribute = null) {
  ... SQL query ...
}

tuk66 thanks for the reply. And you can details?

I'm not very good at PHP

Link to comment
Share on other sites

×
×
  • Create New...