Updated on June 14, 2021
Notice: this is an Advanced tutorial that requires knowledge of HTML, Liquid, and JavaScript.
Alpaca lets you display custom messaging to your users when their cart contents or location is ineligible for pickup or delivery. In your theme liquid files, you will have access to the following liquid variables:
cart.attributes["alpaca_cart_eligible_pickup"]
cart.attributes["alpaca_cart_eligible_delivery"]
cart.attributes["alpaca_location_eligible_pickup"]
cart.attributes["alpaca_location_eligible_delivery"]
For example, this is how you can determine if a customer’s location is ineligible for delivery:
{% if cart.attributes["alpaca_location_eligible_delivery"] == "false" %}
... location is ineligible for delivery ...
{% endif %}
When a customer changes their cart contents and/or location, Alpaca will fire JS events that you can listen to from your theme. This will let you update any elements on the page that need to be shown or hidden as the cart or location eligiblity changes. Here’s an example:
document.addEventListener('alpaca:cart_eligibility_changed', function(event) {
var cartIsEligibleForPickup = event.alpaca_cart_eligible_pickup;
var cartIsEligibleForDelivery = event.alpaca_cart_eligible_delivery;
}, false);
And:
document.addEventListener('alpaca:location_eligibility_changed', function(event) {
var locationIsEligibleForPickup = event.alpaca_location_eligible_pickup;
var locationIsEligibleForDelivery = event.alpaca_location_eligible_delivery;
}, false);
When those events fire, you can use the values in the above variables to determine whether or not to hide or show elements on your page.
Only show the pickup or delivery rate the customer already selected
Updated on December 11, 2021
Let your customers know which locations have items in stock
Updated on September 30, 2021
Notify locations when they receive orders
Updated on May 18, 2021
Specify how much time you need to prepare for pickup and delivery orders.
Updated on April 8, 2021
How to get a Google Maps API key so you can enable address autocomplete
Updated on April 8, 2021
Don't let customers schedule a pickup or delivery until the order is marked as packed
Updated on April 8, 2021
Prompt customers to remove out-of-stock inventory when they try to check out
Updated on April 6, 2021
Add Alpaca rates to your Shopify shipping profiles
Updated on April 6, 2021
Control where Alpaca appears on your theme
Updated on March 26, 2021
How to completely remove Alpaca from your online store
Updated on March 24, 2021
How to display pickup information in your email and SMS notifications
Updated on March 23, 2021
Manually change an order's delivery method and/or scheduled date and time
Updated on March 22, 2021
Don't let your customers reschedule their pickup/delivery date and time
Updated on March 17, 2021
How Alpaca adds pickup and delivery rates to your checkout
Updated on March 17, 2021
Prompt customers to remove items which aren't eligible for their selected delivery method.
Updated on March 16, 2021
How to hide the shipping delivery method in Alpaca's theme integration
Updated on March 6, 2021
Ensure your customers pick a time before completing their checkout
Updated on March 5, 2021
Why shipping rates and delivery methods may not appear on your website
Updated on March 5, 2021
Generate optimized delivery routes for your Shopify orders
Updated on March 5, 2021
Great for handling pre-orders and seasonal products
Updated on March 4, 2021
How to hide _alpaca_id attributes from appearing
Updated on December 9, 2020
How to add dynamic content to your notifications
Updated on October 13, 2020
How to restrict local delivery rates to specific zip or postal codes
Updated on August 25, 2020
Set when you offer pickup and other options regarding curbside pickup
Updated on June 2, 2020
Manage the prices and options for local delivery
Updated on June 2, 2020
How to modify the fonts and colors of the pickup CTA
Updated on June 2, 2020
How to display a pickup CTA on your storefront
Updated on June 2, 2020
Send us an email and we'll get back to you as soon as we can.