Jump to content

Creating two different prices in one file..


hal-11

Recommended Posts

Hi, this is my first post on the forum.  I am having a bit of trouble trying to create a file with the price of a product in two different currencies.  For example my $price will be calculated through a number of discounts and produce the correct price for the product in the output file, but i am now required to produce the outputted price in gbp and eur.  Any help would be very much appreciated.

Link to comment
Share on other sites

Hi, Actually the price is determined by a formulae that calculates the product price and then adds how much profit margin to be added on.  the currency rate always stays the same in the formulae.  So basically my output file creates all the correct prices in gbp, but in that same file I also require the output to produce a price for euro.  i.e  if($retailerId == 1) calculate formulae and produce price gbp.  not sure how to implement it for two seperate formulaes with same retailerId but with different results(euro).  Hope that helps...

Link to comment
Share on other sites

yes, that's sort of what I was suggesting:

 

you calcuate your gbp price with your formula, (this remains unaltered) but at the moment of displaying it, you make an api call to google, send over your price and google will return the same price in euros.

 

then you can display both.

 

of course this depends on what you're displaying... if it's a very long page with hundreds of prices, then api calls don't make sense because they would take too long.

Link to comment
Share on other sites

Yes it would actually be in batches of around 10 - 20 thousand products, so it prob wouldnt work.  I will have a formulae sorted for the euro easily its just trying to implement the two at the same time.  I was thinking of creating another variable say $price1 - insert euro formulae then call this the 'euro-price' header,  but without much  success i must admit.  Brick wall meet my face  :-[

Link to comment
Share on other sites

so basically all you need is to store the correct exchange rate somewhere you can update it from time to time, and just use that to convert the value to euros.

 

At this moment, 1 gbp = 1.126 Euros. Just multiply gpd by the rate to get value in euros.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.