Post by daveleggy » Tue Jul 10, 2012 6:41 pm

Hi
Just wondered if anyone has this mod working or is it just me?
cheers
Dave :(

Newbie

Posts

Joined
Thu Mar 29, 2012 7:29 pm

Post by daveleggy » Wed Jul 11, 2012 3:19 pm

has anyone had this working using the changes straighlight suggested? I just want to know whether it is something i am doing wrong
cheers
Dave

Newbie

Posts

Joined
Thu Mar 29, 2012 7:29 pm

Post by straightlight » Sun Jul 15, 2012 4:53 am

It may be just you if the problem you would indicate may not be elaborated. ;)

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by markuswest » Thu Feb 27, 2014 3:39 pm

hi,

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'];
insert this:

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;
}
in: admin/controller/sale/order.php
after: (2nd instance)

Code: Select all

$option_data = array();
insert:

Code: Select all

$product['description'] = $this->model_sale_order->getDescription($product['product_id']);
&
after:

Code: Select all

$product_data[] = array(
insert:

Code: Select all

'description'             => htmlspecialchars_decode($product['description']),
in: admin/view/template/sale/order_invoice.tpl
after:

Code: Select all

<td><b><?php echo $column_model; ?></b></td>
insert:

Code: Select all

<td><b>Description</b></td>
&
after:

Code: Select all

<td><?php echo $product['model']; ?></td>
insert:

Code: Select all

<td><b><?php echo $product['description'] ?></b></td>
&
after:

Code: Select all

colspan="4"
insert:

Code: Select all

colspan="5"
but I get an error:
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


User avatar
New member

Posts

Joined
Wed May 29, 2013 4:22 am
Location - South Africa, Pretoria

Post by paradoxx » Thu Feb 27, 2014 5:05 pm

I think you are missing to put the snippet length? The way I have it, to display it in the cart, is like this:

Code: Select all

htmlspecialchars_decode(substr($product['description'],0,400)) . '...',
You can change the 400 to which ever number of characters to display. Please someone correct me if I'm wrong.

I ain't no programmer, but let me know if it works, because I need to put it now to the invoice.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by markuswest » Thu Feb 27, 2014 5:22 pm

Hi, nope the code returns an array into a string, I guess I have to select the correct order_id & product_id together, I am still figuring this one out

--
South Africa, Johannesburg GMT +2


User avatar
New member

Posts

Joined
Wed May 29, 2013 4:22 am
Location - South Africa, Pretoria

Post by markuswest » Thu Feb 27, 2014 9:08 pm

Hi,

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


User avatar
New member

Posts

Joined
Wed May 29, 2013 4:22 am
Location - South Africa, Pretoria

Post by paradoxx » Thu Feb 27, 2014 9:54 pm

ok, I can do that, im running the same version. I will be back with a result.
Last edited by paradoxx on Thu Feb 27, 2014 10:15 pm, edited 1 time in total.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by paradoxx » Thu Feb 27, 2014 10:15 pm

Ok, I did several tests.

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.
Image

Tested OC 1.5.5.1 with the default print button.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by markuswest » Thu Feb 27, 2014 10:43 pm

Hi,

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


User avatar
New member

Posts

Joined
Wed May 29, 2013 4:22 am
Location - South Africa, Pretoria

Post by paradoxx » Fri Feb 28, 2014 3:33 am

of course and its a good step.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by al404 » Thu Jun 19, 2014 4:55 am

looking for same thing but page one mod gives me same index error

New member

Posts

Joined
Fri May 04, 2012 4:29 pm

Post by straightlight » Thu Jun 19, 2014 7:49 am


The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Fri Jun 20, 2014 12:52 am

Link aboved edited. Now added VAT entry with both invoices. Also fixed minor bugs from yesterday's release.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by gristur » Thu Dec 11, 2014 11:02 am

HI Straightlight -
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

Newbie

Posts

Joined
Wed Feb 15, 2012 5:28 am

Post by gtoc » Sat Nov 14, 2015 2:46 pm

Hi, the xml above is working great. I would like to know if there is a way to show category description on the invoice based on the products? so if there is the 'canon' product is in the cart it will show camera category information on the invoice.

thanks

New member

Posts

Joined
Tue Apr 23, 2013 12:11 pm
Who is online

Users browsing this forum: No registered users and 36 guests