jadeitelibraswallow Posted May 8, 2014 Share Posted May 8, 2014 (edited) Hi guys, I've been messing around with version 1.6 in multistore mode quite a lot since beta and I must say I really do love it (eventhough it can sometimes get a bit confusing). Filter module is one of the most crucial features I was looking forward to. BUT it does NOT work properly in multistore mode. When it creates index for one store, it deletes everything for other stores. I almost wanted to cry when I noticed that... Has anyone manage to find a workaround for this? Thank you for any response! Edited January 11, 2022 by jadeitelibraswallow (see edit history) 2 Link to comment Share on other sites More sharing options...
jadeitelibraswallow Posted May 8, 2014 Author Share Posted May 8, 2014 Okay I have found a quick workaround for this issue. Edit file modules/blocklayered/blocklayered.php Go to the line 881 and replace Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'layered_product_attribute` (`id_attribute`, `id_product`, `id_attribute_group`, `id_shop`) SELECT pac.id_attribute, pa.id_product, ag.id_attribute_group, product_attribute_shop.`id_shop` FROM '._DB_PREFIX_.'product_attribute pa'. Shop::addSqlAssociation('product_attribute', 'pa').' INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pac.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute = pac.id_attribute) INNER JOIN '._DB_PREFIX_.'attribute_group ag ON ag.id_attribute_group = a.id_attribute_group '.(is_null($id_product) ? '' : 'AND pa.id_product = '.(int)$id_product).' GROUP BY a.id_attribute, pa.id_product , product_attribute_shop.`id_shop`' ); with Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'layered_product_attribute` (`id_attribute`, `id_product`, `id_attribute_group`, `id_shop`) SELECT pac.id_attribute, pa.id_product, ag.id_attribute_group, pas.id_shop FROM '._DB_PREFIX_.'product_attribute pa INNER JOIN '._DB_PREFIX_.'product_attribute_shop pas ON pas.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pac.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute = pac.id_attribute) INNER JOIN '._DB_PREFIX_.'attribute_group ag ON ag.id_attribute_group = a.id_attribute_group '.(is_null($id_product) ? '' : 'AND pa.id_product = '.(int)$id_product).' GROUP BY a.id_attribute, pa.id_product, pas.id_shop' ); I'll try to send a pull request to developers because I don't like "hardcoding" like this Hope it helps other people who are struggling with the same issue. 3 Link to comment Share on other sites More sharing options...
jldeltoro Posted June 17, 2014 Share Posted June 17, 2014 Thank you Samir for your help. We have replaced the code by yours and blocklayered still not working in our second store (in the first go fine with original blocklayered and with yours solution). We are working with prestashop 1.6.0.6 and blocklayered 1.11. I'm thinking that our versions are more recents, may be? We have tried many possibilities rebuilding the indexes and changing the templates, but no way to make it work. Thanks for any help. Link to comment Share on other sites More sharing options...
jadeitelibraswallow Posted August 22, 2014 Author Share Posted August 22, 2014 (edited) Thank you Samir for your help. We have replaced the code by yours and blocklayered still not working in our second store (in the first go fine with original blocklayered and with yours solution). We are working with prestashop 1.6.0.6 and blocklayered 1.11. I'm thinking that our versions are more recents, may be? We have tried many possibilities rebuilding the indexes and changing the templates, but no way to make it work. Thanks for any help. I have Prestashop 1.6.0.9 (so the most recent at this time) but blocklayered module is in version 2.0.1 (according to the config.xml file in the module's folder). This combination works. So try to update your module and keep me updated Edited August 22, 2014 by samiramisek (see edit history) Link to comment Share on other sites More sharing options...
shaun_imakr Posted September 15, 2014 Share Posted September 15, 2014 I'm on Prestashop 1.6.0.9 and Layered Block Naviation v2.0.3 and this doesn't work for me Link to comment Share on other sites More sharing options...
Richard S Posted September 18, 2014 Share Posted September 18, 2014 (edited) c'mon really PrestaShop guys? half of the year, solution in the forum and the bug is not fixed?I am confirming the bug and that this solution solves it. Registered: http://forge.prestashop.com/browse/PSCSX-3398 Edited September 18, 2014 by Richard S (see edit history) 1 Link to comment Share on other sites More sharing options...
jadeitelibraswallow Posted September 19, 2014 Author Share Posted September 19, 2014 c'mon really PrestaShop guys? half of the year, solution in the forum and the bug is not fixed? I am confirming the bug and that this solution solves it. Registered: http://forge.prestashop.com/browse/PSCSX-3398 That would be great because I do not want to manually replace it each time I do upgrade. Link to comment Share on other sites More sharing options...
w3bsolutions Posted October 7, 2014 Share Posted October 7, 2014 Works for me too on PS 1.6.0.9 with module version 2.0. Thanks! Link to comment Share on other sites More sharing options...
Richard S Posted October 8, 2014 Share Posted October 8, 2014 Which exactly version of 2.0.x? Link to comment Share on other sites More sharing options...
BZZYBI Posted October 17, 2014 Share Posted October 17, 2014 I am using the latest version PS 1.6.0.9 with module version 2.0. and it partly worked for me. I said partly worked because i have 3 stores and it only worked for 2 of my stores. Any Idea why? Thank you for the solution samiramisek. Kindest Regards Gordon Link to comment Share on other sites More sharing options...
BZZYBI Posted October 17, 2014 Share Posted October 17, 2014 I am using the latest version PS 1.6.0.9 with module version 2.0. and it partly worked for me. I said partly worked because i have 3 stores and it only worked for 2 of my stores. Any Idea why? Thank you for the solution samiramisek. Kindest Regards Gordon I finally got my Layered Block Navigation to work with my 3 store. I think Being my 3rd store uses a different default currency from the other 2 stores, I removed the price Product Price Filter, saved the template and it worked. Strange but it worked :-) .. Finally I can move to the next step before going live. Thanks for all your help guys.. Especially samiramisek. :-) Link to comment Share on other sites More sharing options...
virgawhiskeygravity Posted October 17, 2014 Share Posted October 17, 2014 I finally got my Layered Block Navigation to work with my 3 store. I think Being my 3rd store uses a different default currency from the other 2 stores, I removed the price Product Price Filter, saved the template and it worked. Strange but it worked :-) .. Finally I can move to the next step before going live. Thanks for all your help guys.. Especially samiramisek. :-) Glad you figured it out! Link to comment Share on other sites More sharing options...
ldon Posted October 19, 2014 Share Posted October 19, 2014 Hello all, I've got version of Layered block 2.0.4 and presta 1.6.0.6 and it still doesn't work at all. Employee from shop A can delete a template from shop B what will "disable" the block in shop B. The block is still useless isn't it. I think a template created by an employee of a shop A shouldn't be visable to any other employees. And to modify coding after an update ... it is not a solution. Link to comment Share on other sites More sharing options...
shaun_imakr Posted October 20, 2014 Share Posted October 20, 2014 I finally got my Layered Block Navigation to work with my 3 store. I think Being my 3rd store uses a different default currency from the other 2 stores, I removed the price Product Price Filter, saved the template and it worked. Strange but it worked :-) .. Finally I can move to the next step before going live. Thanks for all your help guys.. Especially samiramisek. :-) It happened to me, too, but after the first indexing it disappeared. In the end I went for the 3rd party solution which works good. Link to comment Share on other sites More sharing options...
w3bsolutions Posted October 25, 2014 Share Posted October 25, 2014 Hello all, I've got version of Layered block 2.0.4 and presta 1.6.0.6 and it still doesn't work at all. Employee from shop A can delete a template from shop B what will "disable" the block in shop B. The block is still useless isn't it. I think a template created by an employee of a shop A shouldn't be visable to any other employees. And to modify coding after an update ... it is not a solution. That is one of the points I mention on this bug report: http://forge.prestashop.com/browse/PNM-2840 please vote and comment there to try to get some response from the team. Link to comment Share on other sites More sharing options...
ldon Posted October 25, 2014 Share Posted October 25, 2014 That is one of the points I mention on this bug report: http://forge.prestashop.com/browse/PNM-2840 please vote and comment there to try to get some response from the team. So do I http://forge.prestashop.com/browse/PNM-2857 Link to comment Share on other sites More sharing options...
localhost1012016 Posted May 8, 2016 Share Posted May 8, 2016 It happened to me, too, but after the first indexing it disappeared. In the end I went for the 3rd party solution which works good. what is the 3rd party solution that works for you? Link to comment Share on other sites More sharing options...
pietjanssen Posted May 12, 2016 Share Posted May 12, 2016 Using prestashop 1.6.1.4 and module v2.1.3 and its not fixed. Used the answer in this post and it works perfectly. I dont understand why they dont fix this issue. Link to comment Share on other sites More sharing options...
perino Posted March 10, 2017 Share Posted March 10, 2017 (edited) I can confirm that this bug still exists in PS 1.6.1.11 and blocklayered 2.2.0. I will include what fixed this issue for me, combined with my other need not to show out of stock attributes: blocklayered.php approx. row 870, function indexAttribute: Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'layered_product_attribute` (`id_attribute`, `id_product`, `id_attribute_group`, `id_shop`) SELECT pac.id_attribute, pa.id_product, ag.id_attribute_group, pas.id_shop FROM '._DB_PREFIX_.'product_attribute pa INNER JOIN '._DB_PREFIX_.'product_attribute_shop pas ON pas.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pac.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'stock_available sa ON (sa.id_product_attribute = pac.id_product_attribute AND sa.quantity > 0) INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute = pac.id_attribute) INNER JOIN '._DB_PREFIX_.'attribute_group ag ON ag.id_attribute_group = a.id_attribute_group '.(is_null($id_product) ? '' : 'AND pa.id_product = '.(int)$id_product).' GROUP BY a.id_attribute, pa.id_product, pas.id_shop' ); approx row 1800, under case: 'id_attribute_group': foreach ($sub_queries as $sub_query) { $query_filters_where .= ' AND p.id_product IN (SELECT pa.`id_product` FROM `'._DB_PREFIX_.'product_attribute_combination` pac LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (pa.`id_product_attribute` = pac.`id_product_attribute`)'. Shop::addSqlAssociation('product_attribute', 'pa').' JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.`id_product_attribute`=pac.`id_product_attribute` AND sa.`quantity`>0) WHERE '.implode(' OR ', $sub_query).') '; } In order to make the block appear you have to go through all your shops, go in the product list, check all the enabled products and from mass actions enable them again. (Possibly indexing attributes works too, but I found out this to be the most reliable method). Hope this helps somebody, cheers. Edited March 10, 2017 by perino (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts