I created a Shopify extension app for my company that changes the price of the Free Ring Sizing Kit to 0 when an eligible product is added to the cart. It works as intended, but the issue is that when you switch the country, it displays differently in the cart. It does display as free in the checkout, no matter the country, if that helps. I can not figure out why it displays differently, but I need to be shown as 0, no matter the country or currency.
How it should look:
How it looks when you switch the country:
Checkout:
My code:
import type {
CartTransformRunInput,
CartTransformRunResult,
Operation,
} from "../generated/api";
export function cartTransformRun(
input: CartTransformRunInput
): CartTransformRunResult {
const operations: Operation[] = [];
const TARGET_VARIANT_ID = "gid://shopify/ProductVariant/43178165534896";
let triggerQty = 0;
for (const line of input.cart.lines) {
if (
line.merchandise.__typename === "ProductVariant" &&
line.merchandise.product.inAnyCollection
) {
triggerQty += line.quantity;
}
}
if (triggerQty === 0) return { operations: [] };
for (const line of input.cart.lines) {
if (
line.merchandise.__typename === "ProductVariant" &&
line.merchandise.id === TARGET_VARIANT_ID
) {
if (line.quantity <= (triggerQty + 1)) {
operations.push({
lineUpdate: {
cartLineId: line.id,
title: "Free Ring Sizing Kit (Free With Order)",
price: {
adjustment: {
fixedPricePerUnit: {
amount: "0.00",
},
},
},
},
});
}
}
}
return { operations };
}


