• Resolved dino777

    (@dino777)


    Hello,

    I just updated my Woocommerce plugin to the new version (3.0.0), after checking that YITH Ajax Filter was compatible with it ( as we can see here).

    After this update, the filters are still working for the “parent” node, but I can’t see the hierarchical in my filters list. My list use to be like that:

    – Parent 1
    — Child 1
    — Child 2
    – Parent 2
    — Child 1
    — Child 2

    I cannot see “Child 1” or “Child 2”, but only “Parent 1” and “Parent 2”, whatever is the selected option in my Widget configuration (Display all hierarchical / All no hierarchical / Only parent).

    Note: the child is not display after the selection of a parent node too.

    • This topic was modified 7 years, 7 months ago by dino777.
    • This topic was modified 7 years, 7 months ago by dino777.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi @dino777,

    I’m sorry for this issue.
    I tried to replicate the issue in my local but without success.
    Please, can you explain me how I can replicate it in my local ? Thanks.

    If possible, write me the shop url of your website in the next reply.
    I look forward to hearing from you

    Have a nice day
    YITH

    Thread Starter dino777

    (@dino777)

    Hi,

    Thanks for your answer.

    I thought it was a plugin problem because it was working fine before the update of Woocommerce. But maybe there is another issue… I do not have a specific configuration, I just added the YIFI plugin and made a “list” filter on an existing attribute.

    The webserver is down for now, but you can access my local (test) server, if it’s running (18/24h), with my ddns link: here

    -> On the left, you have “FILTRER PAR RéGION”

    Thread Starter dino777

    (@dino777)

    Sorry, I had another problem with my webserver. Forget the ddns link, you can check it on the live server now: here

    The Ajax Filter is configured like:
    – Type : List
    – Query Type : AND
    – Attribute : region
    – Display : All (hierarchical)

    • This reply was modified 7 years, 7 months ago by dino777. Reason: add widget configuration
    Plugin Author YITHEMES

    (@yithemes)

    Hi, I tested your website and I have an idea for your issue. I think that in your theme or in another plugin there are a function that change the value of this hook: yith_wcan_include_terms
    This array, normally, is an empty array but on your website this is an array with a non empty value…
    This means that the product filter plugins search for post with an id that doesn’t exists….and no child categories are shown.

    Do you use this hook on your theme ? If you want you can remove it with this snippet of php code:

    add_filter( 'yith_wcan_include_terms', '__return_empty_array', 99 );

    Past this code at the end of functions.php file locate in main root of your theme under wp-content/themes/>YOUR_THEME_FOLDER>

    but I don’t know why you change this value and if you want to no show categories in other shop section….
    With this code works fine in my local….

    Let me know.
    Have a nice day
    YITH

    Thread Starter dino777

    (@dino777)

    Hi,

    I don’t use this hook and I didn’t change it’s value by myself… I made a search in my entire /www/ folder for the term “yith_wcan_include_terms” to find if anything else (like a plugin) would change it’s value, but the only results were in the yith plugin files:

    
    ..\wp-content\plugins\yith-woocommerce-ajax-navigation\includes\functions.yith-wcan.php:
      256          $exclude = apply_filters( 'yith_wcan_exclude_terms', array(), $instance );
      257:         $include = apply_filters( 'yith_wcan_include_terms', array(), $instance );
      258          $reordered = false;
    
      658      function yit_reorder_hierachical_categories( $parent_term_id, $taxonomy = 'product_cat' ) {
      659          $exclude = apply_filters( 'yith_wcan_exclude_terms', array(), array() );
      660:         $include = apply_filters( 'yith_wcan_include_terms', array(), array() );
    
      662          $childs = yith_wcan_wp_get_terms(
    
    ..\wp-content\plugins\yith-woocommerce-ajax-navigation\widgets\class.yith-wcan-navigation-widget.php:
      959                  $exclude    = apply_filters( 'yith_wcan_exclude_terms', array(), $instance );
      960:                 $include    = apply_filters( 'yith_wcan_include_terms', array(), $instance );
      961                  $echo       = false;
    

    Those are the original files of the plugin, I didn’t change any files for this plugin.

    I added the filter you given to me in my functions.php (the one from my child theme) and, unfortunately, it didn’t make any change ( but I don’t know how to check if this array is now empty).

    I let this filter in the file for now…

    Thank you for your help

    • This reply was modified 7 years, 7 months ago by dino777.
    Plugin Author YITHEMES

    (@yithemes)

    Hi,

    please only for testing can you replace this two lines of code:

    256 $exclude = apply_filters( ‘yith_wcan_exclude_terms’, array(), $instance );
    257: $include = apply_filters( ‘yith_wcan_include_terms’, array(), $instance );

    with this:

    $include = $exclude = array();

    Let me know for test results.
    Have a nice day
    YITH

    Note: Remeber to clean the cache (if you use a cache plugin) and click 3/4 time on CTRL+F5 to clean browser cache on frontend before testing it. ??

    Thread Starter dino777

    (@dino777)

    Hello,

    I’m really sorry to have bother you, the problem wasn’t your plugin.

    The problem was found today into the WordPress’s database:
    The plugin used to add “hierarchy” support for the attributes was “custom-made” and don’t work any more. So your plugin don’t show any sub-attributes, because it can’t detect them any more… There are none! All attributes were automatically switched to “Parent”. ??

    I wish this option was added by default with Woocommerce or include with your plugin (maybe in the premium version?), but. I think I just have to find another way to add Hierarchy Support of the attributes or do without it…

    Once again, sorry for your time…

    Plugin Author YITHEMES

    (@yithemes)

    Hi @dino777,

    I think that this issue are related to latest WC release.
    Please, can you try with the latest version that our developers have released today ?
    Thanks .

    Let me know

    YITH

    Thread Starter dino777

    (@dino777)

    Hi,

    It’s working with your new version, but I also had to change the line 193 in the “./plugins/woocommerce/includes/wc-class-post-types.php” in order to see the “parent” box on the attributes, from:
    'hierarchical' => false,
    to
    'hierarchical' => true,

    Now, I can define a child/parent attribute again and your plugin let me filter them…

    Maybe you need to upgrade this class directly from your plugin too, I think Woocommerce change this in a recent update…

    Plugin Author YITHEMES

    (@yithemes)

    Hi @dino777,

    thanks for your reporting. Our developers created a workaround for this, please read this post in our help center: https://support.yithemes.com/hc/en-us/articles/115000123814-Ajax-Product-filter-Attributes-are-no-longer-hierarchical-than-version-3-0-x-of-WooCommerce

    Let me know if works fine for you.
    Have a nice day
    YITH

    Thread Starter dino777

    (@dino777)

    Hello,

    I add this code to my functions.php and revert the modification I made in wc-class-post-types.php, and it’s working again.

    Thanks a lot for your help (and also to the YITH dev team ?? )

    Plugin Author YITHEMES

    (@yithemes)

    Hi @dino777,

    thanks to you for your patience.
    If you like our plugin and our support, please give us a good review ?? This is very important for us ??

    Have a nice day
    YITH

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Bug with woocommerce 3.0.0’ is closed to new replies.