Skip to content

Instantly share code, notes, and snippets.

@boldsupport
boldsupport / zapiet-recurring-orders.js
Created February 28, 2018 06:42
Snippet used to integrate Zapiet with Recurring Orders (include before the closing body)
window.ZapietRO = {};
ZapietRO.CartIntegration = function() {
this.init();
}
ZapietRO.CartIntegration.prototype.init = function() {
this.addListeners();
}
ZapietRO.CartIntegration.prototype.addListeners = function() {
<script type="application/javascript">
if (typeof BOLD === 'undefined') {
BOLD = {};
}
BOLD.checkout = {
getCookie: function getCookie(name) {
var value = '; ' + document.cookie;
var parts = value.split('; ' + name + '=');
if (parts.length === 2) {
return parts.pop().split(';').shift();
/*
------------------------------------ WARNING ------------------------------------
This file will be overwritten and should not be edited directly.
In order to edit custom CSS for Bold Product Options you should:
- Log into your Shopify Admin Panel
- Go to Apps --> Installed --> Product Options
- Go to Display Settings
------------------------------------ WARNING ------------------------------------
bold-options.css version 6
*/
/*
------------------------------------ WARNING ------------------------------------
This file will be overwritten and should not be edited directly.
In order to edit custom CSS for Bold Product Upsell you should:
- Log into your Shopify Admin Panel
- Go to Apps --> Installed --> Product Upsell
- Go to Display Settings
------------------------------------ WARNING ------------------------------------
*/
.bold-modal {
{% comment %}
These script tags are DOM templates used by the Multi Currency javascript and should not be modified
{% endcomment %}
<script type="text/template" id="bold-currency-picker-template">
<div class="BOLD-mc-picker multi">
<div class="currentCurrency loading" data-current-currency>
<span class="flag flag-loading" data-flag></span>
<span class="name" data-name>&bull;&bull;&bull;</span>
<span class="chevron">
<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M13.148 10.398l-1.297 1.289q-0.148 0.148-0.352 0.148t-0.352-0.148l-4.148-4.148-4.148 4.148q-0.148 0.148-0.352 0.148t-0.352-0.148l-1.297-1.289q-0.148-0.148-0.148-0.355t0.148-0.355l5.797-5.789q0.148-0.148 0.352-0.148t0.352 0.148l5.797 5.789q0.148 0.148 0.148 0.355t-0.148 0.355z" /></svg>
{% comment %}
BOLD Multi-Currency Picker
This is the "mount point" for Bold Multi-Currency pickers.
Include this wherever you want them to appear within your theme (can appear in multiple locations)
Optional "parameters" you can pass to the include:
openDirection: 'up|down' (defaults to "up")
- Use this to tell the picker to open "upwards" or "downwards" depending on its location in your template.
.BOLD-mc-picker-mnt {
position: relative;
display: inline-block; }
.BOLD-mc-picker-mnt.injected {
position: fixed;
overflow: visible;
z-index: 99999; }
.BOLD-mc-picker-mnt[data-picker-location="bottom-middle"] {
if (typeof BOLDCURRENCY !== 'undefined' && BOLDCURRENCY.converter && typeof BOLD_mc_bootstrapSettings !== 'undefined') {
BOLD_mc_bootstrap(BOLD_mc_bootstrapSettings);
}
function BOLD_mc_bootstrap(options) {
// inject CSS assets into the head of the document
injectCssAssets([
makeCssLink(options.flagsAssetUrl),
makeCssLink(options.pickerCssAssetUrl)
// BOLD: POv2 checkout fix
// test
if (typeof(Storage) !== "undefined") {
if(!sessionStorage._bold_history) {
sessionStorage.setItem('_bold_history', document.URL);
} else {
var bold_history = sessionStorage._bold_history.split(',');
bold_history.push(document.URL);
sessionStorage.setItem('_bold_history', bold_history);
}
!function(t){function e(r){if(n[r])return n[r].exports;var s=n[r]={exports:{},id:r,loaded:!1};return t[r].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var s=n(2),o=r(s);window.BOLD=window.BOLD||{},window.BOLD.common=window.BOLD.common||{},window.BOLD.common.eventEmitter=window.BOLD.common.eventEmitter||new o.default},function(t,e,n){"use strict";function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(){}var o=Object.prototype.hasOwnProperty,i="function"!=typeof Object.create&&"~";s.prototype._events=void 0,s.prototype.eventNames=function(){var t,e=this._events,n=[];if(!e)return n;for(t in e)o.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(t,e){var n=i?i+t:t,r=this._events&&this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];f