X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Different confirmation message for different payment methods (https://forum.x-cart.com/showthread.php?t=5222)

wlekoh 11-13-2003 03:41 PM

Different confirmation message for different payment methods
 
I've searched high and low in these forums and it dones't look like there's a solution to this yet...

ANyway, my problem is that I need to have a different order onfirmation message shown in the checkout process depending on what payment method they use. E.g for Direct Deposit/Money Transfer I want it to show my bank details, money order to show the postal address and for credit card payment it will just say "completed" (or similar).

I was also thinking of putting up Bpay (Australian Paymennt method) where its similar to direct deposit, but on the final confirmation page I want it to show something like this:

Bpay Details
========

Reference: 123456 (this number is fixed)
Customer ID: [ORDER ID]

How do I get it to show the customer's order ID in there? Is there some tag I can use to show the order ID in there?

B00MER 11-14-2003 11:14 AM

Code:

if($paymentid=="1") {
smarty->assign("paymentby","cc")
} elseif ($paymentid=="2") {
smarty->assign("paymentby","moneyorder")
}


You could do something like the above in cart.php :wink:

wlekoh 11-14-2003 04:14 PM

Boomer,

Thanks for taking the time to reply. I appreciate it.
I tried looking in the cart.php file but I can't find the string below anywhere...
Is this hard to do or am I better off paying somebody to do this for me?? Or can you be more specifc on how to to it all? Do I just paste it in the cart.php file anywhere I want?

I'm a real newbie to PHP and my knowledge in this is quite limited (I do however, know HTML). :cry:

B00MER 11-15-2003 09:37 AM

It takes a bit of php knowledge to do. :-({|=

wlekoh 11-15-2003 04:47 PM

You offer such services right? How much do you charge for such customisation?

B00MER 11-16-2003 08:15 AM

If you like a customization quote, feel free to visit:
http://www.cartlab.com/ and I'll get a quote with rates and time frame out to you asap. :wink:

ultimatephysique 12-12-2005 02:03 PM

Quote:

Originally Posted by B00MER
Code:

if($paymentid=="1") {
smarty->assign("paymentby","cc")
} elseif ($paymentid=="2") {
smarty->assign("paymentby","moneyorder")
}


You could do something like the above in cart.php :wink:


Programming Logic Question: What does the "paymentby" and "cc" do, i assume the later is the payment method, but where does the "paymentby" come from?

i've read the smarty docs, and i see that it's for assigning values to the template, but where did they come from and what exactly do they represent? The code that i am replacing differs from the above.

lbl_order_processed when i looked it up just said "Order Processed" which didnt help.

Code:

$smarty->assign("main","order_message");
$location[] = array(func_get_langvar_by_name("lbl_order_processed"), "");


Can somone point me in the right direction :)

B00MER 12-12-2005 02:18 PM

Quote:

Originally Posted by ultimatephysique
Quote:

Originally Posted by B00MER
Code:

if($paymentid=="1") {
smarty->assign("paymentby","cc")
} elseif ($paymentid=="2") {
smarty->assign("paymentby","moneyorder")
}


Programming Logic Question: What does the "paymentby" and "cc" do, i assume the later is the payment method, but where does the "paymentby" come from?


$smart->assign("paymentby","cc");

Does nothing more than set a variable called "paymentby" to smarty's templates with a value of "cc".

So I can now use {$paymentby} in my .tpl file to show its value or to do conditions, etc. :wink:

ultimatephysique 12-12-2005 06:21 PM

Hey Boomer,

Thanks for your reply,

Can you help me getting it to work.

The code i have is as follows.

Code:

cart.php

elseif ($mode=="order_message") {
        if($paymentid=='20') {
            $smarty->assign("paymentby","cc");
        } elseif ($paymentid=='17') {
            $smarty->assign("paymentby","paypal");
        } elseif ($paymentid=='10') {
            $smarty->assign("paymentby","bank");
        } elseif ($paymentid=='7') {
            $smarty->assign("paymentby","cheque");
        } elseif ($paymentid=='5') {
            $smarty->assign("paymentby","giftvoucher");
        }

        $smarty->assign("main","order_message");
        $location[] = array(func_get_langvar_by_name("lbl_order_processed"), "");

}


in /customer/main/order_message.tpl i added the following where i wanted the payment details displayed.
Code:

{ include file="mail/payment_method.tpl" }

i created a file called mail/payment_method.tpl
Code:

Called payment_method.tpl :)
{$lng.lbl_order_id} {$order.orderid}

{if $order.paymentby eq "cc"}
    {$lng.lbl_paymentby_cc}
{/if}

{if $paymentby eq "paypal"}
    {$lng.lbl_paymentby_paypal}
{/if}

{if $order.paymentby == "bank"}
    {$lng.lbl_paymentby_bank}
    {$orderid}
{/if}

{if $paymentby eq "cheque"}
    {$lng.lbl_paymentby_cheque}
{/if}

{if $paymentby eq "giftvoucher"}
    {$lng.lbl_paymentby_giftvoucher}
{/if}


However, the if statements dont work in the last bit of code. What is returned on the screen is this

Quote:

Called payment_method.tpl :)
Order id

it doesnt return the orderid or the correct payment method.

where have i screwed up?

B00MER 12-12-2005 06:44 PM

Code:

{ include file="mail/payment_method.tpl" userinfo=$orders[oi].userinfo order=$orders[oi].order}

Make sure its in the {section} loop:
Code:

{section name=oi loop=$orders}

ultimatephysique 12-12-2005 07:11 PM

that fixed the $orderid problem, but the {if} statement still doesnt work its' driving me insane, i've tried so many variations of the
Quote:

$payment eq "bank"

its obviously a syntax error that i cant see :(

ultimatephysique 12-12-2005 08:46 PM

ignore previous.... figured it out after leaving he code for a bit.

$order.payment_method :D

Learner 09-04-2009 01:10 AM

Re: Different confirmation message for different payment methods
 
Boomer, is it possible to modify different emails(Notify customer by email) depending upon different payment methods(CC,GC,cash/dd)?


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

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