Discount Ninja Integration Guide

📖 Here is the guide for Discount Ninja Integration with Boost AI Search & Discovery app.

About Discount Ninja

1
App Information

2
Discount Ninja Integration function

  • Customers filter product list and get inherited by the updated price base on the discount policy of the app.

How to integrate Discount Ninja with Boost AI Search & Discovery

This feature only works with Boost AI Search & Discovery V2

1

From your Shopify admin, go to Online Store > Themes.

2

Find the theme you'd like to integrate the app and click Actions (⋯) > Edit code

3
In Asset folder, search for this file boost-pfs-filter.js. Then locate this line of code

productGridItemHtml

4
Copy and paste this code snippet into the function where you'd like it to be:

// For boost-pfs-filter-html.liquid<div class="product-item--price" data-limoniapps-discounturl-product-handle="[[itemHandle]]" data-limoniapps-discounturl-product-price="[[itemPriceMin]]" data-limoniapps-discounturl-product-compareatprice="[[itemCompareAtPriceMax]]"> <span class="limoniapps-discount-url-productprice"> [[itemPrice]] </span></div>

For example, under the product title:
Discount Ninja Integrate

If the variable <strong>productGridItemHtml</strong> does not exist in <strong>boost-pfs-filter.js</strong> , please find it in the file <strong>boost-pfs-filter-html.liquid</strong> and paste this code snippet instead:

Discount Ninja code

5
In boost-pfs-filter.js file, locate this line of code:

ProductGridItem.prototype.compileTemplate

6
Within the function ProductGridItem.prototype.compileTemplate, scroll down to locate this comment line:

// Add main attribute

7
Copy and paste this code snippet above the comment line:

var comparePrice = data.compare_at_price_max || 0;itemHtml = itemHtml.replace(/{{itemCompareAtPriceMax}}/g, comparePrice);itemHtml = itemHtml.replace(/{{itemHandle}}/g, data.handle);itemHtml = itemHtml.replace(/{{itemPriceMin}}/g, data.price_min);

8
Continue to locate this line of code:

Filter.prototype.afterRender

9
Copy and paste this code snippet into the function Filter.prototype.afterRender

if (typeof discountNinja != 'undefined' ) { discountNinja.DynamicPricing.UpdatePrice();}

10
Click Save and you're set!

If you encounter any issues during the integration process, please don't hesitate to contact our support team for further assistance at support@boostcommerce.net.