Custom Rebuy drawer cart
Note: this article assumes the user is using the custom Rebuy drawer cart. For more information on how to configure this, see https://developers.rebuyengine.com/reference/smart-cart-custom-template
Limitations
Discount Ninja does not provide support for a full integration with Rebuy's drawer cart. Specifically, the following is not supported:
The Rebuy shipping bar is not aware of the discounted cart total. This can be achieved programmatically (JavaScript knowledge required) using the Discount Ninja client side API.
Rebuy offers an upsell popup when the checkout button is clicked. This feature is not compatible with Discount Ninja.
Dynamic Pricing
Edit the code of your theme
Find the
rebuy-cart-template.liquidfileRoot
Add the class
limoniapps-discountninja-drawercart-rootto thedivwith classrebuy-cart__flyoutThis should look as follows:
<div class="rebuy-cart__flyout limoniapps-discountninja-drawercart-root">
Product / line price
Find the
divwith classrebuy-cart__flyout-item-priceand thelimoniapps-discountninja-cart-item-product-priceclass as well as the data attributev-bind:data-limoniapps-discountninja-cart-key="item.key".If you prefer to show the line price (i.e. product price x quantity), use the class
limoniapps-discountninja-cart-item-line-priceinstead.This should look as follows:
<div class="rebuy-cart__flyout-item-price limoniapps-discountninja-cart-item-product-price" v-bind:data-limoniapps-discountninja-cart-key="item.key">
Cart text
Find the
divwith classrebuy-cart__flyout-item-variant-title.Below it, add the line
<div class="limoniapps-discountninja-cart-item-product-comment" v-bind:data-limoniapps-discountninja-cart-key="item.key"></div>
Subtotal
Find the
divwith classrebuy-cart__flyout-subtotal-amountand add the classlimoniapps-discountninja-cart-subtotal-priceOptionally, add the class
limoniapps-discountninja-cart-subtotalto thedivwith classrebuy-cart__flyout-subtotal. This is recommended if you plan to use the promotion summary.Optionally, add the promotion summary placeholder using
<div class="limoniapps-discountninja-cart-promotionsummary"></div>This should look as follows:
<div class="rebuy-cart__flyout-subtotal">
<div class="rebuy-cart__flyout-subtotal-label">
<span v-html="subtotalLabel()"></span>
</div>
<div class="rebuy-cart__flyout-subtotal-amount limoniapps-discountninja-cart-subtotal-price" v-html="subtotal()"></div>
</div>
<div class="limoniapps-discountninja-cart-promotionsummary"></div>Terms and conditions
Find the
inputwith classesrebuy-cart__flyout-terms-checkbox rebuy-checkboxand add the classlimoniapps-discountninja-checkout-checkbox.This should look as follows:
<input class="rebuy-cart__flyout-terms-checkbox rebuy-checkbox limoniapps-discountninja-checkout-checkbox" id="rebuy-terms-checkbox" name="rebuy-terms-checkbox" type="checkbox" v-model="termsAccepted" v-on:click="updateTermsCheck()" />
Promotion code field
Find the
divwith classrebuy-cart__flyout-discount-container. On the line above it add:<div class="limoniapps-discountninja-cartdiscountfield-placeholder"></div>
