X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Add Payment Address to Invoice (https://forum.x-cart.com/showthread.php?t=1604)

cloud9 02-23-2003 08:22 AM

Add Payment Address to Invoice
 
One thing that seems to be left out of the X Cart is when the user selects a type of payment that needs to be sent to your company via regular mail, like a Money Order, there doesn't seem to be any special attempt to inform the buyer of where to send the payment.

One easy way I found to deal with this is to add some code to the Invoice template to display the mailing address for the payment. The Invoice template seems to be displayed after the user completes a purchase and is also sent to them via email.

Here is an example of how this can be done for Mail Orders. Just add the following code to the very end of the mail/order_data.tpl, this winds up at the end of the invoice...


/mail/order_data.tpl


Code:

{if $order.payment_method eq "Money Order"}
Payment Address:
------------------------
    {$config.Company.company_name}
    {$config.Company.location_address}
    {$config.Company.location_city},
    {$config.Company.location_state}  {$config.Company.location_zipcode}

{/if}



You may need to play with the spaces and returns after pasting this in to get the layout you want.

Hope this is useful...

Parrot 02-26-2003 05:23 AM

WOW GREAT!!!

Okay, I found to keep the 2nd and 3rd type of mail-in payment type from adding lots of spacing before adding the info, you have to keep the code one line after the other (no spaces before or after the {/if}) before adding the second type.

Note: I found the Traveler's Check option caused a parse error (v 3.3.2). I corrected this by deleting the ' in the name of the payment method and in the code here.

THANKS SO MUCH FOR POSTING THIS! IT WORKS BEAUTIFULLY!

cloud9 02-26-2003 05:38 AM

Yes, you can repeat the code with a different string, although the best way would be to have multiple conditions in the one If statement...

I'm not sure at the moment if the OR part is "or" or "||" but assuming the latter, it might be something like...

if $method eq "type1" || $method eq "type2" || $method eq "type3"

Parrot 02-26-2003 05:40 AM

Ops... sorry... I deleted that part of my post since I figured out the answer right while you were posting.
:wink:

I just repeated the code.

okdpminc 03-01-2003 08:25 PM

Ok, so is the if $method eq "type1" || $method eq "type2" || $method eq "type3" correct, or should the || be OR? :)

Thanks for the snippit, cloud9!

toonarific 07-08-2003 07:29 AM

Where are the templates to alter the tag names for the payment methods?

Is there a snippet of code that can placed at the bottom of the onscreen invoice, depending on if it is a certain payment method type is selected, that will generate a print button to print out the invoice so it can be mailed in with the payment?

shan 07-08-2003 07:58 AM

did this ever get added to the 3.4.3 version or earlier.

If not it should be

toonarific 07-08-2003 08:00 AM

well, Im glad Im coming up with good ideas that needed to be added into the code. I just wish someone did something like this sooner so it would be ready for me :)

shan 07-08-2003 08:04 AM

so thats a no then ? are you using V3.4.3

if you are and the codes not there contact xcart and ask them to add that snippet to the next release if you would :wink:

cloud9 07-22-2003 08:50 PM

glad to help... :)


All times are GMT -8. The time now is 07:41 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.