The majority of merchants sell virtual gift cards to their customers which require no shipment and can not be picked up or delivered. If you are in the same boat follow the steps below.
Easy option
- Open Store Pickup + Delivery and click Settings
- Click Developers
- If you want to hide the widget for a specific product you can add a comma separated list of product SKUs in the field shown below:
- Alternative if you prefer to disable the widget for all digital products click Hide widget when cart contains only digital items
- Click Save
Advanced option
- Within Shopify click Online Store
- Click Actions and then Edit code
- Open the cart.liquid file and locate the line <div id="storePickupApp"></div>
- Find and replace <div id="storePickupApp"></div>with the following code:
{% assign cart_contains_gift_card = false %}
{% assign cart_contains_physical_items = false %}
{% for item in cart.items %}
{% if item.product.handle contains "gift-card" %}
{% assign cart_contains_gift_card = true %}
{% else %}
{% assign cart_contains_physical_items = true %}
{% endif %}
{% endfor %}
{% if cart_contains_physical_items %}
<div id="storePickupApp"></div>
{% endif %} Click Save
Additional notes
Now when a customers shopping basket contains only a gift card the Store Pickup + Delivery widget won't be displayed. Your customers can proceed to the checkout process as normal.
If your customers basket contains both a gift card and another physical item the Store Pickup + Delivery widget will appear.