Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • galaxx Friend
    #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 Moderator
    #1079350

    Hi,

    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.

    galaxx Friend
    #1079900

    Hi, 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 Moderator
    #1079903

    Hi,

    Just remove the line of code in my above suggestion:

    jQuery('input[name="attr.cat.value"][value="4"]').parent().parent().hide
    galaxx Friend
    #1079910

    But 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 Moderator
    #1080031

    Thought that it doesn’t make sense as by default when you select to show categories from the filter, it will show there.

    galaxx Friend
    #1080124

    Hi) 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 Moderator
    #1080189

    Hi,

    It will be more complicated than adding the line of code to hide the categories.

    galaxx Friend
    #1080216

    I 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 Moderator
    #1080285

    Kindly check my 1st post in this topic, I mentioned the file and where to add the custom code.

    galaxx Friend
    #1080310

    Great! 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.

    galaxx Friend
    #1080356

    If 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).

    galaxx Friend
    #1080361

    Very 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 Moderator
    #1080611

    You 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.

    galaxx Friend
    #1080646
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 28 total)

This topic contains 27 replies, has 2 voices, and was last updated by  Saguaros 6 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum