acateon Posted April 24, 2013 Share Posted April 24, 2013 Has anyone attempted this, or perhaps already made a module? Exactly what I'm looking for is the possibility to add products to compare on the comparison page, not on the category pages themselves. Hopefully by some kind of ajax search... If someone is willing to develop this, let me know, I'm willing to pay to get this function. Link to comment Share on other sites More sharing options...
reznimic Posted May 7, 2013 Share Posted May 7, 2013 (edited) Just small hint compareController.php, add public function initContent() { parent::initContent(); if (isset($_GET['action'])) { if ($_GET['action'] == 'remove') { CompareProduct::removeCompareProduct((int)$this->context->cookie->id_compare, (int)Tools::getValue('id_product')); } if ($_GET['action'] == 'add') { $id_compare = isset($this->context->cookie->id_compare) ? $this->context->cookie->id_compare : false; if (CompareProduct::getNumberProducts($id_compare) < Configuration::get('PS_COMPARATOR_MAX_ITEM')) CompareProduct::addCompareProduct($id_compare, (int)Tools::getValue('id_product')); else die('0'); } } ...... ... ...... .... Then you can create form with input and send it to index.php?controller=products-comparison&action=add&id_product=171 with id product. Edited May 7, 2013 by reznimic (see edit history) Link to comment Share on other sites More sharing options...
acateon Posted May 13, 2013 Author Share Posted May 13, 2013 Really awesome advice, thanks! Only problem is that it wreaks the funktion of the compare controller. I'm using 1.4.10, do you know if your code should work on that version? Could it be that it should use a preProcess instead of initContent? Link to comment Share on other sites More sharing options...
reznimic Posted May 13, 2013 Share Posted May 13, 2013 ou, sorry, I am using 1.5+, so maybe it is not possible for 1.4, no idea 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