View Single Post
  #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