Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Have different card images shown for different currencies.


chrishamblin

Recommended Posts

Posted

Hello.

 

I don't know if this bodge / fix will be of use to anyone else, but I think it comes in handy.

 

For my stores, I can accept different cards for different currencies. For GBP transactions, my stores can accept Amex, as well as Visa and MasterCard.

For EUR and USD I can't take Amex.

 

To help try and allay confusion as to what can be used to pay in each currency I did the following.

 

I added a new box to the right hand column (Just below where the currency is selected), called "cards_taken.php".

 

In catalog/includes/ column_right.php just under

 

 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
   include(DIR_WS_BOXES . 'languages.php');
   include(DIR_WS_BOXES . 'currencies.php');
 }

 

I added

 

   include(DIR_WS_BOXES . 'cards_taken.php');

 

Then in catalog/includes/boxes/ I added a new file called "cards_taken.php"

 

<?php
/*
 $Id: cards_taken.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- cards_taken //-->
         <tr>
           <td>
<?php


reset($currencies->currencies);
$currencies_array = array();
       while (list($key, $value) = each($currencies->currencies)) {
               $currencies_array[] = array('id' => $key, 'text' => $value['title']);
       }

$hidden_get_variables = '';
reset($currencies->currencies);

while (list($key, $value) = each($currencies->currencies) ) {
       if( $currency == $key )
               $hidden_get_variables .= $key;
       }
$info_box_contents = array();

if($hidden_get_variables == "GBP"){
echo '<center><img src="images/cards_UK.jpg"></center>';
} else {
echo '<center><img src="images/cards_ROW.jpg"></center>';
}

?>
           </td>
         </tr>
<!-- cards_taken_eof //-->

 

This file switches between two images (from the catalog/images/ folder), "cards_UK.jpg" and "cards_ROW.jpg"

 

As I say, I hope that this will help people work out what can be used to pay for different currencies...

 

Hope this is of some use to someone else too...

 

Chris.

Archived

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

×
×
  • Create New...