Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Switch Currency when user clicks continue button


dailce

Recommended Posts

Posted

When the cart contents are shown I want to siwtch the user currency to what I want when they click the "continue" button (the button that takes them to the login page).

 

HOw can I do that?

Posted

I figured out that when the user is on a specific page you can add the following PHP code to the top and it will force the currency to change to the one you want.

 

 

 if($currency == 'USD'){
    $currency = 'CAD';
 }

 

Now does anyone see a problem that this can cause, is it safe to do this?

Posted

Well I added the following, this forces the currency I want when the buyer goes to check out. ANyone see a problem with it, is this ok to do?

 

ADDED

 

 ?if (substr(basename($PHP_SELF), 0, 8) == 'checkout') {
? $currency = 'CAD';
?}

 

BEFORE

 

 ?if (substr(basename($PHP_SELF), 0, 8) == 'checkout') {
? $currency = 'CAD';
?}

// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
?if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
?$cartID = $cart->cartID;

 

in "checkout_shipping.php"

 

 

or do you think it should be:

 

  if (substr(basename($PHP_SELF), 0, 17) == checkout_shipping') {
  $currency = 'CAD';
 }

Archived

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

×
×
  • Create New...