π Here is the guide for Discount Ninja Integration with Boost AI Search & Discovery app.
About Discount Ninja
App Information
Discount Ninja create special offers based on smart rules and trigger offers automatically.
App details: https://apps.shopify.com/discount-url
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:
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:
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!
β
Feel free to reach out to our dedicated support team via chat if you have any questions or require additional assistance.