Hide Local Pickup in checkout based on cart attribute

Hi everyone,

I’m working on customizing the checkout experience in Shopify and need some clarification regarding conditional delivery options.

I want to show or hide the default “Pickup” (Local Pickup) option in checkout based on a cart attribute.

Flow implemented:

  • On the cart page, the customer selects:

    • “Delivery” OR

    • “Pickup”

  • Based on selection, I’m saving a cart attribute like:

    cart.attributes.delivery_type = "pickup"
    

    or

    cart.attributes.delivery_type = "standard-delivery"
    

Expected Behavior:

  • If delivery_type = standard-delivery → Only show Shipping, hide Pickup

  • If delivery_type = pickup → Show Pickup option

Current Behavior:

Any guidance or confirmation would be really helpful.

Thanks in advance!

Hi @Masumi_Upadhyay,

You should be able to do this with Shopify Functions, specifically the Delivery Customization Function, which allows you to rename, reorder, and hide delivery methods at checkout based on custom logic of your design.

In this case the function input can read the cart in the checkout, and you can use the attributes from the cart to determine what available delivery methods are hidden at checkout, with the deliveryOptionHide function operation.

Okay @Kellan-Shopify , Let me check.

HI @Kellan-Shopify - the delivery customization function API allows us to hide/rename delivery options, but not the method itself.

I’m also looking for a way to hide the actual methods, ‘Ship’ or ‘Pickup’ within a function.

Screenshot 2026-10-29 at 11.09.17

Using : Delivery Customization Functionand 

deliveryType is an alias for the cart attribute.
 query Input {
cart {
deliveryType: attribute(key: "delivery_type") {
value
}
deliveryGroups {
deliveryOptions {
handle
deliveryMethodType
}
}
}
}


export function run(input) {
  if (input.cart.deliveryType?.value !== "pickup") {
    return { operations: [] };
  }

  const operations = input.cart.deliveryGroups.flatMap((group) =>
    group.deliveryOptions
      .filter((option) => option.deliveryMethodType === "SHIPPING")
      .map((option) => ({
        deliveryOptionHide: {
          deliveryOptionHandle: option.handle,
        },
      }))
  );

  return { operations };
}