Skip to content

Instantly share code, notes, and snippets.

@stlk
Created June 6, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stlk/447b56f0435715199e4bcd70119cee98 to your computer and use it in GitHub Desktop.
Save stlk/447b56f0435715199e4bcd70119cee98 to your computer and use it in GitHub Desktop.
diff --git a/snippets/ajax-cart-template.liquid b/snippets/ajax-cart-template.liquid
index 7f820eb..d49ebee 100644
--- a/snippets/ajax-cart-template.liquid
+++ b/snippets/ajax-cart-template.liquid
@@ -26,14 +26,16 @@ Use the raw liquid tags to keep the handlebar.js template tags as available hook
</ul>
<div class="cart-bottom">
<div class="buttons-container">
- <a href="/cart" class="minicart-button">{% endraw %}{{ 'cart.general.view_cart' | t }}{% raw %}</a>
+ <a href="/cart" class="minicart-button" style="width: 100%;">{% endraw %}{{ 'cart.general.view_cart' | t }}{% raw %}</a>
{{#if gwaCheckout}}
{% endraw %}
<a class="minicart-button" href="{{ shop.url }}/{{ shop.metafields.gwa.app_proxy }}/check.out{% raw %}{{#if customer}}/{{ customer }}{{/if}}{% endraw %}">{{ 'cart.general.checkout' | t }}</a>
{% raw %}
{{else}}
{% endraw %}
+ {% comment %}
<a href="/checkout" class="minicart-button">{{ 'cart.general.checkout' | t }}</a>
+ {% endcomment %}
{% raw %}
{{/if}}
</div>
diff --git a/templates/cart.liquid b/templates/cart.liquid
index a971762..c2bed2a 100644
--- a/templates/cart.liquid
+++ b/templates/cart.liquid
@@ -398,7 +398,7 @@
</div>
{% endcomment %}
</div>
-
+ <div id="store-pickup-root"></div>
<p><em>{{ 'cart.general.shipping_at_checkout' | t }}</em></p>
<div class="grid cart-buttons">
<div class="grid__item one-half small--one-whole text-center">
@@ -485,6 +485,39 @@
var cart = {{ cart | json }};
</script>
+<script>
+ window.STORE_PICKUP_CONFIG = {
+ pointsUrl: 'https://zasilkovna-proxy-kitandkin.now.sh',
+ rootElementId: 'store-pickup-root',
+ checkoutBtnId: 'checkOutButton',
+ formId: 'cart-form',
+ moreInfo: 'Bližší informace o výdejním místě',
+ zasilkovnaSearchPlaceholder: 'Začněte zadáním Vašeho města',
+ placeNameInCompany: true, // Should place name be filled in company or last_name
+ pickupLocale: 'cs-PU',
+ baseLocale: 'cs',
+ shippingOptions: [
+ {
+ key: 'shipping',
+ name: 'Česká Pošta',
+ price: 'od 99 Kč',
+ },
+ {
+ key: 'zasilkovna',
+ name: 'Zásilkovna',
+ price: 'od 49 Kč',
+ },
+ ],
+ }
+</script>
+<script src="{{ 'store-pickup.js' | asset_url }}" defer="defer"></script>
+<style>
+ #store-pickup-root > div > div {
+ max-width: initial;
+ margin-bottom: 1rem;
+ }
+</style>
+
{% unless settings.shipping_calculator == 'Disabled' %}
<script>
theme.strings = {
@stlk
Copy link
Author

stlk commented Oct 13, 2022


<script>
  window.STORE_PICKUP_CONFIG = {
    pointsUrl: 'https://zasilkovna-proxy-kitandkin.now.sh',
    rootElementId: 'store-pickup-root',
    checkoutBtnId: 'checkOutButton',
    formId: 'cart-form',
    moreInfo: 'Bližší informace o výdejním místě',
    zasilkovnaSearchPlaceholder: 'Začněte zadáním Vašeho města',
    placeNameInCompany: true, // Should place name be filled in company or last_name
    pickupLocale: 'cs-PU',
    baseLocale: 'cs',
    shippingOptions: [
      {
        key: 'shipping',
        name: 'Geis',
        price: 'od 99 Kč',
      },
      {
        key: 'zasilkovna',
        name: 'Zásilkovna',
        price: 'od 55 Kč',
      },
    ],
  }
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment