How to display currency symbol assigned to shopper group, and NOT shop default?

Started by ndmk5, April 30, 2019, 15:38:49 PM

Previous topic - Next topic

ndmk5

Hi,

Client online store is to sell the same products to two different pre-registered groups, in both Pound Sterling and Euros respectively - each group must only see their currency and not each others, and should not have a way of choosing their currency.

Example:
Group UK - Sample product  A -  £15
Group IE - Sample product A - €20

Sample product A is set up with two different prices, visible only to each respective groups (When a user requests an account, they are added to the required group).
Guest users do not see prices.

Group IE is set € currency
Group Uk is set to £

So Product A is set to £15 visible to the UK group only, and another price of €20 visible to the IE group only.

The issue I have is that as the store is set to default value of Pound Sterling, when a user from the IE group logs in they see the correct price (€20), but is still displaying as £20 (default store currency).

Is there a way to denote that users who are logged in are displayed a currency designated to them and NOT the default currency of the shop?

After much searching I came across promising lead here by GJC Web Design: https://www.gjcwebdesign.com/joomla-virtuemart-tips/273-change-the-virtuemart-currency-symbols-for-multi-currency.html   but unfortunately it is for a much older version of VM and are no longer valid.

Any help/thoughts/pointers in the right direction would be much appreciated. I'm sure there is an answer!

Many, many thanks in advance.


DETAILS:

PHP 7.1.27
Joomla! 3.9.5
Virtuemart 3.4.2

Studio 42

Hi,
Have you set the right currency per price in your product ?
And if you see the same price with € and £ then you have a problem with the currency converter, it should apply a rate.
If you cannot solve the issue, you can write a plugin that check the user group and switch the right currency correctly(and i think it's possbile to prevent currency switching too).
You can contact me or breakdesign or other know developer in the forum, if you need someone to create the plugin.

ndmk5

Thanks for your reply.

That's not exactly the problem I'm having.
I'm not looking for the prices to be converted and have managed to stop the conversion happening by setting the rate for the Euros currency.
I am looking to have total separate, individual prices for different currencies that are not influenced by conversions or that rely on each other in any way. So one item could be set as £10 for example, while the same product could theoretically sell for €20, €50 any other amount - it's irrelevant.

I have actually managed to get that part working OK, so that prices are unrelated. The problem is that the user is seeing the result in Pound Sterling regardless.

So currently;

Product A set to £10 - UK group sees this product as £10 just fine
Product A (the same product) also has a price of €1000 for example - The IE group is shown £1000 --- This is the problem - I need this to be shown as €1000!

Ultimately, I need those uses who are paying the € prices for the items to be shown prices displayed as €, and not £ (the shop default).

Any ideas?

Studio 42

I have understand your request.
You have 2 prices(or more)
first price is in € and second in £
price in € are for shopper group 1
price in £ are for shopper group 2
In your product you set 2 prices, one per shopper group.
But currency change and is set to default.
To prevent it, you need to switch to right currency, so you need a plugin to check the shopper group and switch to right currency.
Is this the problem or not ?

ndmk5

Yes thanks, I see many plugins that will change currency by geolocation etc - this won't work.

I need a way to preset the currency displayed to a particular group and cant believe it isn't more straight forward. I'm sure I'm not the first person with this problem!

I have toyed with the idea of using the currency switcher module, one set to Euros and only visible to IE group but it still pulls in store default currency - so no good.

Studio 42

The module is not a right solution in any case. If the user are in a page not displaying the module, then currency is not switched, eg all page using &tmpl=component, json render .... I explained you the solution you need,
so else you have to buy a plugin(if it exist) or you/someone have to do it.

GJC Web Design

see here how the currency is set programatically

http://forum.virtuemart.net/index.php?topic=142474.msg502884#msg502884

you could do something like detect the shopper group and set the $req_currency accordingly then call the function
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ndmk5

UPDATE

Thanks for the assistance, although due to an oversight I've had to change approach!

Client is now selling products with multi-variables (size & colour). This is problematic because although changing price for each variable is straight-forward, giving each variable multiple prices isn't!
To get around the multi currency issue I am doing two separate sites, one specifically for UK and one for IE.

Although, I did manage to find a promising workaround before abandoning the idea;
I found an addon that displays currency based on language of shopper. I was able to assign the English UK language to UK shopper group with £ as default, and the IE shopper group (ireland) to English American, and assigned euros as currency for shoppers who use that language.

As accounts where to be created and managed on behalf of shoppers this would be straight forward to administer- just if anyone else has a similar problem in the future!


Milbo

Just to add an important information to the origin request.

There is a hidden config which could help you. "pricesbyCurrency".

Currently, when you have a product with two different prices with different currencies, then the system always converts them to the displayed currency.

So for example There is a product with two prices, one in USD, the other in Euro. A customer selecting pound would see both prices in pounds.

when you use the hidden config "pricesByCurrency", then the system tries to take the price with the correct currency. so a customer selecting the USD currency will get the price configured with USD if available.

pricesbyCurrency=0
prices 1 USD, 1 EURO displays in pound 0.77 or 0.87

pricesbyCurrency=1
prices 1 USD, 1 EURO displays in pound 0.77 or 0.87
But displays for selecting USD $1 and selecting euro just 1 €.

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

The Yellow Fellow

About the hidden config: am I supposed to add that to the virtuemart_configs table?
I tried that but it didn't work for me...

EDIT: I think I figured it out: it's supposed to go into /administrator/components/com_virtuemart/virtuemart.cfg

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pinochico

QuoteI found an addon that displays currency based on language of shopper

Yes, we have this plugin free on www.easyjoomla.org a lot of years :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products