WilliT Posted October 23 Share Posted October 23 (edited) Hi, I try to explain my needs: We use the ISBN field in products options for adding packing size information. So far, so good when the order was passed in Prestashop. But when we import orders from Amazon via the module of Common-Services, the value of ISBN in the order-detail table leaves blank, this information is obviously not imported or blocked. I already made changes to the delivery-slip.product-tap.tpl: {if empty($order_detail.product_isbn)} --- {else} {$order_detail.product_isbn} {/if} Like I said, this is perfect for Presatshop orders only. Right now, I have to acces directly the value of ISBN from the product table instead of the order-detail table but using {$product.isbn} does not work. Which code do I have to add and where do Ihave to add (I guess in HTMLTemplateDeliverySlip.php) in order to acces data directly from the products table? Thank you in advance. Willi Edited October 23 by WilliT (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted October 23 Share Posted October 23 Please can you specify PS, PHP and theme versions Link to comment Share on other sites More sharing options...
WilliT Posted October 23 Author Share Posted October 23 Prestashop 1.7.5 PHP 7.1 As far as I know, the PDF function does not depend of a theme, it is in classic theme Link to comment Share on other sites More sharing options...
Prestashop Addict Posted October 23 Share Posted October 23 il y a 38 minutes, WilliT a dit : As far as I know, the PDF function does not depend of a theme, it is in classic theme You can override pdf templates like any templates, by creating a pdf folder in your theme 😉 1 Link to comment Share on other sites More sharing options...
WilliT Posted October 23 Author Share Posted October 23 Yes but that is not the problem. I want to add a value to my existing delivery slip pdf. But I don't know yet how to access this value. See my original message. Thank you. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted October 23 Share Posted October 23 I confirm you have it in $order_detail.product_isbn (not display on orders slips before enter ISBN in product because info saved in order_detail). If you want to access of original add this in overridden template {assign var=pattribute value=Product::getAttributesParams($order_detail.product_id, $order_detail.product_attribute_id)} {$pattribute[0].isbn} {*contains actual ISBN*} Link to comment Share on other sites More sharing options...
WilliT Posted October 23 Author Share Posted October 23 Yes, thank you, I know that the ISBN ist stored in order_detail when an order is passed. But in my case ONLY when it it an order directly in Prestashop. But every order imported from Amazon does not have this entry in order_details. That is why I need to access the ISBN stored in the product table. I already use {if empty($order_detail.product_isbn)} --- {else} {$order_detail.product_isbn} {/if} to get the ISBN from the order_detail table. But I have to get the ISBN from products. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted October 24 Share Posted October 24 See my code above it works 😉 Link to comment Share on other sites More sharing options...
WilliT Posted October 24 Author Share Posted October 24 Your code gets the ISBN value from the table $order_detail. Right? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted October 24 Share Posted October 24 il y a 5 minutes, WilliT a dit : Your code gets the ISBN value from the table $order_detail. Right? No the ISBN value from product combination Link to comment Share on other sites More sharing options...
WilliT Posted October 24 Author Share Posted October 24 OK. But I don't have any ISBN in the table ps_product_attribute. All ISBN values are in the table ps_products. That is why I need to get the values from there. Where do you put this part in? Into HTMLTemplateDeliverySlip.php? Which line? : {assign var=pattribute value=Product::getAttributesParams($order_detail.product_id, $order_detail.product_attribute_id)} This part goes into delivery-slip.product-tab.tpl? {$pattribute[0].isbn} {*contains actual ISBN*} 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