Zid-api Library

Zid-themes library available as an asset file which has zid.store global object that can be accessed in any javascrip file or script tag. It provides multiple functions to make REST API calls, such as adding a product to cart, remove, update, fetch the customer address, and many other helper functions. To use it, add zidapi_script variable in the bottom of the body tag as follow (line 9):

<body>

    <div class="app">
        {% block header %}{% endblock %}
        {% block main_content %}{% endblock %}
        {% block footer %}{% endblock %}
    </div>

    {{ zidapi_script|raw }} // initialize Zid Library
    
    <script type="text/javascript" src="{{ asset_url ~ 'main.js' }}"></script>
</body>

zidapi_script resources:

Last updated

Was this helpful?