Exchange rate in Bakery

svsanchez

Hello Ruud, thank you so much, that did it!  :-D

Ruud

If you have access to phpMyAdmin you could execute a query to change all prices.
I would advice to create a database export first so you can roll back if something goes wrong.

The items table has the price information. The query to change them would be:
UPDATE mod_bakery_items set price = (price / 7.85);
where "mod_bakery_items" is the table name when you are not using a table prefix.

If you are using attributes with different prices you will need to set thos too:
UPDATE mod_bakery_item_attributes set price = (price / 7.85);

Since you will be accessing the database directly.. be carefull and only do this if you are comfortable with using phpMyAdmin. If not, you better spend the time to manually change all items!
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

svsanchez

Ok, so this solution is amazing but I messed up ugly: I uploaded all the products (about 500) with the local currency (GTQ), then applied the droplet and everything shows fine. But then I tried placing an order with Paypal and they don't accept payments in GTQ!!! I have to send the price in USD (or any other accepted currency) to Paypal in order to accept payments. I was trying to figure out how to send to Paypal the converted amount but then it occurred to me that I could probably tell the DB to change all the prices with a formula. Is this possible? I need to divide all my prices in the DB by 7.85 (US $1 = GTQ 7.85)

svsanchez

WOW, that is just amazing! Thank you Ruud, I never thought this would be possible as of now, too bad I didn't ask about this before!!!

Ruud

You can fix this by using a droplet.

In the bakery output templateblocks you could call a droplet like this.
[TXT_PRICE]: [CURRENCY] [PRICE]  ([[usd?p=[PRICE]]])

The droplet part is: [[usd?p=[PRICE]]]
This will call a droplet called USD with as parameter the current price field content.

Create a droplet (in this case called USD )
<?php

if (!isset($p)) return true;
$rate 1.3075;
return 
"USD: ".round(($p $rate),2);


Now you can change the rate daily on a single place.

The ouput of the example above will be:
Price: EUR 100.00 (USD: 130.75)
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

svsanchez

Hello, this is an idea for a future version of Bakery, it would be great to have the option of entering an exchange rate so that products can be shown in a local currency and passed to Paypal in a Paypal-accepted currency (Paypal only accepts a bunch of currencies). So if I am in Guatemala I can fill my Bakery shop with prices in dollars, tell Bakery what the Dollar / Quetzal exchange rate is and show my visitors the price in Quetzals but send the price in US Dollars to Paypal (Quetzal is NOT accepted by Paypal). This would be of great help for most south american, african and asian bakery shops.

For those who need to show their prices in a local currency and send the amount to paypal in a paypal-accepted currency, what I did was:

1. Set the bakery shop currency as the paypal-accepted currency (for example USD)
2. Set the price in the paypal-accepted currency (for example USD 100)
3. Use one of the three extra fields and call it your local currency (for example Price in GTQ) and fill each product with the local price there. Since there is no way of using exchange rates at the moment you will have to do this one product at a time.
4. Edit the page settings for your Bakery shop to show your local currency price instead of the paypal-accepted currency price. Optional: you can put in parenthesis the price in the paypal-accepted price, for example Price: Q800 (US $100)
5. Presto!

If someone knows a better way of doing this please let me know as this solution ain't a good one for Bakery stores in countries with continued devaluations.