Search the Community
Showing results for tags 'block layered'.
-
Here as small how to for Layered Navigation module. I found too much people asking for that mod, so i wrote this how to and it is also available in portuguese here: http://goo.gl/CCMjA7 So here we go. Block Layered works with product attributes filter (like size, color, etc) and when you have one attribute out-of-stock but still enabled, when customer check the attribute, the product still appear, even with this attribute with quantity 0. The only way to change that without changing the core of module, is disabling this attribute when it is out-of-stock, which if you have a million products is a nightmare... So, to avoid this problem i made some changes in blocklayered.php. Note that my blocklayered version is 1.8.9 and my prestashop version is 1.5.4. 1 - Dont Show Products With Selected Filter Attribute Unavailable To hide products which have the customer selected filter out of stock, open the file blocklayered.php and around line 2375 you find the code: case 'id_product_attribute' : After that you find 2 foreach. In the second one you will find the code: 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`)'; if (version_compare(_PS_VERSION_,'1.5','>')) $query_filters_where .= Shop::addSqlAssociation('product_attribute', 'pa'); $query_filters_where .= 'WHERE '.implode(' OR ', $sub_query).') '; } Replace with: 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`)'; if (version_compare(_PS_VERSION_,'1.5','>')) $query_filters_where .= 'INNER JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.`id_product_attribute` = pac.`id_product_attribute` AND sa.`quantity` > 0)'; if (version_compare(_PS_VERSION_,'1.5','>')) $query_filters_where .= Shop::addSqlAssociation('product_attribute', 'pa'); $query_filters_where .= 'WHERE '.implode(' OR ', $sub_query).') '; } OK, now, navigating to category where this problem happens you can note that products with selected attribute unavailable will not be shown anymore. But, looking to filter name you will se that the total products do not correspond with the ones presented, this is because the block layered table still add product attributes even when out of stock. 2 - Correction Of Out-Of-Stock Attributes in DB To correct this problem, we need to index only attributes available. To do this, open again the blocklayered.php file and search for public function indexAttribute($id_product = null) (around line 255). After that, change the code: 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, '.(version_compare(_PS_VERSION_,'1.5','>') ? 'product_attribute_shop.`id_shop`' : '1').' FROM '._DB_PREFIX_.'product_attribute pa '.(version_compare(_PS_VERSION_,'1.5','>') ? 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 '.(version_compare(_PS_VERSION_,'1.5','>') ? ', product_attribute_shop.`id_shop`' : '')); To: 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, '.(version_compare(_PS_VERSION_,'1.5','>') ? 'product_attribute_shop.`id_shop`' : '1').' FROM '._DB_PREFIX_.'product_attribute pa '.(version_compare(_PS_VERSION_,'1.5','>') ? Shop::addSqlAssociation('product_attribute', 'pa') : '').' INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pac.id_product_attribute = pa.id_product_attribute '.(version_compare(_PS_VERSION_,'1.5','>') ? ' 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 '.(version_compare(_PS_VERSION_,'1.5','>') ? ', product_attribute_shop.`id_shop`' : '')); Now, navigate your your Layered Navigation configuration page in admin and Build Attribute Index. You should note that the number of products with attribute have been changed too. Hope you enjoy this mod and dont forget to make a backup of your file... Regards Mozack
- 45 replies
-
- 8
-
-
- blocklayered
- block layered
-
(and 3 more)
Tagged with:
-
Hi there I want to add an infinite scroll type script to my webshop. All is going well on normal pages (category, manufacturer, search etc) but i want to do this on layered navigation too, which currently is not possible, as this module replaces the pagination with it's own code, and has ajax instant load. This is nice of course, but i want infinite scroll here so i must disable ajax pagination. I presume i must edit the "blocklayered.js", but this seems very very complex Any ideea? Thanks!
- 13 replies
-
- ajax pagination
- block layered
-
(and 1 more)
Tagged with:
-
Hello everyone, I use block layered to transform category name, but I try to replace part of product name in product-list.tpl as well, but it doesnt work, any reason why? Example: Category name: Tools => use filter=> get "Tools > small" I wat same in product name in product-list in products. Thanks for help or any idea Pavel
-
- block layered
- replace
-
(and 1 more)
Tagged with:
-
Hello! I am having a problem with the "blocklayered" module. http://www.adidasi-haine.ro/70-barbati#/price-52-164 as you can see in the link above, the prices shuld be in between 52-164, but the product listings show other prices too.. Prestashop 1.5.6.1 BlockLayered: 1.10.3 Does anyone have any idea? Thanks!
- 8 replies
-
- block layered
- errori
-
(and 1 more)
Tagged with:
-
Hi all, I have a big problem with the block layered. When I copy-paste the URL of filtered categories and brands, the result is a empty URL after # and the filtered products are reset. Any ideas what can cause this? I already reset the module, reindex all URLS, i am using the default TPL (not the modified by the theme)... I am using Prestashop 1.6.1.5 Much appreciated.
-
-
Hi, I have a problem with the Block Layered module, it only works with my Default Currency and it disappears when I change currency on my site. Anyone knows how to solve this issue? Thanks in advance!
- 3 replies
-
- 1
-
-
- Layered currency
- block layered
-
(and 2 more)
Tagged with:
-
Hello everybody, I see that in one of my store is not showing attribute color and size. I check the db and I sow that the table ps_layered_product_attribute is empty. Filling it manually the filter appears on block layer. My question is: how can I fill this table with products attributes data? Thanks, Daniele
-
Подскажите, пожалуйста, заметил, что страница категорий стала очень долго грузиться(порядка 6 секунд). Попробовал отключить блок многоуровневой навигации(он же Layered navigation block) и страница стала грузиться секунд за 2. Как можно изменить этот модуль, чтобы он так не нагружал систему или возможно посоветуйте альтернативный модуль. Заметил еще что в админке в расположении модулей этот модуль находится практически в каждом хуке, может быть в этом проблема и надо оставить его только в нужных хуках? Заранее спасибо!
- 12 replies
-
- фильтр
- многоуровневая навигация
-
(and 1 more)
Tagged with:
-
>>>> POST RESOLU !!! VOIR LE TUTO ICI !!! Bonjour les amis, voici ma question, qui, je l'espère, intéressera plus d'un: Sur Prestashop 1.6, j'ai configuré mon menu a facette en colonne de gauche, mais je ne suis pes trsè satisfait du résultat visuel: 1) Question 01: J'ai par exemple 11 sous-catégories avec case a cocher (voir image 1), et sur un écran "large", c'est le bazar... au lieu de rester sagement affichées les unes après les autres en alignement à gauche, elles se suicent de manière désordonnée et illisible finalement... Comment les forcer à s'aligner les unes après les autres (comme image 2 2) Question 02: Il y a une ascenseur (scrollbar) à droite car l'ensemble des sous categories ne peut pas s'afficher dans le cadre prévu... c'est moche et complique la navigation ! (image03) Comment supprimer cette scrollbar et adapter le cadre au contenu ? (image 04) Voila, si quelqu'un a la solution miracle qu'il s'exprime librement !!! Et je ferais un petit tuto pour la communauté sur cette question une fois la solution trouvée ! Merci a tous !!
- 9 replies
-
- block layered
- affichagen
-
(and 1 more)
Tagged with:
-
Hello, There is a small JavaScript that runs on page load on the Product-List tpl file. But when I use the Block Layared to filter products from the list it reloads the resulted product list without the JavaScript running after. Can someone please help me with finding where to put the Javascript code in order to make sure it runs after each time the filter is used? Thank you
- 7 replies
-
- javascript
- list
-
(and 1 more)
Tagged with:
-
Bonjour, J'utilise le module "navigation à facettes" sur mon site prestashop et je souhaiterais faire une légère modification sur celui-ci. J'aimerai que lorsqu'on charge une page d'un site prestashop sur laquelle se trouve un bloc avec la navigation à facette, les onglets des filtres soit fermés et non ouverts comme ils le sont par défaut. Ainsi lorsque la page est chargée je souhaite que les - soient remplacés par des +. Je pense que la modification à faire se situe sur "/monsiteprestashop/modules/blocklayered/blocklayered.tpl" mais je ne vois pas du tout quelles lignes modifier. Pour info j'aimerai changer ses paramètres pour le filtres "catégories" et les filtres des "caractéristiques" mais si on peux le changer seulement pour tous à la fois je suis preneur quand même. Merci d'avance pour ceux qui m'apportent leur aide et longue vie à prestashop
- 4 replies
-
- navigation à facettes
- block layered
-
(and 1 more)
Tagged with:
-
Bonjour, Dans la navigation à facette, les curseurs de sélection de la tranche de prix ne fonctionnent pas sur les mobiles/tablettes. Impossible de sélectionner une tranche de prix. Avez vous le même problème ? J'ai testé le thème default-bootstrap ainsi que: http://demo.prestashop.com/fr/?view=front tablette affichage horizontal. Testé sur Ipad Patrick
-
- Navigation à facettes
- Block Layered
-
(and 2 more)
Tagged with:
-
I have a problem with page navigation and block layered module. If there are for example 50 products in a category, the pagination show up. If i filter for example "blue color" (with 10 products) the 10 products show up and the pagination disappear, and this is ok. When I deselect the filter "blue color", it reset right all the products, but the pagination links, doesn't reappears again, and i'm not able to go on page 2 and following. Ps: 1.4.7.3 Thanks.
-
- block layered
- pagination
-
(and 2 more)
Tagged with:
-
Hi, For a long time i'm trying to solve an issue with block layered and nGinx. Everything works as expected filtering products in categories but trying access urls from block layered without # (hash) directly in browser, i always get an 404 error. This happens cause i dont have nginx rewrite rules for block layered. I was checking that with disabling friendly urls in PrestaShop BO the direct urls for block layered becomes: ?selected_filters= Well i've tried everything but i cant get this to work. The problem is that i'm getting lots of 404 errors in webmaster tools Can someone give me a light with that? My PS version is: 1.5.6.2 and Block Layered version is 1.10.1. Thanks Mozack
- 1 reply
-
- block layered
- layered navigation
-
(and 2 more)
Tagged with:
-
Hi, we have aprox. 800 products, with a lot of special prices (total around 30 000), when we run http://eshop.xxx.xxx/modules/blocklayered/blocklayered-price-indexer.php?token=xxx&full=1 in mysql admin processes we can see this script opened around 5 times still opened and it wont close... I tried to add mysql_close, exit, flush... Maybe make mysql_close thru Db class?
- 3 replies
-
- block layered
- prestashop 1.5
-
(and 2 more)
Tagged with:
-
Hi, I recently noticed that Google webmaster tools shows duplicate content in all pages with layered navigation results (sizes, colors, etc). Is there any chance to block these results from robots.txt or noindex them. The results use selected_filters attribute. www.domain.com/10-somecategory?n=10&selected_filters=-xs&id_category=10&p=2
-
Hi Prestashopers) Can you tell me please - at someone ever worked meta title changes when selecting filters in block layered navigation? I saw in module code manipulations with meta-title, but not fully unerstand how it should works, maybe need specific settings? checked in 1.4.x - 1.5.x
- 1 reply
-
- block layered
- blocklayered
-
(and 2 more)
Tagged with:
-
Bonjour, Je rencontre un bug sous prestashop 1.5.5 . Quand je suis dans l'administration , je vais dans configurer le module navigation a facette puis à l'étape 1 je clic sur "catégorie spécifiques" ... La une fenetre s'ouvre ... je ne vois que accueil. Impossible d'ouvrir l'arborescence des sous catégories, ni en cliquant sur le + ni en cliquer sur "tout déplier" Est ce qu'il y a un correctif à ce problème ? (sans doute bug .js ?) PS : capture d'ecran en pièce jointe. Merci de votre retour. Cordialement, Thierry.
- 26 replies
-
- blocklayered
- block layered
-
(and 2 more)
Tagged with:
-
Hi, I recently upgraded from Prestashop 1.4.6.2 to 1.5.4.1, and I just had a look in the error log. It shows this error repeated thousands of times: [19-Jul-2013 22:27:07 Europe/London] PHP Warning: Invalid argument supplied for foreach() in /home/duratexc/public_html/www.duratex.co.uk/modules/blocklayered/blocklayered.php on line 2607 And I've only just noticed that the layered navigation does not appear in the category pages. I usually edit php files with wordpad, so I can't find line 2607 (without going crazy) and the file won't open in MS Frontpage. Can anyone tell me what to fix in this file? Thanks for any ideas
-
Please help masters or anybody know how do it! In the attached picture how to remove red lines and do it as in green place in the left side of web site. Thanks very much.
- 1 reply
-
- block layered
- layered
-
(and 1 more)
Tagged with:
-
Hello, Prestashop in combination with block layered module is a great way to better the usability of the site. unfortunately for my shop I got some major issues and I found out this was because the block layered module was built this way. When you sell products that contain sizes like clothes, shoes whatever. Its possible that 1 size gets sold out. Now if u use block layered with a Size filter when u select a size it shows all the products that has the selected size. The problem is when a product size of a certain product is sold out it still shows the product. This is because the block layered module doesnt filterd based on quantity of product combinations. Finally i managed to fix this with modifications to the module! It took much effort and I can offer this fix for other prestashop users using block layered. I can not make this into a module. My offer is: apply product filtering based on current availabillity. show product count per size based on stock combinations pagination based on selected filters why no module? Because to make it work i have to alter many files. And because of diffrent prestashop versions every shop has a diffrent approach. for $105 I can do this for you. Time to get it work 2 days How do we work? You mail me on [email protected] You send ftp & backoffice data If agreed to modification it will take 2 days DEMO: http://www.max30.be/index.php?id_category=4&controller=category (this site is in dutch!) Thank you!