Customizing Add to Cart Button

  1. Open vendor/klevu/module-addtocart/view/frontend/templates/klevu/addtocart/index.phtml file
  2. Search for the following function :
    
     <script type="text/javascript">
    
     function klevu_addtocart(id,url,qty) {
     .....
     .....
     .....
     .....
     }
     </script>
     
  3. Declare the following javascript variablevar klevu_addtocartLbl = "More Info";
    After declaration, it should look like

     <script type="text/javascript">
    
     var klevu_addtocartLbl = "More Info";
    
     function klevu_addtocart(id,url,qty) {
     ....
     ....
     ....
     }
    
     </script>
  4. Change value of klevu_addtocartLbl variable
    For displaying button with text (Default)

     klevu_addtocartLbl = 'Add to cart';

    For displaying image as button

     klevu_addtocartLbl = '<img src="img/cart.png" />';