This content contains older information from our previous Javascript library. Please visit the link if you have implemented Klevu with the latest template JS.
Add to Cart button for other platforms can be customized by following the below steps :
- 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>
- Add your code for adding products to cart inside klevu_addtocart function.
- 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"/>';
- For displaying button with text (Default)