ivo71 Posted January 19, 2020 Share Posted January 19, 2020 Hi, Can anybody help me with making changes to add the short product description to the delivery slip? I found in what tpl file to edit it (/pdf/delivery-slip.product-tab.tpl), but I don't know what name of variable to use between the { } or if the variable $product.short_description has to be defined in another file first? Thanks. Link to comment Share on other sites More sharing options...
tuk66 Posted January 21, 2020 Share Posted January 21, 2020 Yes, you need to add product data as well. See the getContent function in the /classes/pdf/HTMLTemplateDeliverySlip.php file. You can see template variables order, order_details, delivery_address and so on there. Link to comment Share on other sites More sharing options...
ivo71 Posted January 21, 2020 Author Share Posted January 21, 2020 Would you be able to write the exact coding line to retrieve the short description from the database please? Thanks. Link to comment Share on other sites More sharing options...
ventura Posted January 22, 2020 Share Posted January 22, 2020 Just add the new field in the getcontent function override foreach ($order_details as &$order_detail) { $productObj = new Product($order_detail['product_id'], false, Context::getContext()->language->id, Context::getContext()->shop->id); $order_detail['product_description'] = $productObj->description; } And then in the .tpl <p>{$order_detail.product_description}</p> 2 Link to comment Share on other sites More sharing options...
ivo71 Posted January 24, 2020 Author Share Posted January 24, 2020 Thanks, the coding works beautifully and even looks great in thedelivery slip, but it shows the full description, not the summary (short description). Can you please let me know what variables to change to get the short description (summary description field)? Many thanks for your help. Link to comment Share on other sites More sharing options...
ivo71 Posted January 25, 2020 Author Share Posted January 25, 2020 Got it sorted already, just added _short to description and product_description Thanks for all help. Link to comment Share on other sites More sharing options...
llouistherese Posted September 23, 2020 Share Posted September 23, 2020 Hello, I tried to do the manipulation on my prestashop store which is in version 1.7.6.7 but the description does not appear. Can you help me correct my problem? Link to comment Share on other sites More sharing options...
rbouchet Posted March 11, 2022 Share Posted March 11, 2022 Hello, I’m sorry to dig this up, but I’ll need some clarification on the code, I can’t get it to work on my end or should I put the "foreach" loop? Thank you for your help Link to comment Share on other sites More sharing options...
legacy12 Posted November 24, 2022 Share Posted November 24, 2022 Quick question I managed to add the short description on the delivery slip. We also want to sort the product using the data in the short description. This is done in /classes/order/OrderInvoice.php with the following code: 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 . ' ' . ($this->id && $this->number ? ' AND od.`id_order_invoice` = ' . (int) $this->id : '') . ' ORDER BY od.`product_reference`'); } The short description information is located in ps_product_lang database. Does someone know how to change the query above? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now