Jump to content

use product attributes_small in PDF invoice


Recommended Posts

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

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

  • 2 months later...

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

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

  • 4 months later...

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 :)

  • Like 1
Link to comment
Share on other sites

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

×
×
  • Create New...