Shopify B2B > Incorrect Currency Displayed

Hiya,

A previously fixed B2B Bug has arrisen…

In short, the wrong currency is showing to B2B Customers where their currency doesn’t match the stores default.

As an example, we’ve got a B2B Store which has a default currency of £ GBP.
A customer’s company only has one location which has access to a Catalog which is priced in $ USD.
Despite the fact that they only have one currency that they can use the front-end of the website displays in GBP. This is corrected once the user goes into the checkout.

Video to demonstrate here too: Watch 2024-10-29 15-53-59 | Streamable

Thanks,
Ceri.

Hi Ceri,

I’ve connected with the B2B product team and it appears this issue is related to a known bug that the team is actively addressing. I’ll update this forum post when I learn more from them.

2 Likes

Thank you Liam, I’ve added a JS/Liquid work-around for now.

{%- if customer and customer.current_location -%}
    {%- if customer.current_location.shipping_address.country.currency.iso_code != blank -%}
        {%- if customer.current_location.shipping_address.country.currency.iso_code != cart.currency.iso_code -%}
            <script>
                (() => {
                    // Failsafe for incorrect currency
                    // Uses sessionStorage as an additional failsafe to prevent loop
                    try {
                        let currentCurrency = sessionStorage.getItem("currency");
                        let newCurrency = '{{ customer.current_location.shipping_address.country.currency.iso_code }}';
                
                        if(newCurrency && currentCurrency != newCurrency){
                            sessionStorage.setItem("currency", newCurrency);
                            console.info("Redirecting to correct currency", newCurrency);
                            window.location.href = '?currency='+newCurrency;
                        }
                    } catch (error) {
                        console.error(error);
                    }
                })()
            </script>
        {%- endif -%}
    {%- endif -%}
{%- endif -%}