Market lets you sell products online using the Wordpress platform.

You must be logged in to post Login

Search Forums:


 






Changing to other currencies. (Euros, Pounds, etc.)

UserPost

2:50 pm
July 7, 2008


Market Admin

Admin

posts 2750

Post edited 1:10 pm - March 5, 2010 by Market Admin


Ok, here's a set of step by step instructions for changing the currency in which your website operates in.


UPDATE:  With the release of Market version 3.5, you can now easily select the currency of your store from a new easy-to-use dropdown box located under the "Market Theme" menu tab of the Wordpress administration area.

Open single.php (located within your Market theme folder), find the following line:


<span class="price"><strong>$</strong><?php echo $price; ?></span>

 Change the dollar sign between the <strong> and </strong> tags to the Unicode number of your currency symbol.  (eg. British pound (£) = &#163;  Euro (€) = &#8364; ).  Just putting in the symbol itself doesn't always work, so using the Unicode number (eg. "&#163;" or "&#8364;" ) is more dependable.  After you insert the Unicode number for British pound, it should look like:

 <span class="price"><strong>&#163;</strong><?php echo $price; ?></span>

(You can find a reference guide of various currency Unicode numbers here:  http://www.xe.com/symbols.php


Next, find the following line: 


<input type="hidden" name="currency_code" value="USD">


Change "USD" to "GBP".  Market version 3 contains this line two separate times, so make sure to change both.  ("GBP" is the Paypal abbreviation for British Pounds.  I believe "EUR" is the abbreviation for Euro.  If you want currency in a different language, make sure you use the correct Paypal abbreviation which you can find within the Paypal multiple currencies documentation.)

So, to recap -- you will change two different lines so that they now look like this:

<input type="hidden" name="currency_code" value="GBP">


(This is assuming that you are changing to "British pounds" -- GBP. Insert your own currency code.)


Next, find the following line.


<input type="hidden" name="lc" value="US">

Replace it with the 2 letter Paypal Country Code (You'll find it listed here).  Enter "GB" for Britsih pounds, to make it look like this:

<input type="hidden" name="lc" value="GB">

Starting with Market version 3, there are also two separate instances of this line, so make sure to change both.

Save the file.


Next open up cart.php.  This is located within the "ajCart" sub-folder (wp-contentthemesmk3ajCart).

Do a search for the following line:


$Shipping = 'Shipping: $'.$Shipping;

Change the dollar sign WITHIN the single quotes to the Unicode value for British pounds, (or Euro, etc.) as you did above in step #1.  It should look like the following:


$Shipping = 'Shipping: &#163;'.$Shipping;


Finally find the following segment of code:


<td>$'.(float)($crtAmount[$item] * $crtQuantity[$item]).'</td>


Replace the first dollar sign immediately after the <td> with the same Unicode British pound symbol, euro symbol, or whatever currency you're using.  It should look like this:


<td>&#163;'.(float)($crtAmount[$item] * $crtQuantity[$item]).'</td>

Save the file.


Next, open up the file archive.php (not to be confused with archives.php with an "s")

Search for the line:

<div class="price"><strong>$</strong><?php echo $price; ?></div>

Replace the dollar sign between the <strong> tags with the same unicode number you've been working with.  It should look like this when you're done.

<div class="price"><strong>&#163;</strong><?php echo $price; ?></div>

Save the file.


Next, open up the file frontdoor.php and find the line:

<div class="price"><strong>$</strong><?php echo $price; ?></div>

Replace the dollar sign between the <strong> tags with the same unicode number you've been working with.  It should look like this when you're done.

<div class="price"><strong>&#163</strong><?php echo $price; ?></div>

Save the file.


Next, open up the search results file named search.php and find the line:

<div class="price"><strong>$</strong><?php echo $price; ?></div>

Again, change the dollar sign with your unicode number for your desired currency like you did in the previous step.  (replace between the <strong> and </strong> tags.

Save the file.


Lastly, open the file cart_bottom.php.  This is located within the "ajCart" sub-folder (wp-contentthemesmk3ajCart).

Immediately after this line:


<input type="hidden" name="upload" value="1" />


Add the following line:


<input type="hidden" name="currency_code" value="GBP">


(Replace "GBP" with "EUR" or whatever currency code you need.)


So, for British pounds, your resulting code should look something like this:

<input type="hidden" name="upload" value="1" />
<input type="hidden" name="currency_code" value="GBP">

Save the file.


**** UPDATE ****

If you're using Market version 3.3 or later, it's been modified a little from before so there are a few more changes you'll need to make.  In addition to the steps above, follow these steps as well.

Open up the file "single.php" again for editing.

Scroll down to around line 159 and find the following lines:

            if (isset($shipping[0]) && $shipping[0]!="") { echo "<option value="$shipping[0]">Standard ($".$shipping[0].")</option>"; }
            if (isset($shipping[1]) && $shipping[1]!="") { echo "<option value="$shipping[1]">Priority ($".$shipping[1].")</option>"; }
            if (isset($shipping[2]) && $shipping[2]!="") { echo "<option value="$shipping[2]">International ($".$shipping[2].")</option>"; }

Within each of these three lines is are 5 dollar signs ($).  THE FOURTH ONE in each line needs to be replaced with your currency unicode number.   -- The ones in ">Standard ($" , ">Priority ($" , and ">International ($"  .

So, for example, if you were changing to British pounds, the modified code would look like this:

            if (isset($shipping[0]) && $shipping[0]!="") { echo "<option value="$shipping[0]">Standard (&#163;".$shipping[0].")</option>"; }
            if (isset($shipping[1]) && $shipping[1]!="") { echo "<option value="$shipping[1]">Priority (&#163;".$shipping[1].")</option>"; }
            if (isset($shipping[2]) && $shipping[2]!="") { echo "<option value="$shipping[2]">International (&#163;".$shipping[2].")</option>"; }

In a similar fashion, if you scroll down to around line 250, you will see another three lines like this:

            if (isset($shipping[0]) && $shipping[0]!="") {if (isset($shipping2[0]) && $shipping2[0]!="") {$cartship[0].="/".$shipping2[0];}echo "<option value="$cartship[0]">Standard ($".$shipping[0].")</option>"; }
            if (isset($shipping[1]) && $shipping[1]!="") {if (isset($shipping2[1]) && $shipping2[1]!="") {$cartship[1].="/".$shipping2[1];}echo "<option value="$cartship[1]">Priority ($".$shipping[1].")</option>"; }
            if (isset($shipping[2]) && $shipping[2]!="") {if (isset($shipping2[2]) && $shipping2[2]!="") {$cartship[2].="/".$shipping2[2];}echo "<option value="$cartship[2]">International ($".$shipping[2].")</option>"; }

Each of these lines contains 9 dollar signs.  YOU NEED TO CHANGE THE 8th ONE to your currency unicode number.  

If you were changing to British pounds, the code would look like the following:

            if (isset($shipping[0]) && $shipping[0]!="") {if (isset($shipping2[0]) && $shipping2[0]!="") {$cartship[0].="/".$shipping2[0];}echo "<option value="$cartship[0]">Standard (&#163;".$shipping[0].")</option>"; }
            if (isset($shipping[1]) && $shipping[1]!="") {if (isset($shipping2[1]) && $shipping2[1]!="") {$cartship[1].="/".$shipping2[1];}echo "<option value="$cartship[1]">Priority (&#163;".$shipping[1].")</option>"; }
            if (isset($shipping[2]) && $shipping[2]!="") {if (isset($shipping2[2]) && $shipping2[2]!="") {$cartship[2].="/".$shipping2[2];}echo "<option value="$cartship[2]">International (&#163;".$shipping[2].")</option>"; }

Save the file.

****************

That should do it.

Make sure you update all files on your website to reflect these changes.

4:12 am
November 18, 2008


yiorgos

Member

posts 127

That fixed everything - I guess we now have a complete currency change guide which will hopefully be integrated in the next Market version!

1:36 pm
November 20, 2008


Market Admin

Admin

posts 2750

Yes, in the next version I'd like to make the currency related stuff changeable within the Product Manager admin tool.   I'm actually talking with our developers right now about it.

5:47 am
December 11, 2008


tonymac

New Member

posts 2

I'm just changing over from an OS Commerce package which offers the buyer the opportunity to  select their currency.


Is this going to be possible in a later version of Market?

12:55 pm
December 11, 2008


Market Admin

Admin

posts 2750

The code modification above is the only option as of now.  It will guide you through the process of changing currencies.


Quickly selecting different currencies is a feature that a coder is working on right now for a future release.  It will be able to be set within the product manager.

This particular feature isn't included within the release that's coming out in a day or so, but it's in the next iteration.

6:19 am
December 13, 2008


tonymac

New Member

posts 2

Just to clarify what I was asking is whether the buyer can select the choice of currency from a drop down box at the point of sale rather than it being one fixed currency  set by the sellers  individual coding for the product. Obviosuly this will require a currency conversion configuartion as we currently have in OSCommerce.

I'm interested in the possibility of upgrading to the developers licence so I'm wondering if I can get my techie to insert the necessary code to do this without too much problem?

If not when do you think it would be available?


3:51 am
December 14, 2008


yiorgos

Member

posts 127

By default that's not available but someone with php, some CSS and some Paypal API knowledge can probably do it

8:14 pm
December 15, 2008


Market Admin

Admin

posts 2750

Thanks for the clarification TMac.

The new release doesn't have that ability, however when the customer is transferred over to Paypal -- Paypal will display the amount in the buyer's own currency.

I understand that doesn't give them an idea of how much before they decide to purchase.

It could be done with a little bit of PHP programming, but you'll need to integrate it with some sort of currency exchange functionality that would need to tie into some other online reference to get the current exchange rates. 

11:31 am
February 11, 2009


gpo1

Member

posts 26

I have done all the changes everything seems to work fine on the site but when it transfers to paypal it goes back to USD. If i choose buy it now it is fine in GBP.This only happens if i choose add to cart then checkout

I need help on this !!!


1:35 pm
February 11, 2009


Market Admin

Admin

posts 2750

There are two sections of the code in "single.php" that look very similar.  One for the "Buy Now" code and another for the "Add to Cart" code.  You must make sure you change both.  It sounds to me like you only changed one section.

7:45 am
February 12, 2009


gpo1

Member

posts 26

Fixed it.. This confussed me abit ..

Lastly, open the file cart_bottom.php.  This is located within the "ajCart" sub-folder (wp-content\themes\mk3\ajCart\).

Directly after this line:


<input type="hidden" name="upload" value="1" />


Add the following line:


<input type="hidden" name="currency_code" value="GBP">

Am using market 3.3 theme,and there are two <input type="hidden" .... So I added it in the form section and it worked !

1:17 pm
April 20, 2009


observerxtra

Member

posts 8

Can I change the currency to Canadian Dollars?

What do I need to do to get the paypal payment page to display in CAD rather than USD?

2:44 pm
April 20, 2009


Market Admin

Admin

posts 2750

Yes...  Just follow the instructions in post #1 above.  The value for Canadian dollars is "CAD".


10:09 am
March 5, 2010


seorocks

Member

posts 8

cant seem to find any of the above lines in the latest version i downloaded.

I get this line in the single.php file:

<span class="price"><strong><?php echo $mkt_currency_symbol; ?></strong><?php echo $price; ?></span>


where is the $mkt_currency_symbol; saved? under which file please?


1:08 pm
March 5, 2010


Market Admin

Admin

posts 2750

Actually, with the latest version of Market -- you just need to go to the "Market Theme" settings tab in your Wordpress administration area.

Now there's a dropdown box where you can simply choose it from a list. 

No more coding required.

9:38 am
June 1, 2010


cgeale

Member

posts 4

Im in South Africa, and this dropdown box doesnt include my currency!

would you be able to include it otherwise please explain where i can edit <?php echo $mkt_currency_symbol; ?>


thanks

11:03 am
June 1, 2010


Market Admin

Admin

posts 2750

Do you have Paypal support for the Rand?

I'm looking at the Paypal developer area, and they don't list support for your currency yet.

https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside

1:56 pm
June 1, 2010


cgeale

Member

posts 4

I thaught so as it newly launched in South Africa. However it seems our currency is not itself supported yet.


Still in the old version I would have been able to just put the ZAR sign (R) in "single.php" & it would have reflected on the page?


I do not need to use paypal for now, not planning on cc payments just yet.


Is there a way around this?


Thanks

9:53 am
June 3, 2010


Market Admin

Admin

posts 2750

There is a section in the "functions.php" file now that handles that.


If you add an option to the dropdown box with the correct "value", then it may work for you.


Here's the encoded format:

ZAR/&#82;

becomes:

ZAR%2F%26%2382%3B


This would be the value you'd place.


Here are two pages you can use for the symbol codes and the encoding:

symbols:

http://www.xe.com/symbols.php


decoding:

http://meyerweb.com/eric/tools/dencoder/