Sanjeev Naroliya Posted June 11, 2014 Share Posted June 11, 2014 (edited) Hi All,I want to override"Add to Cart" button functionality. When a user click "Add to Cart" button it will check weather a user sign in or not, if user sign in it will show a Form which will emailed only, if a user is not sign in it will show sign in and registration form, so a user sign in or register.I read we can override prestashop core classes, what is the best method to do this? should i override core cart classes for this?Any help highly appreciated.Thanks Edited June 11, 2014 by Sanjeev Naroliya (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 11, 2014 Share Posted June 11, 2014 hello everything depends on what kind of "add to cart" method you use. it's an ajax cart? or default cart? Link to comment Share on other sites More sharing options...
Sanjeev Naroliya Posted June 11, 2014 Author Share Posted June 11, 2014 Hi there, Its a ajax cart button mainly. Link to comment Share on other sites More sharing options...
vekia Posted June 11, 2014 Share Posted June 11, 2014 okay so in this case you have to modify ajax-cart.js file a little you can put there some js script to check if customer is logged, or not then if it is - just pass the add function to the ajax query, if not, just break up function with return Link to comment Share on other sites More sharing options...
Sanjeev Naroliya Posted June 11, 2014 Author Share Posted June 11, 2014 is this not done with overrieding the cart core class? i think its handled by cart class "add" function? Link to comment Share on other sites More sharing options...
Recommended Posts