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

When an international customer logs in, having Paypal only

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-19-2005, 10:15 AM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default When an international customer logs in, having Paypal only

Hi all, I was wondering if there is a way to set up my xcart so that when an international customer logs in, that their only payment option is to use paypal, instead of a couple others I have listed such as Credit card, etc.

My CC processor does not allow payments from any international customers including from Canada so I would like to make only Paypal available to them.

Thanks!
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #2  
Old 04-19-2005, 12:34 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Whoa, sounds like you need a new payment gateway To my knowledge, you can only specify payment methods via membership level, not zone. That doesn't mean it can't be done, it just means it can't be done out of the box.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 04-19-2005, 12:38 PM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

Yes, my payment processors are very strict, and unfortunately I am signed in for 2 more years! I'm guessing there is no easy way then to allow international customers to only to be able to pay through paypal?
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #4  
Old 04-19-2005, 12:45 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Might want to check with one of the PHP gurus (Shan, Jon, Carrie, X-Cart) and see what they would charge to customize it for you.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 04-20-2005, 02:19 PM
 
dsparks dsparks is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 34
 

Default

This mod is for v3.5.8 and v4.0.13 only. It should work for all versions in between, since the code if very similar, but I have only checked it on these.

I did not know if you needed to determine this based on the customer billing or shipping address.

I have included code for the shipping address. Just change s_country to b_country if needed.


Modify the file /skin1/customer/main/checkout.tpl:


Find the following code at line 68 in v3.5.8 and line 92 in v4.0.13:

Code:
{section name=payment loop=$payment_methods} <tr> <td width=1><input type=radio name=paymentid value={$payment_methods[payment].paymentid}{if $payment_methods[payment].is_default eq "1"} checked{/if}></td> <td nowrap>{$payment_methods[payment].payment_method}</td> <td>{$payment_methods[payment].payment_details}</td> </tr> {/section}


and change it to:

Code:
{if $userinfo ne "" and ($userinfo.s_country eq $config.Company.location_country)} {assign var="destination" value="L"} {else} {assign var="destination" value="I"} {/if} {section name=payment loop=$payment_methods} {if $destination eq "L" or ($destination eq "I" and $payment_methods[payment].payment_method eq "PayPal")} <tr> <td width=1><input type=radio name=paymentid value={$payment_methods[payment].paymentid}{if $payment_methods[payment].is_default eq "1"} checked{/if}></td> <td nowrap>{$payment_methods[payment].payment_method}</td> <td>{$payment_methods[payment].payment_details}</td> </tr> {/if} {/section}


That's it.

This will only allow the "PayPal" payment type if the customer shipping country is not the local country based on the configuration of your current x-cart setup and allow all normal payment types if the customer's country is the local country.

This is based on the same sort of logic as the shipping selector for International or Domestic shipping.

Hope this helps....
__________________
X-Cart Gold: v4.0.17
Reply With Quote
  #6  
Old 04-25-2005, 11:06 PM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

wow, I just noticed that you replied to this thread. Thanks a lot dsparks. I will definitely try install it and let you know how it works out.
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #7  
Old 04-25-2005, 11:33 PM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

That was really easy! Thanks a lot dsparks!

If I want to add another payment option such as pay by Gift Certificates, how would I do that? Also, is there a way that I can put a note inside the box titled Payment method stating that international customers may only use Paypal as a form of payment?

Thanks again!
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #8  
Old 04-26-2005, 08:30 AM
 
dsparks dsparks is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 34
 

Default

To add more payment types, you can just keep adding "or" statements to the if, like this:

Code:
{if $destination eq "L" or ($destination eq "I" and $payment_methods[payment].payment_method eq "PayPal") or ($destination eq "I" and $payment_methods[payment].payment_method eq "Gift Certificate")}

Note: Make sure the code above is all on one line. It looks like the display is multi-lined but it all has to be on the same line.

Yes, you can add a note inside the "Payment method" box. This is what I did:

In the file skin1/customer/main/checkout.tpl change the code around line 65 from:

Code:
{capture name=dialog} <form method=get action="cart.php" name=checkout_form> <table border=0 align=center>

to this:

Code:
{capture name=dialog} <table border=0 align=center width=100%> <tr> International customers may only use Paypal and Gift Certificates as a payment options. </tr> </table> <form method=get action="cart.php" name=checkout_form> <table border=0 align=center>


This text will be displayed right above the payment types.

Hope this helps...
__________________
X-Cart Gold: v4.0.17
Reply With Quote
  #9  
Old 04-27-2005, 07:39 AM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

Works great! Thanks again for all your help.

Last question, lol is there a way to make it so that the part that says
"International customers may only use Paypal and Gift Certificates as a payment options." also only shows up when an international customer logs in?
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #10  
Old 04-27-2005, 08:07 AM
 
dsparks dsparks is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 34
 

Default

Yes you can, just change the code in the file /skin1/customer/main/checkout.tpl to the following:

Code:
{capture name=dialog} {if $userinfo ne "" and ($userinfo.s_country ne $config.Company.location_country)} <table border=0 align=center width=100%> <tr> International customers may only use Paypal and Gift Certificates as a payment options. </tr> </table> {/if} <form method=get action="cart.php" name=checkout_form> <table border=0 align=center>

Note: The above is based on the shipping country.

Hope this helps...
__________________
X-Cart Gold: v4.0.17
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 11:32 AM.

   

 
X-Cart forums © 2001-2020