How can I adjust the item sequence on an app checkout page?

ChangWinehub
Shopify Partner
1 0 0

Hi, all.

I'm currently developing a Shopify app. We need to add things like a combo (including some items, but it's an item as well) into the cart and then show these in the checkout item list on the checkout page.


When it redirects to the checkout page, the combo itself always appears as the last item in that page.


So far, I've tried the following approaches:

  1. one step: create cart with 1 items array (push the combo first and then the items included)
  2. one step: create cart with items array (push the items included first and then the combo itself)
  3. two steps: create cart with the combo using cartCreate (https://shopify.dev/docs/api/storefront/2023-10/mutations/cartCreate), then add (https://shopify.dev/docs/api/storefront/2023-10/mutations/cartLinesAdd) the items included into the same cart
  4. two steps: create cart with the items included, then add the combo itself to the same cart (using the same query as point 3)

All these approaches can add all the items into the checkout item list, but all these put the combo itself at the end of the checkout item list (but we want the combo to be the first one). So it seems the sequence that the items are added does not make any difference to the item sequence in the checkout item list.

Just wondering if the Shopify checkout page has any auto-sort operation (I've tried to find info about this but couldn't)? What should I do if I wanna change the sequence to what I want in the checkout item list?

Reply 1 (1)

Soba
Shopify Partner
1 0 0

Have you solved this? I'm trying to figure out ways to sort items in checkout as well.