Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Different confirmation message for different payment methods

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-13-2003, 03:41 PM
 
wlekoh wlekoh is offline
 

Member
  
Join Date: Oct 2003
Posts: 25
 

Default 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?
Reply With Quote
  #2  
Old 11-14-2003, 11:14 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 11-14-2003, 04:14 PM
 
wlekoh wlekoh is offline
 

Member
  
Join Date: Oct 2003
Posts: 25
 

Default

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).
Reply With Quote
  #4  
Old 11-15-2003, 09:37 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

It takes a bit of php knowledge to do.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #5  
Old 11-15-2003, 04:47 PM
 
wlekoh wlekoh is offline
 

Member
  
Join Date: Oct 2003
Posts: 25
 

Default

You offer such services right? How much do you charge for such customisation?
Reply With Quote
  #6  
Old 11-16-2003, 08:15 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #7  
Old 12-12-2005, 02:03 PM
 
ultimatephysique ultimatephysique is offline
 

Advanced Member
  
Join Date: Dec 2005
Location: Victoria, Australia
Posts: 33
 

Default

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

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
__________________
X-Cart 4.1.6
Reply With Quote
  #8  
Old 12-12-2005, 02:18 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #9  
Old 12-12-2005, 06:21 PM
 
ultimatephysique ultimatephysique is offline
 

Advanced Member
  
Join Date: Dec 2005
Location: Victoria, Australia
Posts: 33
 

Default

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?
__________________
X-Cart 4.1.6
Reply With Quote
  #10  
Old 12-12-2005, 06:44 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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}
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:55 AM.

   

 
X-Cart forums © 2001-2020