Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

FoxyShop Currency Conversion Script

sparkweb Feb 1st, 2012 249 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. ?>
  2. <div id="convertbox">
  3. <div>All prices are listed in USD. Estimate conversion rate below:</div>
  4. <select name="x:toCurrency" id="toCurrency">
  5.   <option value="USD">United States Dollars - USD</option>
  6.   <option value="GBP">United Kingdom Pounds - GBP</option>
  7.   <option value="CAD" selected="selected">Canada Dollars - CAD</option>
  8.  
  9.   <option value="AUD">Australia Dollars - AUD</option>
  10.   <option value="JPY">Japan Yen - JPY</option>
  11.   <option value="INR">India Rupees - INR</option>
  12.   <option value="NZD">New Zealand Dollars - NZD</option>
  13.   <option value="CHF">Switzerland Francs - CHF</option>
  14.   <option value="ZAR">South Africa Rand - ZAR</option>
  15.  
  16.   <option value="DZD">Algeria Dinars - DZD</option>
  17.   <option value="USD">America (United States) Dollars - USD</option>
  18.   <option value="ARS">Argentina Pesos - ARS</option>
  19.   <option value="AUD">Australia Dollars - AUD</option>
  20.   <option value="BHD">Bahrain Dinars - BHD</option>
  21.   <option value="BRL">Brazil Reais - BRL</option>
  22.  
  23.   <option value="BGN">Bulgaria Leva - BGN</option>
  24.   <option value="CAD">Canada Dollars - CAD</option>
  25.   <option value="CLP">Chile Pesos - CLP</option>
  26.   <option value="CNY">China Yuan Renminbi - CNY</option>
  27.   <option value="CNY">RMB (China Yuan Renminbi) - CNY</option>
  28.   <option value="COP">Colombia Pesos - COP</option>
  29.  
  30.   <option value="CRC">Costa Rica Colones - CRC</option>
  31.   <option value="HRK">Croatia Kuna - HRK</option>
  32.   <option value="CZK">Czech Republic Koruny - CZK</option>
  33.   <option value="DKK">Denmark Kroner - DKK</option>
  34.   <option value="DOP">Dominican Republic Pesos - DOP</option>
  35.   <option value="EGP">Egypt Pounds - EGP</option>
  36.  
  37.   <option value="EEK">Estonia Krooni - EEK</option>
  38.   <option value="EUR">Euro - EUR</option>
  39.   <option value="FJD">Fiji Dollars - FJD</option>
  40.   <option value="HKD">Hong Kong Dollars - HKD</option>
  41.   <option value="HUF">Hungary Forint - HUF</option>
  42.   <option value="ISK">Iceland Kronur - ISK</option>
  43.  
  44.   <option value="INR">India Rupees - INR</option>
  45.   <option value="IDR">Indonesia Rupiahs - IDR</option>
  46.   <option value="ILS">Israel New Shekels - ILS</option>
  47.   <option value="JMD">Jamaica Dollars - JMD</option>
  48.   <option value="JPY">Japan Yen - JPY</option>
  49.   <option value="JOD">Jordan Dinars - JOD</option>
  50.  
  51.   <option value="KES">Kenya Shillings - KES</option>
  52.   <option value="KRW">Korea (South) Won - KRW</option>
  53.   <option value="KWD">Kuwait Dinars - KWD</option>
  54.   <option value="LBP">Lebanon Pounds - LBP</option>
  55.   <option value="MYR">Malaysia Ringgits - MYR</option>
  56.   <option value="MUR">Mauritius Rupees - MUR</option>
  57.  
  58.   <option value="MXN">Mexico Pesos - MXN</option>
  59.   <option value="MAD">Morocco Dirhams - MAD</option>
  60.   <option value="NZD">New Zealand Dollars - NZD</option>
  61.   <option value="NOK">Norway Kroner - NOK</option>
  62.   <option value="OMR">Oman Rials - OMR</option>
  63.   <option value="PKR">Pakistan Rupees - PKR</option>
  64.  
  65.   <option value="PEN">Peru Nuevos Soles - PEN</option>
  66.   <option value="PHP">Philippines Pesos - PHP</option>
  67.   <option value="PLN">Poland Zlotych - PLN</option>
  68.   <option value="QAR">Qatar Riyals - QAR</option>
  69.   <option value="RON">Romania New Lei - RON</option>
  70.   <option value="RUB">Russia Rubles - RUB</option>
  71.  
  72.   <option value="SAR">Saudi Arabia Riyals - SAR</option>
  73.   <option value="SGD">Singapore Dollars - SGD</option>
  74.   <option value="SKK">Slovakia Koruny - SKK</option>
  75.   <option value="ZAR">South Africa Rand - ZAR</option>
  76.   <option value="KRW">South Korea Won - KRW</option>
  77.   <option value="LKR">Sri Lanka Rupees - LKR</option>
  78.  
  79.   <option value="SEK">Sweden Kronor - SEK</option>
  80.   <option value="CHF">Switzerland Francs - CHF</option>
  81.   <option value="TWD">Taiwan New Dollars - TWD</option>
  82.   <option value="THB">Thailand Baht - THB</option>
  83.   <option value="TTD">Trinidad and Tobago Dollars - TTD</option>
  84.   <option value="TND">Tunisia Dinars - TND</option>
  85.  
  86.   <option value="TRY">Turkey Lira - TRY</option>
  87.   <option value="AED">United Arab Emirates Dirhams - AED</option>
  88.   <option value="GBP">United Kingdom Pounds - GBP</option>
  89.   <option value="USD">United States Dollars - USD</option>
  90.   <option value="VEB">Venezuela Bolivares - VEB</option>
  91.   <option value="VND">Vietnam Dong - VND</option>
  92.  
  93.   <option value="ZMK">Zambia Kwacha - ZMK</option>
  94. </select>
  95. <input type="button" name="convert" id="convert" value="Convert" />
  96. <input type="hidden" name="x:fromvalue" id="amount" value="<?php echo $product['price']; ?>" />
  97.  
  98. <div id="results"></div>
  99. </div>
  100.  
  101. <script type="text/javascript">
  102. jQuery(document).ready(function($) {
  103.        
  104.         //Set Cookie If There
  105.         if (getCookie("toCurrency")) $("#toCurrency").val(getCookie("toCurrency"));
  106.        
  107.         $('#convert').click(function(){
  108.                
  109.                 //Get all the values
  110.                 var amount = $('#amount').val();
  111.                 var from = "USD";
  112.                 var to = $('#toCurrency').val();
  113.  
  114.                 //Set Cookie
  115.                 setCookie("toCurrency", to);
  116.  
  117.                 //Make data string
  118.                 var dataString = "amount=" + amount + "&from=" + from + "&to=" + to;
  119.  
  120.                 $.ajax({
  121.                         type: "POST",
  122.                         url: "<?php bloginfo("stylesheet_directory"); ?>/ajax_converter.php",
  123.                         data: dataString,
  124.  
  125.                         success: function(data){
  126.                                 //Show results div
  127.                                 $('#results').show();
  128.  
  129.                                 //Put received response into result div
  130.                                 $('#results').html(data);
  131.                         }
  132.                 });
  133.         });
  134. });
  135.  
  136. function foxyshop_after_variation_modifiers(new_code,new_codeadd,new_price,new_price_original,new_ikey,current_product_id) {
  137.         jQuery("#amount").val(new_price / 100);
  138. }
  139.  
  140. function setCookie(cookieName,cookieValue) {
  141.         document.cookie = cookieName+"="+escape(cookieValue) + ";path=/";
  142. }
  143. function getCookie(w){
  144.         cName = "";
  145.         pCOOKIES = new Array();
  146.         pCOOKIES = document.cookie.split('; ');
  147.         for(bb = 0; bb < pCOOKIES.length; bb++){
  148.                 NmeVal  = new Array();
  149.                 NmeVal  = pCOOKIES[bb].split('=');
  150.                 if(NmeVal[0] == w){
  151.                         cName = unescape(NmeVal[1]);
  152.                 }
  153.         }
  154.         return cName;
  155. }
  156. </script>
  157. <?php
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top