Integrating Zakeke with other apps

Zakeke can be integrated with these apps by following these steps:

Order Limits (MinMaxify)

Since this app rely on parameters like the product type or product handle to apply its rules, you must set Zakeke to do not create new product by changing the Zakeke behaveur on the add to cart. No other changes are required.

Bold Product Options

 You must set Zakeke to do not create new product by changing the Zakeke behaveur on the add to cart  without also doing the changes needed to the cart regarding the price and cart item properties. In order to force the validation of the add to cart form, you must place this liquid code inside your theme's add to cart form:

{% unless product.content contains 'zakeke-design-tag' %}
    {% if product.tags contains 'zakeke-product' or product.content contains 'zakeke-product-tag' %}
    <button id="zakeke-product-button" class="button button--large">
    <span>Start Designing</span>
    </button>
    <input name="zakeke-product-id" type="hidden" value="{{ product.id }}">
<script>
    (function () {
    function findAncestor (el, sel) {
        while ((el = el.parentElement) && !((el.matches || el.matchesSelector).call(el,sel)));
        return el;
    }

    var btn = document.querySelector('#zakeke-product-button');
    btn.addEventListener('click', function (event) {
        event.preventDefault();
        event.stopImmediatePropagation();
        var form = findAncestor(btn, 'form');
        if (!form || !form.reportValidity()) {
        return;
        }
        var pid = form.querySelector('input[name="zakeke-product-id"]').value;

        var originalAction = form.action;
        form.action = (window.zakekeUrl || '/apps/zakeke') + '?pid=' + pid;

        window.onpageshow = function(event) {
            if (event.persisted) {
                form.action = originalAction;
            }
        };
        
        if (form.querySelector('.bold_clone')) {
            form.querySelector('.bold_clone').click();
        } else {
            form.submit();
        }
    });
    })();
    </script>
{% endif %} {% endunless %}
Was this article helpful?
0 out of 0 found this helpful