Home Forums WoodMart support forum product category filter widget issue

product category filter widget issue

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #153738

    Gassigeher
    Participant

    Hello there, I just found out that there is an issue with the ajax funktionality when I use the product filter widget. After using an attribute filter the product filter doesn´t respond anymore.
    When I deactivate the filter works again. Any idea how we still can use ajax?

    #153751

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a link to your website where we can see this issue?

    Kind Regards

    #153777

    Gassigeher
    Participant

    Hello there. Please see private content.

    #153790

    Artem Temos
    Keymaster

    We don’t see any problems on your website with filters at the moment https://gyazo.com/87e9363891f09d0414897b58a7add9f8

    #153793

    Gassigeher
    Participant

    But try to change the location after using the attribute filter

    #153794

    Artem Temos
    Keymaster

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #153805

    Gassigeher
    Participant

    Ok

    #153836

    Artem Temos
    Keymaster

    Yes, you are right. But it is not a filter but categories widget. We will fix this issue in our next theme update.

    #153838

    Gassigeher
    Participant

    ok, so it´s nothing I did wrong – just something wrong with the theme? Hope update will come soon. Thank you anyway.

    #153843

    Artem Temos
    Keymaster

    Yes, it is our theme’s bug. It will be fixed in the update for sure.

    #161228

    Artem Temos
    Keymaster

    Hello there,

    Unfortunately, we are not able to fix this without WooCommerce modification. For now, please edit the file
    wp-content/plugins/woocommerce/includes/widgets/class-wc-widget-product-categories.php

    and remove the code http://prntscr.com/q6hohh

    Then, go to Theme Settings -> Custom JS and put the following code one document ready

    product_cat();
    jQuery(document).on('pjax:complete', function(xhr, textStatus, options) {
    	 product_cat();
    });
    function product_cat(){
    	jQuery('.widget_product_categories').each(function() {
          var $select = jQuery('.dropdown_product_cat');
          $select.change(function(e) {
            e.stopPropagation();
            var home_url = woodmart_settings.home_url;
            var this_page = '';
            if ( jQuery(this).val() != '' ) {
              if (home_url.indexOf('?') > 0) {
                this_page = home_url + '&product_cat=' + jQuery(this).val();
              } else {
                this_page = home_url + '?product_cat=' + jQuery(this).val();
              }
            } else {
              this_page = woodmart_settings.shop_url;
            }
            jQuery.pjax({
              container: '.main-page-wrapper',
              timeout: woodmart_settings.pjax_timeout,
              url: this_page,
              scrollTo: false,
            });
          });
          if (jQuery().selectWoo) {
            $select.selectWoo({
              placeholder: 'Select a category',
              minimumResultsForSearch: 5,
              width: '100%',
              allowClear: true,
              language: {
                noResults: function() {
                  return 'No matches found';
                },
              },
            });
          }
        });
    }
Viewing 11 posts - 1 through 11 (of 11 total)