Why does my cart-transfrom-app not change product to zero for internatonal order

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 };
}

Hi @Hannah_Payne,

Thank you for sharing your code, I don’t see any issues with your implementation. Do you ever see the cart line not show as “free” on checkout or is it only not working in the cart?

My first guess/suspection is this is because of settings either in your store or Shopify side about displaying prices for the EU. I would check there to start with :slight_smile:
As often in the EU you have to display the full price as well as the discount.

@Hannah_Payne Verify that the “Free Ring Sizing Kit” has a price of 0.00 set for both countries/markets in the Shopify admin under Markets settings.

You must explicitly override the price for the Sizing Kit to 0.00 in all active countries/markets via the Shopify Admin:

Steps:

  1. Go to Shopify AdminMarkets
  2. Click on each market (e.g., EUR, UK, etc.)
  3. Under Products, find the Free Ring Sizing Kit
  4. Make sure its price is set to 0.00 for every currency and market.

This ensures Shopify has no conflicting localized pricing when the cart is rendered.

Are you still seeing this issue @Hannah_Payne ?