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.