Open navigation

Customizing Add to Cart for custom stores

If you using Klevu theme, please use this documentation.

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:
    <script>
       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";
    </script>
  2. Add your code for adding products to cart inside klevu_addtocart  function.
  3. Change value of the klevu_addtocartLblvariable.
    • 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"/>';

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.