Post by derwydd » Tue Sep 25, 2007 5:50 am

It is just one field that needs to be added to an order. How would I add PO# field to an order...?

thx jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Tue Sep 25, 2007 10:49 pm

HOW CAN I ADD A PO# FIELD TO THE CHECKOUT

THANKS
JASON

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by d77 » Tue Sep 25, 2007 11:00 pm

this sounds like a new payment type, correct?

if so, you will need a payment mod that stores that value in a new db field, or maybe in the comments of the order.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by derwydd » Tue Sep 25, 2007 11:08 pm

How hard would it be to add another field just like comments but for po#?

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by d77 » Tue Sep 25, 2007 11:17 pm

opencart is structured so things like payment and shipping "modules" can be added on without requiring modification to the core opencart code. if this is simply a new payment type, it could be added as a module... the steps for doing this aren't documented yet, but there may be some people in the forum willing to help out in that area.

if you are wanting to modify the standard order fields to add something above comments, you will have to do a mod of the core opencart code to fit this in. you will need a new column in the database and then you will need to modify the code to use it. if you are going to dive in, i would recommend following the pattern that is used for the comments field... might not be too bad.

another idea... could you get away with simply changing the title on the comments field to something like "Comments / PO Number", and instruct your users to put the PO # in there? that would be a simple language file change.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by derwydd » Tue Sep 25, 2007 11:30 pm

Well if I have to change the Shipping like in the other post. UPS RED GRD ORG , etc... Then I will add another field for both. This is not another shipping method. I just want to modify the files.

Thanks
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Tue Sep 25, 2007 11:31 pm

Which files would I have to modifiy?

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by d77 » Tue Sep 25, 2007 11:37 pm

this discussion is about a PO#... my understanding of a purchase order is that a customer would provide a PO instead of direct payment, and you would use that to invoice their company at a later date (something like that). to me, that seems like a payment module, since opencart is going to bring them to a payment page as part of the order process.

for example, when they reach the "payment" step, they might see the following options:

- PayPal
- COD
- Purchase Order #

choosing purchase order # would require them to enter the number. does this make sense?

i don't have an answer for which files to modify as i haven't looked at this myself. if you are familiar with php, you should try to get familiar with the opencart's structure and use the existing fields and modules as examples. if not, someone else may be able to contribute some advice or be willing to write the mod for you.

in the future, there should be some documentation available that lays out the general process for creating things like payment and shipping modules.
Last edited by d77 on Tue Sep 25, 2007 11:41 pm, edited 1 time in total.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by derwydd » Tue Sep 25, 2007 11:46 pm

Ok I am using the COD extension, and changed the Language file to say Purchase Order Payment. I guess I need to edit this COD extension to do what I need?

Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Wed Sep 26, 2007 12:06 am

Ok I thought checkout_payment.php in catalog/controller

But it did not work! I think it is this file along with others


Thanks
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Wed Sep 26, 2007 12:14 am

Ok I edited the catalog/Controller/checkout_payment.php and the language file for checkout_payment.php. I added the same lines as the comments, but it just does not show up.

Controller below:

    $view->set('comment', $session->get('comment'));
        $view->set('PO', $session->get('PO'));


language below:
$_['text_comments']        = 'Add Comments About Your Order';
$_['PO_comments']        = 'Add PO#';

What am I doing wrong...

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Wed Sep 26, 2007 1:56 am

Ok I got it all the way to

/index.php?controller=checkout_confirm

but I can not figure out how to get it to email to email it off.
Variable is PO...

If I get this done the other is easy

Thanks
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Wed Sep 26, 2007 5:17 am

OK I DID IT BUT IT IS NASTY. I BASICALLY PUSHES PO# AND SHIPVIA VARIABLES ALL THE WAY TO EMAIL. AND THEN BINDING IT TO COMMENTS AREA. NASTY. BUT WORKS. CAN'T REALLY DO UPDATES EASY NOW.

THANKS
JASON

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by d77 » Wed Sep 26, 2007 5:57 am

COOL. GLAD TO HEAR YOU WORKED SOMETHING OUT.

User avatar
d77
Active Member

Posts

Joined
Sat Apr 14, 2007 8:04 am

Post by derwydd » Wed Sep 26, 2007 6:03 am

I could not do it without you all

Thanks
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am
Who is online

Users browsing this forum: No registered users and 5 guests