| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Printing 'Customer Notes' on invoices | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
Matthew, Hail Canada !! from a neighbor. Thanks, and I have since gone through all of the code searching for anything that calls func_place_order to make sure the extra argument had been added or was able to handle it if it didn't have any value. Even though we just use, in production, what I had way back originally posted, there are lots of other payment methods that needed to be touched.
If anyone needs the additional changes, please post here and I'll add those, although others have done most of them I think. Glad it helped. It's certainly made our lives easier. Jean
__________________
Linux / Apache 1.3.31 PHP 4.3.3 MySQL 4.0.18 X-Cart 3.5.4 in production Mar 08, 2004 X-Cart 3.5.4 Win2k SP4 for development |
|||||||
#22
|
|||||||||
|
|||||||||
Excellent info, PHPDev! Here's my variation but it was inspired by your excellent and detailed information.
The store owner wanted customers to indicate during checkout if this was their first order. I was pushing this into the Customer Notes field with Javascript, but this isn't convenient since those notes are encrypted as part of the payment info. I just wanted the info to be stored with the order, so I used order_extras. This is with x-cart 4. "First_Time" is the name of the form field the user is selecting from on the checkout form. Also, I'm using Javascript to validate to ensure the user is selecting something in this new menu. In include/func.php, add the new field (order_first) to function func_place_order: Code:
Also in include/func.php in the same function func_place_order, add the following: Code:
...just before: Code:
In payment/payment_cc.php, add the new field just below $order_details = "";, around line 78, to capture the user's input: Code:
In the same file, add the new field to $orderids = func_place_order around line 109 and again around line 140 so they look like the following, respectively: Code:
Code:
Now the field is stored with the order in the order_extras table. You should be able to pull this data as part of the order wherever you need it, such as on the invoice, for example: Code:
|
|||||||||
#23
|
|||||||
|
|||||||
wow thank you! I had another cart and they always posted notes on the receipt pages, it was easy to tell what the customer wanted us to do on special instrucitons or just "birthday thank you's" to friends and families when sending them gifts but with x-cart I always wondered why it was never included.
I will get on this right away!!!! btw, I use 4.05, hope it works. thanks! |
|||||||
#24
|
|||||||
|
|||||||
I am trying to make this same mod, but am a neophite when it comes to programing. Has anyone done this for version 4.0? I see that some 4.0 users have ammended the steps from the original post, but I am not getting anything to line up. I am searching for line that dont seem to exist.
__________________
Using 4.4.0 |
|||||||
#25
|
|||||||
|
|||||||
Hello,
If you want the customer note and cc details to be included in the email sent to the store admin, and NOT to the customer, you can do this: 1. Duplicate mail/html/order_invoice.tpl, call it order_invoice_admin.tpl. 2. Next, in the original file mail/html/order_invoice.tpl, delete these lines: Quote:
3. Next, edit mail/html/order_notification_admin.tpl. Change: Quote:
To: Quote:
If you use non-HTML email, simply do the same thing to mail/order_invoice.tpl and mail/order_notification_admin.tpl Remember to use encryption, since you are still sending cc info in email to the store admin. Alex P.S. My first post
__________________
X-Cart 4.0.13 PHP 4.3.10 |
|||||||
#26
|
|||||||||
|
|||||||||
Separate Customer Notes on Checkout
Great first post hfwd!
I did some more playing with my attempt to store information during the checkout process. I needed to simply separate the customer notes from the cc details. I wanted to get at them and use them independent of each other. So I tried roblen's simple suggestion and it really is easy. But a word of warning: it still includes the cc details and they are now stored in the database a second time and unencrypted. I don't need the cc details, just the customer notes. So here's what I came up with. 1. I used my previous instructions posted here for adding additional fields to the checkout, calling my new field Extra_Notes. 2. Changed skin1/customer/main/checkout_notes.tpl to capture the Customer Notes separate from the details. From: Code:
...to: Code:
3. Created a stripslashes smarty modifier so I can remove slashes directly from the template when extracting the Customer Notes. This was very simple. I created a new file in Smarty-X.X.X/plugins called modifier.sslash.php which contained the following: Code:
4. Added the notes viewable on the invoice in skin1/mail/html/order_invoice.tpl: Code:
5. Added the notes viewable on the order (order history) in skin1/main/history_order.tpl: Code:
6. If you don't want the admin to be able to edit the customer's notes, then add readonly to the textarea. But if you do want to allow changes to this field, add to admin/order.php in the status_change mode section before func_header_location is called: Code:
7. If you use AOM then you probably want to be able to see the customer notes there too. Add to skin1/modules/Advanced_Order_Management/preview.tpl: Code:
This was done with x-cart 4.0.12. I imagine it should work with 4.0.14 with little/no changes. The steps for payment_cc.php will probably need to be done with other payment methods you support. Is there a central place this could be done to cover all payment methods? If there's a better way to do any of this, please share. UPDATE: payment/payment_offline.php will need the same treatment as payment_cc.php if you accept payment methods other than cc. |
|||||||||
#27
|
|||||||
|
|||||||
anyone have this working on 4.0.14?
i want to try and tackle this mod, but a little confused on which set of instructions to follow. i only accept Credit Cards (through verisign) and just want the customer notes to print on the invoice.
__________________
4.2.2 |
|||||||
#28
|
|||||||
|
|||||||
Another question....X-cart have already modified my checkout sequence to include extra details but they only print out on the order email i.e. the values are not stored in any table. I was thinking of using the code that's been provided to store these fields in the orders_extra table but I notice that the fields I want to use look like this when I view HTML:
Code:
not sure how this affects the coding required or how I would add that field to func_place_order. I'm assuming that: Code:
isn't going to work? Dan
__________________
4.4.2 and 4.6.1 |
|||||||
#29
|
|||||||||
|
|||||||||
Quote:
I don't see why these instructions shouldn't work on .14. Do the most recently posted set of instructions seem applicable for what you are trying to accomplish? |
|||||||||
#30
|
|||||||||
|
|||||||||
Quote:
That might work: Code:
(Note the extra set of quotes) I'm never quite sure how to deal with those variables. They seem odd to me. Search for "posted_data" in /include to see how another similar variable is used. Hopefully someone who knows can help us out. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|