Install instructions

Step 1

Follow our Online store 2.0 article to enable the Store Pickup + Delivery widget, but don't publish the duplicate theme before implementing the rest of the steps.

Note

Please reach out to us at [email protected]—we’ll be happy to install the widget for you.

Only proceed if you are comfortable editing code yourself.

On the theme, click Actions > Edit code.


Step 2

  • This step will hide our ZapietID from the cart page and the drawer cart.

  • It appears twice in the file, so it needs to be implemented on both instances.

Open snippets/cart.liquid and search for the following:

{% unless property.last == blank %}

Replace the line above with the following line:

{% unless property.last == blank or property.first == "_ZapietId" %}

Step 3

  • This step will make sure the widget is consistent in both carts and on mobile.

Open snippets/cart.liquid and paste this code at the bottom of the file:

<script type="text/javascript" defer>
function updateWidget() {
// Get current app instance
var appDiv = document.querySelector("#storePickupApp");

// Get appropriate cart root, based on theme's css media query
var cartRoot;
var mediaQuery = window.matchMedia('(max-width: 767px)');
if (mediaQuery.matches) {
cartRoot = document.querySelector(".cart--root[data-view='mobile']");
} else {
cartRoot = document.querySelector(".cart--root[data-view='desktop']");
}

// Cart drawer does not have cart root,
// so check for cart footer directly in the document
var cartFooter;
if (cartRoot) {
cartFooter = cartRoot.querySelector(".cart--footer");
} else {
cartFooter = document.querySelector(".cart--footer");
}

// Move app div before cart footer
cartFooter.parentNode.insertBefore(appDiv, cartFooter);
}


document.addEventListener("DOMContentLoaded", function() {
updateWidget();

ZapietEvent.listen("widget_loaded", updateWidget);
});

window.addEventListener("resize", updateWidget);
</script>


The widget should appear on the cart page when you have added a product to the cart. It should look similar to the screenshot below.

  • In the regular cart

  • In the drawer cart

Did this answer your question?