metatroncubeswdev aacd9a8e06 fix: plan location limit counts switched-on locations; widget empty state
- storefront applied maxLocations to the first locations by priority, even switched-off
  ones, so a Starter shop whose enabled location wasn't first got no methods
- switching on a location beyond the plan limit now explains why instead of being ignored
- widget shows a message (en/fr) when no method is available and clears aria-busy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 05:26:03 -04:00

58 lines
2.1 KiB
Plaintext

{%- comment -%}
App embed: loads the widget on every page so it can (1) appear inside the cart drawer,
(2) adopt waitlist offers from links, and (3) stop checkout clicks when a time is required.
{%- endcomment -%}
<script type="application/json" data-datewise-config>
{
"drawerSelector": {{ block.settings.drawer_selector | json }},
"checkoutGuard": {{ block.settings.checkout_guard | json }},
"locale": {{ request.locale.iso_code | json }},
"currency": {{ cart.currency.iso_code | json }},
"text": {
"choose": {{ 'datewise.choose' | t | json }},
"needTime": {{ 'datewise.need_time' | t | json }},
"held": {{ 'datewise.held' | t | json }},
"expired": {{ 'datewise.expired' | t | json }},
"left": {{ 'datewise.left' | t | json }},
"full": {{ 'datewise.full' | t | json }},
"postal": {{ 'datewise.postal' | t | json }},
"check": {{ 'datewise.check' | t | json }},
"waitlist": {{ 'datewise.waitlist' | t | json }},
"joined": {{ 'datewise.joined' | t | json }},
"dispatch": {{ 'datewise.dispatch' | t | json }},
"change": {{ 'datewise.change' | t | json }},
"prep": {{ 'datewise.prep' | t | json }},
"free": {{ 'datewise.free' | t | json }},
"fee": {{ 'datewise.fee' | t | json }},
"none": {{ 'datewise.none' | t | json }},
"nextAvailable": {{ 'datewise.next_available' | t | json }},
"offer": {{ 'datewise.offer' | t | json }},
"error": {{ 'datewise.error' | t | json }}
}
}
</script>
{% schema %}
{
"name": "Datewise",
"target": "body",
"javascript": "datewise.js",
"stylesheet": "datewise.css",
"settings": [
{
"type": "checkbox",
"id": "checkout_guard",
"label": "Ask for a time before checkout",
"default": true,
"info": "Stops the checkout button until a time is chosen, when your Datewise settings require one."
},
{
"type": "text",
"id": "drawer_selector",
"label": "Cart drawer selector (advanced)",
"info": "Only if the widget doesn't appear in your cart drawer. CSS selector for the drawer's footer."
}
]
}
{% endschema %}