leeego Posted July 29, 2013 Share Posted July 29, 2013 i'd like to integrate the short version of the product options (attributes_small) inside the PDF invoice. i can see that Cart.php is building them within the function cacheSomeAttributesLists but don't know how i can make use of it within PdfInvoiceController.php. any help? Link to comment Share on other sites More sharing options...
tuk66 Posted July 30, 2013 Share Posted July 30, 2013 What exactly do you mean with: the short version of the product options (attributes_small) ? Link to comment Share on other sites More sharing options...
leeego Posted July 30, 2013 Author Share Posted July 30, 2013 right now it is (e.g.): iPod Nano - Color: Blue, Size: 16GB should be: iPod Nano - Blue, 16GB attributes_small within Cart.php does just that (except including the product name) but i don't know how i can include it inside the PDF invoice. Link to comment Share on other sites More sharing options...
tuk66 Posted July 30, 2013 Share Posted July 30, 2013 I think it is not possible. You have product_name field in theorder_detail table and the product with options is saved like "iPod Nano - Color: Blue, Size: 16GB" here. Link to comment Share on other sites More sharing options...
leeego Posted July 30, 2013 Author Share Posted July 30, 2013 why should it not be possible (if it's possible to have it in the cart)? is it not possible to get that info out of the DB no matter where you need it? Link to comment Share on other sites More sharing options...
tuk66 Posted July 30, 2013 Share Posted July 30, 2013 OK. It would be possible if you will have product attributes available in the invoice. I don't think it is the case. Link to comment Share on other sites More sharing options...
leeego Posted October 30, 2013 Author Share Posted October 30, 2013 OK. It would be possible if you will have product attributes available in the invoice. I don't think it is the case. But the product attributes are already available in the invoice. Just not in the format I'd like to have them :-/ Link to comment Share on other sites More sharing options...
leeego Posted October 30, 2013 Author Share Posted October 30, 2013 To clarify: All I need is the short notation of the product attributes, just like you can have them in the cart (by using $product.attributes_small). The standard in the PDF looks like this: iPod Nano – color: red, size: 16GB What I'd like to have is: iPod Nano – red, 16GB Link to comment Share on other sites More sharing options...
oracle178 Posted March 17, 2014 Share Posted March 17, 2014 Hi, I use Prestashop 1.5.4.1 version and in .../classes/order/OrderDetail.php line 560 change attributes to attributes_small, looks like $this->product_name = $product['name']. ((isset($product['attributes']) && $product['attributes'] != null) ? ' - '.$product['attributes_small'] : ''); and in PDF looks like this: iPod Nano – red, 16GB sorry for my english, hopefully understand what I wrote 1 Link to comment Share on other sites More sharing options...
leeego Posted March 17, 2014 Author Share Posted March 17, 2014 Hmm, that doesn't seem to work on my side. I still get the full attributes in the invoice PDF. I use 1.5.6.0, but the code in OrderDetail.php still looks the same. Link to comment Share on other sites More sharing options...
tuk66 Posted March 18, 2014 Share Posted March 18, 2014 Look at product_name field in the ps_order_detail table. This value is printed in the PDF invoice. 1 Link to comment Share on other sites More sharing options...
leeego Posted March 19, 2014 Author Share Posted March 19, 2014 Ah I got it. You have to make the changes in OrderDetail.php as oracle178 proposed, and then it will work for every new order made from then on. It won't change anything for orders that have already been made. Link to comment Share on other sites More sharing options...
Recommended Posts