Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product prices per country


HairyJim

Recommended Posts

Hi all,

 

I am looking for advice on what I would need to change in OS Commerce so instead of prices being calculated based on the exchange rate I am able to enter seperate prices per country.

 

I am only ever going to offer GBP, Eur & US Dollar

 

I really need advice with this.

 

Regards

Jim

Link to comment
Share on other sites

It is quite obvious this is something people have little experience with based on the number of replies.

 

I will break my problem into little chunks and perhaps some of what I ask can be answered then i will try and figure the unanswered out myself.

 

The below code is taken from the shopping cart. This is displaying the price of the item in the cart. Where is the currency value that the user choose stored? I have found the funtion in the currency class but I fail to see where the currency value is passed?

 

$currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');

 

I may be barking up the wrong tree but my thinking was if I was able to modify the currency class so instead of mutliplying the default currency by the exchange rate I just chucked in an if statement that selected the correct value from the DB.

 

I would add two more columns to the products table for USD & EUR. So if I knew what currency the user had chosen I could just blurt out the value from the db through the currency class (which would save bundles of work).

 

Coulkd people comment on what I am asking and thinking. Please someone throw me a lifeline here....

Link to comment
Share on other sites

I would place the exchange rates manually (in fact that's what I am going to do with my store). It's not the best solution, but it's something. If your basic currency is ? then I would recommend the following rates: to $ 2, to ? 1,5. That means that if a product is sold for ? 10.00 it would be $ 20.00 (actual $ rate would be around $ 18) and ? 15.00 (actual ? rate would be around ? 14.59).

 

I hope I helped...

Link to comment
Share on other sites

I would place the exchange rates manually (in fact that's what I am going to do with my store). It's not the best solution, but it's something. If your basic currency is ? then I would recommend the following rates: to $ 2, to ? 1,5. That means that if a product is sold for ? 10.00 it would be $ 20.00 (actual $ rate would be around $ 18) and ? 15.00 (actual ? rate would be around ? 14.59).

 

I hope I helped...

 

Thanks for the reply.

 

The problem is I do not wish to calculate the USD or EUR based on the exchange rate I want each product to have three prices. 1 for ?, 1 for USD and 1 for EUR.

 

I just do not understand the OSC solution well enough to make or know how to make this change. If someone could say how I achieve this then I could go away and perhaps do it.

Link to comment
Share on other sites

While it's not my business, I would like to ask: Why do you need to display prices in all 3 currencies? There is always the currency selection infobox, so if somebody needs to pay in $ shall need to select the US Dollar in the infobox.

 

If you could provide some more info on what you are trying to do and why I might be able to figure out a solution (but that solution might have nothing to do with programming)

Link to comment
Share on other sites

Thanks for the reply.

 

The problem is I do not wish to calculate the USD or EUR based on the exchange rate I want each product to have three prices. 1 for ?, 1 for USD and 1 for EUR.

 

I just do not understand the OSC solution well enough to make or know how to make this change. If someone could say how I achieve this then I could go away and perhaps do it.

 

So let me get this right you want have 3 separate fixed prices per product based on currency selected?

 

I suppose you could do with frigged currency rates as above or via attributes / options but none are elegant solutions. Maybe if you explain a bit more about what you are trying to achieve.

 

- Nick

Link to comment
Share on other sites

Hi sorry for the confusion.

 

I have three currencies that products can be bought in; GBP, EUR & USD.

 

Now when the user changes from the default currency (GBP) to either USD or EUR the price is calculated based on the exchange rate.

 

I do not want this to happen. What I want is when a user changes from one currency to another the system just picks the set currency price from the table.

 

So each product has a set GBP, EUR & USD price that is selected when the currency is changed.

 

So my questions are:

 

How would I do this?

Where would I need to change the OSC solution do this?

Is this actually possible? (better be otherwise I'm heading towards Niagra without a paddle)

 

I hope this makes sense.

Link to comment
Share on other sites

That would make sense if your price in ? is 10, the price in $ is 5 and the price in ? is 7 (which means that product price is entirely different that the currency rates). If this is the case then you really have to do that. If not (or if the differences are minor) I would suggest you to follow the custom rate setup.

 

Anyway, it seems that the only way to avoid the mess is to set up 3 identical stores (I guess you only have to just copy-paste the master shop directory and then go and change product prices, but that depends on where your sql database is located - meaning that if the sql database is located in a directory outside the store directory, this would only mess up things worse - but normally each store has its own sql database). What you need to do after that is that your customer will have to select transactional currency prior to entering a store (you could do that in the homepage)

Link to comment
Share on other sites

You could theoretically write a module / contrib for this or pay someone to do it for you  :)

 

Actually this is kinda what I was going to do once I got a solution in place.

 

But I have no idea what I need to change in order for this to happen. Hence my posts.

 

If you do would you share your knowledge?

Link to comment
Share on other sites

  • 1 month later...
Has someone got any further suggestions for this?

 

Hi, I just pulled up your question doing a search on another issue. I actually had to solve pretty much the same problem a few months ago.

 

Let's just say it wasn't easy, and it may not be directly applicable to your case because we don't use 'products_price' at all, but do all our pricing with through the products_attributes table using 'products_options_price' (because all of our products have multiple pack sizes). In other words, you could use this idea, but you would have to put the adjustments in both the products_attributes and products_description(?) tables. It could get hairy.

 

I'll give you a general outline of how I solved it.

 

Basically, when a customer chooses the currency they are specifying the value of a $currency variable that the currency class uses to make the exchange rate adjustments. What I did was lock in the exchange rate adjustment for both Euros and Pounds which can no longer be updated and then introduced a separate European multiplier (a percent to add or subtract from each price) as a new field in the products_attributes_values table (I think that was the table). I used a spreadsheet to figure out exactly what the percent to add or subtract to each price should be and then hard entered each adjustment. Then I had to go through the code and track down each place where prices are computed and put a little subroutine to make the price adjustment if the currency was Euro or pounds. There were a few tricky parts, but I finally got all the bases covered and the system works fine. It begins with the dollar price, but using the percent adjustment field you can make any Euro or Pound price be whatever you want (Our European distributor has the same markup or down for both, so I only needed one adjustment for the two currencies)

 

Here's a code fragment from 'product_info.php' that could give you an idea of how it works. The new data field is 'euro_price_adjustment':

 

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.euro_price_adjustment from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

 

 

//Euro price adjustment

if ($currency == "EUR" || $currency == "GBP"){

$products_options['options_values_price'] = $products_options['options_values_price'] + ($products_options['options_values_price']*($products_options['euro_price_adjustment']/100));

}

//end Euro price adjustment

 

 

There are three or four places you have to go through and make this analogous change because the prices are totalled several different places. It was tricky to find them all so that the adjusted prices are also present in the order history.

 

Anyway, I hope this helps.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...