Cart Transform Functions Not being applied

Topic summary

A developer’s cart transform function (purchase.cart-transform.run) works correctly in their development store but fails to trigger in their production environment. The function is designed to modify cart items—in the simplified test case, setting all items to a fixed price of 100.

Key troubleshooting steps identified:

  • Verify the function is activated via GraphQL (not just deployed)
  • Check the Partners Dashboard for function run logs
  • If activated but showing no runs, contact Shopify merchant support

Resolution: The issue was resolved by activating the function via GraphQL—a step that was missing in the production store setup. This activation step is separate from deployment and necessary for the function to execute.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hello everyone,

I have been having some issues with shopify functions. I am currently using the cart transform “purchase.cart-transform.run”.

I tested it in a dev store and my function gets triggered every time the cart is changed, but I installed it in my live store and the function is never getting triggered. I reverted all my code and put it in the simplest possible manner, so just applying a price of 100 to every item in the cart.

// @ts-check

/**
 * @typedef {import("../generated/api").RunInput} RunInput
 * @typedef {import("../generated/api").FunctionRunResult} FunctionRunResult
 */

/**
 * @type {FunctionRunResult}
 */
const NO_CHANGES = {
  operations: [],
};

/**
 * @param {RunInput} input
 * @returns {FunctionRunResult}
 */

export function run(input) {
  console.error("Running cart...");
  console.error(JSON.stringify(input));
  const updates = input.cart.lines.map((line) => {
      return {
        update: {
          cartLineId: line.id,
          title: "This was updated",
          price: {
            adjustment: {
              fixedPricePerUnit: {
                amount: 100
              }
            }
          }
        }
      }
  }).filter(value => value);

  return {
    operations: updates,
  };
}

I would like to know why this is not being triggered at all on one store, and always working on the other.

1 Like

Did you activate the transform via GraphQL? Do you see any function runs at all in the Partners Dashboard?

If it’s activated but you don’t see any runs at all, I would contact merchant support for the store.

1 Like

Tu respuesta me ha salvado de estar horas sin saber por qué mi Cart Transform Function no estaba funcionando. Me faltaba activarla via GraphQL. ¡Gracias!