Dynamic Pricing support for theme Debut

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 a minor modification to enable the featured product:

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

Add the following markup:

 data-limoniapps-discountninja-product-handle="{{ product.handle }}" 

Add the markup here:

Cart quantity update issue

Some versions of Debut include logic to automatically update the cart when the quantity is updated without reloading the page. Debut does this by rebuilding the cart HTML using JavaScript whenever the quantity is updated. While rebuilding the cart it uses the first line in the cart as a template. The JavaScript duplicates this line and makes the necessary changes to the template for each line. This logic is not compatible with how Discount Ninja works out-of-the-box.

To solve this, a line of code must be added:

$item.find('[data-limoniapps-discountninja-cart-key]').attr('data-limoniapps-discountninja-cart-key', item.key);		

Find the theme.js asset in your theme. Find the _createLineItemList method, and add the above line of code near the bottom (before the return statement):

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?