hanny137 Posted April 7, 2016 Share Posted April 7, 2016 (edited) When I click 'Add To Cart', where is that controlled? I need to change some of the information being passed back via ajax - but cannot find where to edit in order to make that adjustment. I want to adjust the product customization text field (add something to it); do I do that in CartController? It looks like the request is AJAX - so is there a JS file where I would be better suited to adjust it? Edited April 7, 2016 by hanny137 (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted April 8, 2016 Share Posted April 8, 2016 Please check following file /controllers/front/CartController.php The add/delete/update products is in following controller method, Even the ajax call is posted to this public function postProcess() { // Update the cart ONLY if $this->cookies are available, in order to avoid ghost carts created by bots if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid())) { if (Tools::getIsset('add') || Tools::getIsset('update')) { $this->processChangeProductInCart(); } elseif (Tools::getIsset('delete')) { $this->processDeleteProductInCart(); } elseif (Tools::getIsset('changeAddressDelivery')) { ................... Link to comment Share on other sites More sharing options...
hanny137 Posted April 8, 2016 Author Share Posted April 8, 2016 Thank you for that! Where does the ajax call originate from? Link to comment Share on other sites More sharing options...
shokinro Posted April 9, 2016 Share Posted April 9, 2016 I think the ajax call is from module blockcart. The "Add to cart" button click is override from that module, and when user click "Add to cart" button, it will make an ajax call. You can look into following file /modules/blockcart/ajax-cart.js Above is for default theme, different theme may also change the behaviour a little bit. Link to comment Share on other sites More sharing options...
hanny137 Posted April 11, 2016 Author Share Posted April 11, 2016 Thanks! That's exactly what I was looking for! Link to comment Share on other sites More sharing options...
shokinro Posted April 11, 2016 Share Posted April 11, 2016 I am Glad it helped and thanks for feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now