DKM84 Posted April 26, 2011 Share Posted April 26, 2011 Hello,I've been looking into adding the product location to the invoice.I added an extra row to the ps_order_detail in the database called product_location.Then I changed: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); to: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name'] . ' (' . $product['product_location'] . ')'), 'B'); in classes/PDF.phpBut I can't seem to find out where the ps_order_detail is being created. How do I put the location in product_location when the order is added to the database.When I add a value to product_location manually with phpmyadmin it works fine and the location is visible on the invoiceThanx in advance! Link to comment Share on other sites More sharing options...
DKM84 Posted April 27, 2011 Author Share Posted April 27, 2011 I did try that. But the information on the invoice comes from 'ps_order_detail' and there is no 'location' in there so the output on that one is just an empty space. Link to comment Share on other sites More sharing options...
DKM84 Posted April 29, 2011 Author Share Posted April 29, 2011 Ok it works in classes/PDF.php if ($delivery) $this->SetX(25); if ($productQuantity) { // added following 2 lines $location1 = new Product((int)$product['product_id']); $location2 = $location1->location; $before = $this->GetY(); ...... original $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); changed to: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name'] . ' (' . $location2 . ')'), 'B'); I already changed the product reference to product id, so I couldn't use it for this.original $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); changed to: $this->Cell($w[++$i], $lineSize, ($product['product_id'] ? $product['product_id'] : '--'), 'B'); Had some trouble with the 'product_id' because the forum changes '' to ''Make sure to check the code when doing a copy and paste from the forum Thanks a lot! Link to comment Share on other sites More sharing options...
andrew Posted February 28, 2013 Share Posted February 28, 2013 (edited) Thank you so much. I have been trying to do this for a long time (and it's so easy when you know how) - Andrew Edited February 28, 2013 by andrew (see edit history) 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