Product prices not changing in cart as per the country code selected #2533
Replies: 1 comment
-
fixed my self |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i have implememented localization in my application, the prices of products are not getting updated in cart, for other sections i am using graphql query, in graphql queru i am sharing the: const newArrivalProducts = await storefront.query(
NEW_ARRIVALS_PRODUCTS_QUERY,
{
variables: {
country: country,
language: 'EN',
},
},
);
country, language, and country, i am fetching from url, similar i am implementing for cart as well but its not working, it is showig the default pricing what is set in the shopify backend, is there any hook or other way we can implement this so that the cart prices gets updated as per the country selected.
export async function loader({ context, request }: LoaderFunctionArgs) { const { storefront, customerAccount, cart, env, session } = context; const url = new URL(request.url); const searchParams = new URLSearchParams(url.search); const country = searchParams.get('countryIsoCode'); const isLoggedInPromise = customerAccount.isLoggedIn(); const cartPromise = cart.get(); const publicStoreDomain = env.PUBLIC_STORE_DOMAIN;
I am getting the cart pricing using: const cartPromise = cart.get();
I have tried implementing it in the similar manner like i am implementing for other sections but its still not updating in cart.
Beta Was this translation helpful? Give feedback.
All reactions