Post by ncc50446@hotmail.com » Fri Mar 19, 2010 4:02 am

Hey,
What I need to do is to input the location of the item into invoice. Not for the customer to see, but for the admins. But I can't seem to figure out where I would add that in. I'm sure I can figure out how to display it on the invoice for admins, but I can't seem to figure out how to input it into the database.
Thanks for any help :)


Posts

Joined
Sat Mar 13, 2010 10:23 am

Post by ncc50446@hotmail.com » Sun Mar 21, 2010 9:03 am

Anyone have any idea's? I want to add the item location to the order_product table, but I can't seem to figure out where to add the code. I don't want it to be shown to the customer, just added to the database so the admins can see it.
Thank you for any help.


Posts

Joined
Sat Mar 13, 2010 10:23 am

Post by i2Paq » Sun Mar 21, 2010 6:01 pm

The invoice is for the customer so I think you cannot hide it in any way.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by ncc50446@hotmail.com » Mon Mar 22, 2010 6:07 am

I just need it in the database. I just wont call it, and then it wont show. But I'm not sure how to get it into the order_product table. Just need a small hint as to which files I need to edit.
I assume I need to edit
catalog/controller/checkout/confirm.php
and
catalog/model/checkout/order.php
But I'm not sure.

Thanks for any further help :)


Posts

Joined
Sat Mar 13, 2010 10:23 am

Post by ncc50446@hotmail.com » Tue Mar 23, 2010 6:36 am

Can a mod please move this to the 'Development' forum. Maybe this is just the wrong forum and would do better there.
Thank you, I really need to figure this out :)


Posts

Joined
Sat Mar 13, 2010 10:23 am

Post by Qphoria » Tue Mar 23, 2010 6:58 am

This is not something for the development forum. This is more like a mod

Are you saying that you want to show the value of the products Location field in the admin panel when looking at the order? This is very easily done.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ncc50446@hotmail.com » Tue Mar 23, 2010 3:41 pm

Yes, thats what I'm looking at doing :) So I want to input it into the order_product table, but I can't seem to figure out which files to edit...I'm a little lost lol I thought would just be two files, but I seem to be missing something somewhere...So hoping someone could at least point me in the right direction :)
And sorry, I was just hoping to get it placed in the right forum (Unless it already is lol) :)


Posts

Joined
Sat Mar 13, 2010 10:23 am

Post by Qphoria » Thu Mar 25, 2010 9:20 am

This should work on 1.4.0 and 1.4.4 and maybe 1.3.4

1. EDIT: admin/controller/sale/order.php

2. FIND MULTIPLE TIMES:

Code: Select all

'model'    => $product['model'],
3. AFTER EACH, ADD:

Code: Select all

'location' => $product['location'],
5. FIND MULTIPLE TIMES:

Code: Select all

$option_data = array();
6. BEFORE EACH, ADD:

Code: Select all

$query = $this->db->query("SELECT location FROM " . DB_PREFIX . "product WHERE product_id = '" . $product['product_id'] . "'");
$product['location'] = $query->row['location'];

7. EDIT THE FOLLOWING FILES:
- admin/view/template/sale/order_view.tpl (or order_form.tpl if older than v1.4.4)
- admin/view/template/sale/order_invoice.tpl
- admin/view/template/sale/order_invoices.tpl

8. IN EACH FILE, FIND:

Code: Select all

<?php echo $product['model']; ?>
9. IN EACH FILE, REPLACE WITH:

Code: Select all

<?php echo $product['model']; ?> (<?php echo $product['location']; ?>)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ncc50446@hotmail.com » Fri Mar 26, 2010 2:31 am

Awesome! Thank you very much! I will add it tonight :)
Taking a look, I see what you did...You didn't add it to the database, just pulled it from the database. Guess that would make it easier wouldn't it?
Sadly however, nothing is ever easy...I need it to go to the database...
But...You did give me an idea. I just move that code from the admin, to the /catalog/controller/checkout/confirm.php. I select the info from the products table, and input it into the order_product table.
I'll try it out tonight and get back to you on how it went.
Thanks again Qphoria! :)


Posts

Joined
Sat Mar 13, 2010 10:23 am
Who is online

Users browsing this forum: No registered users and 77 guests