Dynamic Pricing support for theme Turbo

Learn how to ensure Dynamic Pricing is enabled on your theme

Bart Coppens avatar
Written by Bart Coppens
Updated over a week ago

Required customizations

This theme requires minor modifications to enable Dynamic Pricing on the cart and drawer cart:

Cart

Not sure how to edit your theme? Read this article first.

Copy the following markup:

 data-cart-item data-cart-item-key="{{item.key}}"

Add the markup here:

Drawer cart

Not sure how to edit your theme? Read this article first.

Copy the following markup:

 data-cart-item data-cart-item-key="{{item.key}}"

Add the markup here:

On some versions of this theme the checkout button is not properly marked.

Check if the submit button to initiate the checkout is marked with:

name="checkout"

If this is not the case, add the attribute as follows:

Then copy this line:

cart_items_html += '<li class="cart_item" data-cart-item data-cart-item-key="' + item.key + '">' +

Replace the existing line here:

Then copy this line:

document.dispatchEvent(new CustomEvent('limoniapps:discountninja:drawercart:opened'));

And add it here:

Finally, copy this line:

document.addEventListener("limoniapps:discountninja:drawercart:refreshed", function (event) { var cart = event.detail.data[0]; refreshCart(cart); });

And add it here:

Then, open the limoniapps-discountninja-context-flags.liquid file and:

  • set ReloadPageAfterCartAdjustments to false

  • and change the DrawerCartRefreshMethod line to:

DrawerCartRefreshMethod: "discountNinja.Events.Publish('drawercart:refreshed', [discountNinjaContext.Cart])",

Embedded code approach

If you prefer the flexibility of the embedded code approach, please refer to the articles listed here.
Found a compatibility issue with this theme? Let us know at [email protected] and our team of experts will review it.

Did this answer your question?