Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
is there a way to display the product description in the invoice without changing the database?
I have tried the following:
in: admin/model/sale/order.php
after :
Code: Select all
return $query->row['total'];
Code: Select all
public function getDescription($product_id) {
$query = $this->db->query("SELECT description FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
return $query->row;
}
after: (2nd instance)
Code: Select all
$option_data = array();
Code: Select all
$product['description'] = $this->model_sale_order->getDescription($product['product_id']);
after:
Code: Select all
$product_data[] = array(
Code: Select all
'description' => htmlspecialchars_decode($product['description']),
after:
Code: Select all
<td><b><?php echo $column_model; ?></b></td>
Code: Select all
<td><b>Description</b></td>
after:
Code: Select all
<td><?php echo $product['model']; ?></td>
Code: Select all
<td><b><?php echo $product['description'] ?></b></td>
after:
Code: Select all
colspan="4"
Code: Select all
colspan="5"
Warning: htmlspecialchars_decode() expects parameter 1 to be string, array given in C:\wamp\www\beadsforyou.co.za\vqmod\vqcache\vq2-admin_controller_sale_order.php on line 2647
does anyone know how to fix this one?
--
South Africa, Johannesburg GMT +2
Code: Select all
htmlspecialchars_decode(substr($product['description'],0,400)) . '...',
I ain't no programmer, but let me know if it works, because I need to put it now to the invoice.
--
South Africa, Johannesburg GMT +2
I got something working, please verify the program on your end, just note this is meant for the standard OC "Print Invoice" button under Sales > Orders, my OC version is 1.5.5.1
Attachments
--
South Africa, Johannesburg GMT +2
1. It is creating the column correctly with the title "Description"
2. No matter how many pieces I buy from the same product; 2,3 or 4, it will display as 2 separate items and only one line is displaying the description. the other one is empty.
3. The description didnt came out correct with me, it showed the first line of it and then 2 unrecognized characters , as the following:
On this example, I bought 3 pieces in one single order.
Tested OC 1.5.5.1 with the default print button.
I think there is still changes to be made, I will look into it later, but for now its a step into the right direction
--
South Africa, Johannesburg GMT +2
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Amazing job, works for 1.5.5.1 w shoppica 2.
One tiny problem though. It places description not in the same row where the product is, but in the row below. Please seevmy attachment. Any suggestions?
Thanks
Attachments
thanks
Users browsing this forum: Majestic-12 [Bot] and 322 guests