| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
#1
|
|||||||||||
|
|||||||||||
![]() This is a modificiation I made today which adds a small checkbox at checkout time which says "this is a gift do not show price on invoice". This mod will give the admin an invoice for the recipient which has no prices on it and it uses the customer notes box as a "gift message" area while still allowing the customer to view an invoice with price information on it.
I did this mod on 4.1.7 Pro. Your table names may vary so please make sure you know your database structure before tinkering. I take no responsibility for either one of us being a jackass and messing your site up so backup all your html and database before using this mod. ![]() First we need to create a gift indicator field in database. This is the value of the check box a checkout. You can use MyPhpAdmin and enter the SQL below or go into your admin section->patch uprade area and enter this in the SQL query box Code:
Now we add the language for the word "gift" and the text the customer sees next to the check box. Just as the SQL above you can put this sql into mysql admin or into a mysql console or the patch sql box in the upgrade area of your admin console. Code:
Now we add the gift check box to checkout area for the customer to select before submitting their order. OPEN customer/main/checkout_notes.tpl FIND Quote:
CHANGE TO Quote:
Save and close customer/main/checkout_notes.tpl OPEN include/func/func.order.php FIND Quote:
ADD ABOVE IT Quote:
Now add in the new field to the SQL insert (write it to the database) FIND Quote:
CHANGE TO Quote:
SAVE and CLOSE include/func/func.order.php Now we add in a line which tells the invoice to show an invoice for a gift order that does not have prices listed but show one with prices to the customer when they order. OPEN skin1/mail/html/order_invoice.tpl FIND Quote:
REPLACE WITH Quote:
FIND Quote:
Quote:
Assign $_GET['mode'] to $mode so we can access it in the invoice template At this point you have a few choices... You can take the file below which is skin1/mail/html/order_data_gift.tpl and save it to your server and hope I got it right. Or you can create your own file for the gift invoice. skin1/mail/html/order_data_gift.tpl Quote:
I'd appreciate your feedback. I would appreicate it that if you use this mod and you create custom gift invoices that you please share them with this thread for the betterment of the x-cart community. the three attached photos are of #1 Checkbox at time of checkout #2 Invoice from cusomer perspective with prices #3 invoice from fulfillment staff/ admin with no prices By all means this is a quick hack for me. I am sure it can be done better and the order_data_gift.tpl above is by no means perfect. -Todd |
|||||||||||
#2
|
|||||||
|
|||||||
![]() Thanks for this very usefull mod, but do you think that it also will work for version 4.0.X or are there to many differences?
Thanks! ![]()
__________________
X-Cart 4.0.12 Heavy modified with paid, free and forum mods. PHP 5.2.5 | MYSQL 5.0.51a |
|||||||
#3
|
|||||||||
|
|||||||||
![]() I have added some screen caps of the different changes. I am not sure if it will work in 4.0 Jerrad but in all honesty the changes are really minor. I am sure someone better versed in x-cart can give it a look over and tell you for sure.
-Todd |
|||||||||
#4
|
|||||||
|
|||||||
![]() Thanks for the quick reply DreamCatcher.
The screen caps do look good and I surely will put this mod on my to-do-list... ![]()
__________________
X-Cart 4.0.12 Heavy modified with paid, free and forum mods. PHP 5.2.5 | MYSQL 5.0.51a |
|||||||
#5
|
|||||||||
|
|||||||||
![]() I just updated the code to use
{if $order.isgift eq '1' and $smarty.get.mode eq 'invoice'} instead of assigning the $_GET['mode'] to a variable. It removes the need to edit admin/order.php -Todd |
|||||||||
#6
|
|||||||
|
|||||||
![]() Hi Todd (alias DreamCatcher),
Thanks for sharing this great mod - I do appreciate!!!... it really was something important that has been missing from X-Cart until now. I just hope the customs guys are nice enough to let "gifts" through - think they should do. Cheers & thanks again, Asiaplay...
__________________
X-Cart Gold version 4.1.9 (plus built in X-Cart bugs!) |
|||||||
#7
|
|||||||||
|
|||||||||
![]() It's my pleasure Asiaplay, thank you for the support.
I have brought up a request for this mod in the past and had my fingers crossed that the folks at x-cart would have the forsight to add it into 4.1.7. I was shocked at how simple the actual modification was and I hope that they take my lead if they aren't wortking on it already and add it in to a subsequent release with some additional bells and whistles. X-cart staff you can use my code for some store credit toward add-ons, licenses etc ![]() |
|||||||||
#8
|
|||||||
|
|||||||
![]() Thanks for this great mod. Was easy to do and should be very useful! Not sure if you can help me with one thing though. In creating a modified invoice, I want to select from one of two messages at the botom on the invoice depending on whether it is being used as a gift or not. For some reason I'm not able to get this to work. Do you see any obvious flaw in the following
![]() I placed the following right after the closing {/if} from {if $order.customer_notes ne ""} in the order_invoice.tpl. Only the else sems to be is working. Just wondering if anyone could see what's wrong. {if $order.isgift eq '1'} <tr> <td align="center"><br /><br /><font style="FONT-SIZE:12px">{$lng.txt_thank_you_for_gift_purchase}< /font> {if $donation.name neq ''} <br /><font style="FONT-SIZE:12px">{include file="currency.tpl" value=$donation.amount assign="donation_amount"} {$lng.lbl_donated_to_gift|substitute:amount:$donat ion_amount:partner:$donation.name}</font>{/if} {* jas End *}</td> {else} <td align="center"><br /><br /><font style="FONT-SIZE:12px">{$lng.txt_thank_you_for_purchase}</font> {* DBB SD Start *}{if $donation.name neq ''} <br /><font style="FONT-SIZE:12px">{include file="currency.tpl" value=$donation.amount assign="donation_amount"} {$lng.lbl_donated_to|substitute:amount:$donation_a mount:partner:$donation.name}</font>{/if} {* DBB SD End *}</td> </tr> {/if}
__________________
4.710 |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|