SkyHiRider Posted November 10, 2013 Share Posted November 10, 2013 (edited) I'm using Prestashop 1.4 and I really need to be able to search for products by using more then one tag.I'd like to be able for this url /search?tag=colop&tag=circle to work and show all the products that are tagged by colop and circle. Currently it only takes the last tag into account - I've actually found the code that I probably need to change in controllers/SearchController.php : elseif ($tag = urldecode(Tools::getValue('tag')) AND !is_array($tag)) { $nbProducts = (int)(Search::searchTag((int)(self::$cookie->id_lang), $tag, true)); $this->pagination($nbProducts); $result = Search::searchTag((int)(self::$cookie->id_lang), $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay); Module::hookExec('search', array('expr' => $tag, 'total' => sizeof($result))); self::$smarty->assign(array( 'search_tag' => $tag, 'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module 'search_products' => $result, 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home'))); } How must I modify the code for Prestashop to accept multiple tags? Did I even find the right code? Edited November 10, 2013 by SkyHiRider (see edit history) Link to comment Share on other sites More sharing options...
m4rk087 Posted December 19, 2013 Share Posted December 19, 2013 Hello, i have the same problem with multiple tags, did you solved your problem? TNX Link to comment Share on other sites More sharing options...
SkyHiRider Posted December 19, 2013 Author Share Posted December 19, 2013 (edited) No, I did not solve it. But Smarty can check for tags, perhaps that's the way to solve the problem. {$product->tags[6]|@var_dump} {debug} {if in_array("TAGNAME",$product->tags[6])} Edited December 19, 2013 by SkyHiRider (see edit history) Link to comment Share on other sites More sharing options...
saidecors Posted September 16, 2014 Share Posted September 16, 2014 hi! previously if i search something in my site the url was generated,saved and even indexed by google... something like http://modularkitchen.saidecorschennai.in/search?tag=White+colour+modular+kitchen+pho but now its not at all generating ... may i know why? Thanks in advance 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