-
AuthorPosts
-
December 5, 2017 at 2:56 pm #1079215
Need to hide goods from some categories and also not to show these categories in a categories tree.
The same with manufacturers. Is it possible in current edition of Megafilter?Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 6, 2017 at 4:53 am #1079350Hi,
There is no option to hide specific category like that, you will need to use jQuery to hide. Here is my tweak:
Go to file: /components/com_jamegafilter/assets/js/main.js
At approx line 317, you will see this function:// reinit quickview $(document).on('afterUpdateRender', function (e) { if (e.lntarget == lnmain) { // scroll to top if (typeof MegaFilterCallback === 'function') { MegaFilterCallback(); } } jQuery('input[name="attr.cat.value"][value="4"]').parent().parent().hide(); })
And add the jquery as above
You will need to change the value to the associated value of category you want to hide. For example, you can use Inspect Element on the filter, you will see that the ‘Gifts & Accessories’ has value of 4: http://prntscr.com/hjoy7g
So above code will remove this category from the list. You can do the same with other categories.
December 8, 2017 at 10:06 am #1079900Hi, and thank you for an attempt 🙂 As I have a large tree of categories, and it is not possible to set a list of hidden categories in the component settings, please, "reverse" this tweak, so I could show only desired (very few) categories.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 8, 2017 at 10:26 am #1079903Hi,
Just remove the line of code in my above suggestion:
jQuery('input[name="attr.cat.value"][value="4"]').parent().parent().hide
December 8, 2017 at 11:09 am #1079910But how this will help to show only desired categories? Guess, some line with id number is also needed…
like: jQuery(‘input[name="attr.cat.value"][value="4"]’).parent().parent().SHOW..Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 10, 2017 at 5:43 am #1080031Thought that it doesn’t make sense as by default when you select to show categories from the filter, it will show there.
December 10, 2017 at 8:10 pm #1080124Hi) Then, we may use some special parameter, stored in a categories table, just like "published". Let it be "filtered" with possible values 1 (category is used in filter), 0 (not used in filter), so it could be processed by a filtering algorythm and all categories with ‘filtered’=0 will not be displayed and used for filtering. I can easily add such a parameter to my categories DB and load it from a csv table, but it’ll be great, if you help me to add a corresponding piece of code in a proper place.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 11, 2017 at 2:53 am #1080189Hi,
It will be more complicated than adding the line of code to hide the categories.
December 11, 2017 at 6:20 am #1080216I can wait for couple days)) Also you can show me the files, where corresponding query is set , so I could experiment a bit with my new parameter…
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 11, 2017 at 9:00 am #1080285Kindly check my 1st post in this topic, I mentioned the file and where to add the custom code.
December 11, 2017 at 9:15 am #1080310Great! Seems, we are very close to a success 🙂 This feature is of great value for me, especialy until the currency conversion will be added to the filter.
December 11, 2017 at 10:42 am #1080356If you decide to try some solution, based on my idea, you may use ‘category_show_descr’ parameter from j33_virtuemart_categories_ru_ru table (yostor.ru).
December 11, 2017 at 10:58 am #1080361Very few categories in our test store have category_show_descr = 1 , others have 0 and it only takes to select categories with 1 to use in a filter. Unfortunately, I’m not that good in jQuery, so it is hard for me to write a proper code in a place you point me to. Definitely need your/team help…
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
December 12, 2017 at 7:31 am #1080611You can share the credentials of your site: URL, Admin + FTP account and tell me the categories you want to remove, I will take a look.
-
AuthorPosts
This topic contains 27 replies, has 2 voices, and was last updated by Saguaros 6 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum