Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fade Out Payment Method If Comming From Another Country


strub

Recommended Posts

Hy

 

I wanted to fade out one of my payment method if a customer comes from abroad. Our shop is in Switzerland so every customer who

is not from Switzerland can only pay with PayPal.

 

I did the same with the Cost if an order is more than 300 USD then customers can only pay with paypal.

 

Here is the code I did already,

 

I assme I have to make a connection to the dB.

 

This code is from : checkout_payment,php line about 350

  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

if ($currencies->format($cart->show_total()) > 300) {
$n=0;

}

if ($check_countries['countries_id'] == 204) {
$n=0;
}

 

Thanks in advance

Link to comment
Share on other sites

Hy

 

I wanted to fade out one of my payment method if a customer comes from abroad. Our shop is in Switzerland so every customer who

is not from Switzerland can only pay with PayPal.

 

I did the same with the Cost if an order is more than 300 USD then customers can only pay with paypal.

 

Here is the code I did already,

 

I assme I have to make a connection to the dB.

 

This code is from : checkout_payment,php line about 350

  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

if ($currencies->format($cart->show_total()) > 300) {
$n=0;

}

if ($check_countries['countries_id'] == 204) {
$n=0;
}

 

Thanks in advance

Why not just use the zones feature of OSC?

Link to comment
Share on other sites

I came a bit closer but is still not correctly working.

 

I changed to

 

if ($country['entry_country_id'] !== 204) {
$n=0;
}

 

 

now it fades out one payment method. But also if a customer

has the entry_country_id == 204 which is Switzerland.

So somewhere must be a little problem.

Link to comment
Share on other sites

I am sure something with this code must be wrong

 

($country['entry_country_id']

 

 

although entry_country_id should be right.

 

but sth must be still missing

 

If I could echo just the id from the country so that

would be the right code. But how to find the right code?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...