Cart transform function - expand operation troubles

I am developing a cart transform function that returns expand statements, and have troubles getting it to work. The function is registered and called as expected, and the calls succeed. The logs look good, the function returns expand operations as expected. However, they don’t have an effect on the cart. Including an example below. Any hints would be greatly appreciated.

Example input:

{
  "cart": {
    "lines": [
      {
        "id": "gid://shopify/CartLine/2cac2c06-f929-45d3-97a6-f02c47baa9bd",
        "quantity": 1,
        "cost": {
          "amountPerQuantity": {
            "amount": "10.0",
            "currencyCode": "EUR"
          },
          "subtotalAmount": {
            "amount": "10.0",
            "currencyCode": "EUR"
          },
          "totalAmount": {
            "amount": "10.0",
            "currencyCode": "EUR"
          }
        },
        "customPrice": {
          "value": "48"
        },
        "merchandise": {
          "__typename": "ProductVariant",
          "id": "gid://shopify/ProductVariant/44751508308119",
          "title": null,
          "product": {
            "id": "gid://shopify/Product/8607857311895",
            "productConfiguration": {
              "type": "metaobject_reference",
              "value": "gid://shopify/Metaobject/82815746199"
            }
          }
        }
      },
      {
        "id": "gid://shopify/CartLine/592f9597-183c-4cc9-b904-3107660ee512",
        "quantity": 1,
        "cost": {
          "amountPerQuantity": {
            "amount": "10.0",
            "currencyCode": "EUR"
          },
          "subtotalAmount": {
            "amount": "10.0",
            "currencyCode": "EUR"
          },
          "totalAmount": {
            "amount": "10.0",
            "currencyCode": "EUR"
          }
        },
        "customPrice": null,
        "merchandise": {
          "__typename": "ProductVariant",
          "id": "gid://shopify/ProductVariant/44751508308119",
          "title": null,
          "product": {
            "id": "gid://shopify/Product/8607857311895",
            "productConfiguration": {
              "type": "metaobject_reference",
              "value": "gid://shopify/Metaobject/82815746199"
            }
          }
        }
      }
    ]
  },
  "cartTransform": {
    "customPriceProduct": {
      "type": "variant_reference",
      "value": "gid://shopify/ProductVariant/45002551099543"
    }
  },
  "presentmentCurrencyRate": "1.0"
}

Example output:

{
  "operations": [
    {
      "expand": {
        "cartLineId": "gid://shopify/CartLine/2cac2c06-f929-45d3-97a6-f02c47baa9bd",
        "title": "Test product",
        "expandedCartItems": [
          {
            "merchandiseId": "gid://shopify/ProductVariant/44751508308119",
            "quantity": 1
          },
          {
            "merchandiseId": "gid://shopify/ProductVariant/45002551099543",
            "quantity": 38
          }
        ]
      }
    }
  ]
}

Maybe there are prerequisites on the product variants that I am missing?

Note: I verified that there is no general problem with the cart transform function by testing an update operation, which works as expected.

This looks good. It should work.

Would it be possible to share a screenshot of the following:

  1. Checkout: How the items looks in checkout after the function is called
  2. Function logs: Logs for the Shopify Function specifying the limits and output.

The response looks good and it should work as expected but since it’s not working. It would help if we have more information :slight_smile:

1 Like

Many thanks for your hint to review the items in checkout. The bundle is shown correctly there! I guess this means that the default cart display block of the Dawn theme simply doesn’t render the components of the bundle. I will look into this.