Skip to main content
All CollectionsTroubleshooting
Customers bypassing the widget before it's loaded [poor bandwidth]
Customers bypassing the widget before it's loaded [poor bandwidth]
Jelizaveta avatar
Written by Jelizaveta
Updated over 3 months ago

If you live in a region with poor bandwidth, your customers may have issues checking out before our widget has fully loaded and then skip adding relevant date and time details. In this case, you can disable the checkout button until the widget has loaded.


Lock the checkout button

  1. In theme library, select the theme and click Edit code.

  2. Open the theme.liquid file.

  3. Search for </body> and prepend it with the code below.

    <!-- Zapiet | Disable checkout button -->
    {% assign disable_checkout = false %}
    {% for item in cart.items %}
    {% if item.requires_shipping %}
    {% assign disable_checkout = true %}
    {% endif %}
    {% endfor %}
    {% if disable_checkout == true %}
    <style id="zapiet-style-disable-checkout-button">
    [name="checkout"] {
    opacity: 0.5;
    pointer-events: none;
    }
    </style>
    {% endif %}
    <!-- End of Zapiet code -->

  4. Click Save.

  5. In Zapiet - Pickup + Delivery, click Settings, then Developers.

  6. Paste the code below into Custom scripts.

    var styleTag = document.querySelector("#zapiet-style-disable-checkout-button");

    if (styleTag) {
    styleTag.remove();
    }

  7. Click Save.

The checkout button will now be disabled until the Zapiet - Pickup + Delivery widget has loaded for all physical products. If you have digital products that use the widget, please use the code added in the troubleshooting section.

If you uninstall Zapiet - Pickup + Delivery or disable the widget, the checkout button will remain locked. Please remove the code from theme.liquid first.


Troubleshooting

  • You may need to modify the code to correctly target the checkout button—if you are not comfortable editing code, please contact our team on chat and we would be happy to help!

  • If you have digital products that use the widget, you can replace the code added in theme.liquid with this:

    <!-- Zapiet | Disable checkout button -->
    <style id="zapiet-style-disable-checkout-button">
    [name="checkout"] {
    opacity: 0.5;
    pointer-events: none;
    }
    </style>
    <!-- End of Zapiet code -->
Did this answer your question?