Customizing Add to Cart for custom stores

Add to Cart button for custom stores can be customized by following the below steps :

  1. Add the following script at the bottom of all the pages:
       function klevu_addtocart( id, url, qty ) {
          // your add to cart implementation goes here...
        // changing the label for add to cart button
        var klevu_addtocartLbl = "Add To Cart";
  2. Add your code for adding products to cart inside klevu_addtocart function.
  3. Change value of the klevu_addtocartLbl variable.
    • For displaying button with text (Default)
      var klevu_addtocartLbl = 'Add to cart';
    • For displaying image as button
      var klevu_addtocartLbl = '<img src="img/cart.png" />';