rhemaxos Posted December 23, 2013 Share Posted December 23, 2013 Hi there, As the title suggests I'm trying to make the blocklayered be displayed in prices-drop, new-products and best-sales in the LeftColumn hook. Using a third-party custom module is not an option for me. To my knowledge the Layered Navigation Block is a category specific module and I should try customizing the module in order to get it displayed in these pages. If anyone knows what files should be modified and what I should modify, I'd greatly appreciate it! Thanks in advance! Nick 1 Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 23, 2013 Share Posted December 23, 2013 Hi. You could try and edit the PHP file of the module and set it to use the home or root category if not category ID is supplied in the URL. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
rhemaxos Posted December 23, 2013 Author Share Posted December 23, 2013 Hi. You could try and edit the PHP file of the module and set it to use the home or root category if not category ID is supplied in the URL. Regards. Robin. The CartExpert Team Hi Robin, Thanks for the answer. Can you be a bit more specific, the file I should modify is "/modules/blocklayered/blocklayered.php" ? I'm looking through the blocklayered.php and that file has a lot of code, , where exactly should I modify the code? Thanks! Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 23, 2013 Share Posted December 23, 2013 Hi. Yes, that's the file and the function is 'getSelectedFilters' (should be on line 2222) Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
rhemaxos Posted December 23, 2013 Author Share Posted December 23, 2013 I'm sure an experienced PrestaShop developer could figure it out, but it seems I can't. I see here the getSelectedFilters has this instruction: $id_parent = (int)Tools::getValue('id_category', Tools::getValue('id_category_layered', 1)); if ($id_parent == 1) return; I'm guessing the getValue method returns either the id_category_layered either (int)1, in the case it's 1 it doesn't show. If this is the case I've already commented out this line and it's still not showing in new-products, prices-drop or best-sales. What am I missing here? Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 23, 2013 Share Posted December 23, 2013 That's because there's no hook executed on those pages that is related to the module. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
rhemaxos Posted January 10, 2014 Author Share Posted January 10, 2014 So what hook should I put in those pages, which is the hook layered navigation uses in this case? Thanks! Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 10, 2014 Share Posted January 10, 2014 E.g.:- productListAssign Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
lav3pa Posted January 11, 2014 Share Posted January 11, 2014 E.g.:- productListAssign Regards. Robin. The CartExpert Team I'm having the same problem, Could you be more specific anout this, please. Link to comment Share on other sites More sharing options...
lav3pa Posted January 11, 2014 Share Posted January 11, 2014 I'm having the same problem, Could you be more specific anout this, please. I figure out thet the module should be assign to an hook that is present on that specifi page. In my case ins special products page. II try to hook block_layered to actionProductListOverride ( the old productlistassign), but seems the moduel is already hooked there, but still don't show on that page. I try no found another hook to use, but no luck. Any sugestions? Link to comment Share on other sites More sharing options...
chris_mini_charmed Posted February 18, 2014 Share Posted February 18, 2014 (edited) Hi, I'm having the same problem. These are the modifications I made: - I modified the blocklayered.tpl in order to target another blocklayered-ajax.php file if the current page is prices-drop - I duplicated the blocklayered-ajax.php in blocklayered-prices-drop-ajax.php in order to separate the behavior of the module if the page is prices-drop since the function is different. - I duplicated the function getProducts of the blocklayered.php calling it getPricesDrop and consequently I duplicated the getProductByFilters in getPricesDropByFilters in order to modify the sql query and apply the filters only on prices drop. I thought it should work but I found out that the problem is the hookProductListAssign: it is executed only for the category pages and not for prices drop pages. Right now I'm able to show the filters in the page but they are not filtering prices drops. I looked into the prices drop controller and I figured out that the only method that I have to overwrite is the initContent but unfortunately I'm not able to do it. Can anyone help me please? Or did anyone succeed in displaying the layered navigation module in the Prices Drop page using another technique? Thanks Chris Edited February 19, 2014 by chris_mini_charmed (see edit history) Link to comment Share on other sites More sharing options...
shubbing Posted February 28, 2014 Share Posted February 28, 2014 Hi, I would like to seek help for this issue too. Seems like there isn't a fix around yet. Hope that someone can build on the previous solution for coding noobs like me or suggest something else. Thanks in advance! Link to comment Share on other sites More sharing options...
rintu2014 Posted September 10, 2014 Share Posted September 10, 2014 Hi, I would like to seek help for this issue too. Seems like there isn't a fix around yet. Hope that someone can build on the previous solution for coding noobs like me or suggest something else. Thanks in advance! I don't understand, If the forum moderators can't give right solution as early as possible. What is the purpose of this Forum. This topic is too old but still no solution. I am facing this problem too. Can anyone help us to get rid of this problem. I am trying to catch attention of the experienced Prestashop programmer and Moderators of this Forum. 1 Link to comment Share on other sites More sharing options...
adrianvk Posted March 4, 2015 Share Posted March 4, 2015 No one has yet managed to display the module on these pages?I tried all the above and not working.I do not understand because the Prestashop development team has thought to hide the module on these pages can benefit in something. Bad decision! Sorry for my english. Link to comment Share on other sites More sharing options...
Skayfer Posted June 27, 2015 Share Posted June 27, 2015 I too have problem with add blocklayered to manufacturers.tpl, a many people have with this problem, and dev should look at this. Link to comment Share on other sites More sharing options...
mlarino Posted June 30, 2015 Share Posted June 30, 2015 Same problem here. Layered navigation should come with this option by default. Manufacturer pages, New product pages and price-drop pages in prestashop havent been changed in ages! and need more functionality. If someone can help us load the layered navigation in this pages, or point us to a module that can do this I would appreciate it. Thanks! Link to comment Share on other sites More sharing options...
thanos26 Posted September 9, 2015 Share Posted September 9, 2015 (edited) Hi mlarino, I am still trying to figure this out since i am upgrading my shop to 1.6.1 and prefer to avoid purchasing extra modules. If you are searching for a paid module then Ajax filter from Presto changeo can certainly do it. I use it in my current shop 1.4.3 (see http://mathos-exclusive.com/en/prices-drop). Functionality and customer service are both great. Edited September 9, 2015 by thanos26 (see edit history) Link to comment Share on other sites More sharing options...
The Fuzzy Pineapple Posted January 1, 2016 Share Posted January 1, 2016 Wow. I've been trying to get this going since 2012 and still couldn't figure it out. I always wondered why this wasn't already a default option. Link to comment Share on other sites More sharing options...
dpcdpc11 Posted July 15, 2016 Share Posted July 15, 2016 Still no solution for this problem? Link to comment Share on other sites More sharing options...
robbinj Posted October 21, 2016 Share Posted October 21, 2016 A solution to this problem would be great, if someone could come up with the solution I would even pay a donation through paypal if that will satisfy anyone.. Link to comment Share on other sites More sharing options...
HaCos Posted January 15, 2017 Share Posted January 15, 2017 Up Up Up - no solution here? Link to comment Share on other sites More sharing options...
dpcdpc11 Posted January 22, 2017 Share Posted January 22, 2017 Up+++ this is really absurd... we are in 2017 and this problem still doesn't have a proper solution! What gives prestashop people? Link to comment Share on other sites More sharing options...
PassionX Posted February 25, 2017 Share Posted February 25, 2017 Strange that this issue is not solved yet... In another Theme they say the Module https://addons.prestashop.com/en/search-filters/2778-advanced-search-4.html will fix that problem? does anyone know if this is true? regards Simon Link to comment Share on other sites More sharing options...
rygar_84 Posted February 28, 2017 Share Posted February 28, 2017 Anybody solved this issue yet? I want to display the layered navigation block on these pages too!!!! Link to comment Share on other sites More sharing options...
Amir92 Posted March 15, 2017 Share Posted March 15, 2017 I got the solution, for Discount page (price-drops) is working great, i need to figure out for other page also. I will share solution here once other done. 1 Link to comment Share on other sites More sharing options...
dpcdpc11 Posted March 21, 2017 Share Posted March 21, 2017 I got the solution, for Discount page (price-drops) is working great, i need to figure out for other page also. I will share solution here once other done. Hey Amir... did you manage to complete the solution? I still can't believe this is not a standard option for the get go! Link to comment Share on other sites More sharing options...
Rom Soul Posted March 27, 2017 Share Posted March 27, 2017 Hi everyone, I'm interested too in displaying the layered nav on my specials / discount page... ( Without paying 200€ I mean ) That would be great because discount page is usually the kind of place where you find very mixed products. Let's hope a solution comes soon... This question has been lasting for a few years now Link to comment Share on other sites More sharing options...
Attrexx Posted June 5, 2017 Share Posted June 5, 2017 Aaaaand Amir92 dissapeared in the woods. Figures. Link to comment Share on other sites More sharing options...
Amir92 Posted June 5, 2017 Share Posted June 5, 2017 Aaaaand Amir92 dissapeared in the woods. Figures. Hey Alexandru Alexe, m here now sorry i was so busy, m going to write my solution now. meanwhile u can check working site: eddy(dot)com(dot)sa/en/prices-drop Link to comment Share on other sites More sharing options...
Attrexx Posted June 6, 2017 Share Posted June 6, 2017 Thanks for answering, Amir We are all waiting for the miraculous solution, indeed. This issue became very frustrating the other day. By the way, nice job with the electronics shop. Well built/maintained Link to comment Share on other sites More sharing options...
Amir92 Posted June 7, 2017 Share Posted June 7, 2017 (edited) Thanks everyone for waiting too long for this solution . Finally, i found the solution to show filter: block layered navigation module(prestashop default module) on Discount page(price_drop).For now, this is working for discount page only, in future i will try to implement on other page too as new_products and best_sales as soon i get time, or if you guys support by Donation, i will try to make in urgent, and many more free solution Here is the working solution you can check: eddy(dot)com(dot)sa/en/prices-drop Note: I override most of the files. but you need to modify blocklayered module core file. There are two issue. I will try to fix these issue in next release. 1) Total number of product count not correct. 2) You need to define "price_drop" page indexing manually in blocklayererd-ajax.php Prestashop Supported Version: 1.6.1.10 (tested on this version) List of file changes: 1) override/controllers/front/PricesDropController.php 2) themes/[current-theme-name]/prices-drop.tpl 3) override/classes/Product.php 4) modules/blocklayered/blocklayered.php 5) modules/blocklayered/blocklayered-ajax.php - Update $query[x] index as per your store url for price_drop page. Ex: localhost/prestashop/en/prices-drop , then x = 3 6) themes/[current-theme-name]/js/modules/blocklayered/blocklayered.js File download link: https://drive.google.com/file/d/0By68mIirpO34LU04a1dSNklLd2s/view ( Can anyone tell me from where i can upload file in this thread? ) Just download and replace above files in you store, and update $query[x] index in blocklayered-ajax.php as mentioned above. Please let me know, if any issue Edited June 7, 2017 by Amir92 (see edit history) 3 1 Link to comment Share on other sites More sharing options...
Amir92 Posted June 8, 2017 Share Posted June 8, 2017 Thanks for answering, Amir We are all waiting for the miraculous solution, indeed. This issue became very frustrating the other day. By the way, nice job with the electronics shop. Well built/maintained Hey Alex, please check my above solution, and let me know if its working for you Link to comment Share on other sites More sharing options...
JimmyTurpin Posted June 9, 2017 Share Posted June 9, 2017 Hi Amir, Sorry for bad English, i'm french. First, thank you very much for your development and your time to solve this problem. I've try to follow your tutorial but i've obtain a big Internal Servor 500... Perhaps, i've made something wrong. - When i go to override/controllers/front/, i've not any file except index.php. - i don't to how to update my $query in modules/blocklayered/blocklayered-ajax.php. What is the command to made this ? Here my file blocklayered-ajax.php : include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../init.php'); //Get page_name by url(price_drop page) $queries = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH); $query = explode("/", $queries); //Update $query[x] index as per your store url for price_drop page. Ex: localhost/prestashop/en/prices-drop , then x = 3 Context::getContext()->controller->php_self = $query[3]; $blockLayered = Module::getInstanceByName('blocklayered'); echo $blockLayered->ajaxCall(); Can you help me please ? Thanks Jimmy Link to comment Share on other sites More sharing options...
Amir92 Posted June 10, 2017 Share Posted June 10, 2017 Hey Jimmy, I am also not Englishman, sorry for my bad english I've try to follow your tutorial but i've obtain a big Internal Servor 500... -Try to clear cache and enable debugging from config/defince.inc.php and check the exact error. When i go to override/controllers/front/, i've not any file except index.php. -no issue, just copy override files in same folder, if folder not exist create folder. - i don't to how to update my $query in modules/blocklayered/blocklayered-ajax.php. What is the command to made this ? -Can you tell me your shop url? by the way you may need to change line 7 Context::getContext()->controller->php_self = $query[3]; Ex: localhost/prestashop/en/prices-drop, then "price-drop" index is 3, so $query[3] Link to comment Share on other sites More sharing options...
JimmyTurpin Posted June 10, 2017 Share Posted June 10, 2017 Hi Amir, Thanks for your answer. I'll try to fix all point on this week-end. I send you the shop url of my client in MP. Thanks Link to comment Share on other sites More sharing options...
Amir92 Posted June 10, 2017 Share Posted June 10, 2017 Hi Amir, Thanks for your answer. I'll try to fix all point on this week-end. I send you the shop url of my client in MP. Thanks Hey Jimmy, which version of prestashop you using? Link to comment Share on other sites More sharing options...
JimmyTurpin Posted June 12, 2017 Share Posted June 12, 2017 Hi Amir, I'm using Prestashop 1.6 Link to comment Share on other sites More sharing options...
GAELLE Posted June 12, 2017 Share Posted June 12, 2017 Hello, I am very interested by this option, can you help me please ? Iam in version 1.6.1.12 thank you so much Link to comment Share on other sites More sharing options...
Amir92 Posted June 12, 2017 Share Posted June 12, 2017 Hi Amir, I'm using Prestashop 1.6 Hi Jimmy, please check your personal message tab. Link to comment Share on other sites More sharing options...
Amir92 Posted June 12, 2017 Share Posted June 12, 2017 Hello, I am very interested by this option, can you help me please ? Iam in version 1.6.1.12 thank you so much Hey Gaelle, Have you tried my above solution ? Link to comment Share on other sites More sharing options...
GAELLE Posted June 12, 2017 Share Posted June 12, 2017 Hi Amir, thank you so much for your fast response.. Sorry it's confused for me I'm not talented, can you make me a resume please ? thank you so much for your help, Laetitia Link to comment Share on other sites More sharing options...
Amir92 Posted June 13, 2017 Share Posted June 13, 2017 Hi Amir, thank you so much for your fast response.. Sorry it's confused for me I'm not talented, can you make me a resume please ? thank you so much for your help, Laetitia You just need to replace file in the folder. Link to comment Share on other sites More sharing options...
Attrexx Posted June 13, 2017 Share Posted June 13, 2017 Hey there Amir. I am now working to implement this on my client's site and if all's good I'll replicate solution to the whole portfolio Thank you A LOT! I have one request though. I have modified some parts of my current blocklayered.php file so I need to know what modifications you made to it so I can put only those in without replacing the whole file. Also, @rhemaxos, please mark this thread as SOLVED Link to comment Share on other sites More sharing options...
Attrexx Posted June 13, 2017 Share Posted June 13, 2017 UPDATE 1:Just replacing said files produces this error on Price Drop page: Fatal error: Call to protected method ProductCore::_getProductIdByDate() from context 'BlockLayered' in /home/r36469cond/public_html/modules/blocklayered/blocklayered.php on line 2173 Link to comment Share on other sites More sharing options...
Amir92 Posted June 13, 2017 Share Posted June 13, 2017 UPDATE 1: Just replacing said files produces this error on Price Drop page: Fatal error: Call to protected method ProductCore::_getProductIdByDate() from context 'BlockLayered' in /home/r36469cond/public_html/modules/blocklayered/blocklayered.php on line 2173 Hey, you missed Product.php file which override getProductIdByDate() method Please copy override/classes/Product.php file. Try to replace all changes. Link to comment Share on other sites More sharing options...
Attrexx Posted June 13, 2017 Share Posted June 13, 2017 (edited) I put that file in but I think the problem comes from placing the js & tpl files in default theme only, not the active one Be right back. Edited June 13, 2017 by Attrexx (see edit history) Link to comment Share on other sites More sharing options...
Attrexx Posted June 13, 2017 Share Posted June 13, 2017 (edited) Sorry but it messes up the site. Replaced all files, in the right places. No filters on category pages, Fatal error on Prices Drop.I rolled back the changes because I can't keep the live site crooked for long stretches of time Edited June 13, 2017 by Attrexx (see edit history) Link to comment Share on other sites More sharing options...
Amir92 Posted June 13, 2017 Share Posted June 13, 2017 Sorry but it messes up the site. Replaced all files, in the right places. No filters on category pages, Fatal error on Prices Drop. I rolled back the changes because I can't keep the live site crooked for long stretches of time Can you on debugging and paste error here. Try to setup on localhost first Link to comment Share on other sites More sharing options...
JimmyTurpin Posted June 13, 2017 Share Posted June 13, 2017 Hi Amir, Have you seen my MP ? Link to comment Share on other sites More sharing options...
soleymani Posted July 18, 2017 Share Posted July 18, 2017 (edited) Thank you, Amir for your solutionI also use the template sp-revo, but when I load all the files, I get the error below Fatal error: Call to protected method ProductCore::_getProductIdByDate() from context 'BlockLayered' in C:\xampp\htdocs\revo\modules\blocklayered\blocklayered.php on line 2173 Edited July 18, 2017 by soleymani (see edit history) Link to comment Share on other sites More sharing options...
dpcdpc11 Posted October 26, 2017 Share Posted October 26, 2017 What's the status on this one on the latest PS 1.7 version? Link to comment Share on other sites More sharing options...
viniciuscoder Posted March 7, 2018 Share Posted March 7, 2018 (edited) Em 6/7/2017 em 10:45 AM, Amir92 disse: Thanks everyone for waiting too long for this solution . Finally, i found the solution to show filter: block layered navigation module(prestashop default module) on Discount page(price_drop).For now, this is working for discount page only, in future i will try to implement on other page too as new_products and best_sales as soon i get time, or if you guys support by Donation, i will try to make in urgent, and many more free solution Here is the working solution you can check: eddy(dot)com(dot)sa/en/prices-drop Note: I override most of the files. but you need to modify blocklayered module core file. There are two issue. I will try to fix these issue in next release. 1) Total number of product count not correct. 2) You need to define "price_drop" page indexing manually in blocklayererd-ajax.php Prestashop Supported Version: 1.6.1.10 (tested on this version) List of file changes: 1) override/controllers/front/PricesDropController.php 2) themes/[current-theme-name]/prices-drop.tpl 3) override/classes/Product.php 4) modules/blocklayered/blocklayered.php 5) modules/blocklayered/blocklayered-ajax.php - Update $query[x] index as per your store url for price_drop page. Ex: localhost/prestashop/en/prices-drop , then x = 3 6) themes/[current-theme-name]/js/modules/blocklayered/blocklayered.js File download link: https://drive.google.com/file/d/0By68mIirpO34LU04a1dSNklLd2s/view ( Can anyone tell me from where i can upload file in this thread? ) Just download and replace above files in you store, and update $query[x] index in blocklayered-ajax.php as mentioned above. Please let me know, if any issue Hi there, this topic is too old and you maybe dont use this anymore, but i had to used it (Thank you very much @Amir92) and i found a solution for this bugs. For the blocklayered-ajax.php, do this: <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../init.php'); $context = Context::getContext(); //Get page_name by url(price_drop page) $queries = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH); $query = explode("/", $queries); //Get page original name from page $php_self = Db::getInstance()->getValue(' SELECT m.page FROM `ps_meta` m LEFT JOIN `ps_meta_lang` l ON m.id_meta = l.id_meta WHERE l.url_rewrite = "'.$query[1].'" AND l.id_lang = '.$context->language->id); $context->controller->php_self = $php_self ? $php_self : 'category'; $blockLayered = Module::getInstanceByName('blocklayered'); echo $blockLayered->ajaxCall(); And to show the actual number of results you should make the changes in blocklayered.php, but first find this line: Db::getInstance()->execute('DROP TEMPORARY TABLE IF EXISTS '._DB_PREFIX_.'cat_filter_restriction', false); Before this line, add this code: if($tab_id_product && is_array($tab_id_product)){ $query_filters_where .= ' AND product_shop.`id_product` IN ('.implode(', ', $tab_id_product).')'; } I hope I have helped you guys. Edited March 7, 2018 by viniciuscoder (see edit history) Link to comment Share on other sites More sharing options...
prus Posted April 15, 2020 Share Posted April 15, 2020 Anyone try that solution on 1.7.6 ? Maybe there is an option to create script that will assign products from prices-drop page to prices-drop category? Link to comment Share on other sites More sharing options...
Empo Posted June 1, 2020 Share Posted June 1, 2020 Anyone have a solution for PS 1.7? Link to comment Share on other sites More sharing options...
dmru Posted August 7, 2020 Share Posted August 7, 2020 Hello everyone, maybe someone will find this information useful: To display the filter in New product 1. Created the "New products" category 2. Added products there 3. Added this category to the filter template in the block layered settings 4. Directed a menu item to this category 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