Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter v0van

    (@v0van)

    “YITH WooCommerce Ajax product filter” creates filter links regardless of the presence of the selected parameters “price from and to” on the page (and similarly in the page url of the parameters min_price= and max_price= ).
    It is not right. For the real work of the store, this is inconvenient if there are a lot of goods.
    Not everyone will buy the paid version of “YITH WooCommerce Ajax Product Filter”, someone will use the free one.

    RU:
    “YITH WooCommerce Ajax фильтр товаров” создаёт ссылки фильтров вне зависимости от наличия на странице выбранных параметров “цены от и до” (и аналогично в урле страницы параметров min_price= и max_price= ).
    Это неправильно. Для реальной работы магазина это неудобно, если товаров очень много.
    Не все же будут покупать платную версию “YITH WooCommerce Ajax фильтр товаров”, кто-то будет пользоваться бесплатной.

    Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,

    did you try the plugin with a WordPress default theme and WooCommerce only in order to see if the problem persists?

    “YITH WooCommerce Ajax product filter” creates filter links regardless of the presence of the selected parameters “price from and to” on the page (and similarly in the page url of the parameters min_price= and max_price= ).
    It is not right. For the real work of the store, this is inconvenient if there are a lot of goods.
    Not everyone will buy the paid version of “YITH WooCommerce Ajax Product Filter”, someone will use the free one.

    What do you mean with that? May I ask you additional info, please?

    Thank you.

    Thread Starter v0van

    (@v0van)

    YITH_LINK.png – https://ibb.co/12T2xQV

    <li class="filter-item checkbox  level-0 no-color">
        <label for="filter_1387_2_17">
            <input type="checkbox" id="filter_1387_2_17" name="filter[1387][2]" value="televizor_-lg">
     
            <a href="https://woo.vveb.ws/shopcat/televizori?yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg" role="button" class="term-label tooltip-added" data-title="LG">
                LG                  </a>
        </label>
     
        </li>

    that’s exactly what I mean.
    if we are on the page:

    https:// woo.vveb.ws /shopcat/televizori/?min_price=15790&max_price=26990

    then the “LG” link should not be:

    https:// woo.vveb.ws /shopcat/televizori?yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg

    but:

    https:// woo.vveb.ws /shopcat/televizori?min_price=15790&max_price=26990&yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg

    did you try the plugin with a WordPress default theme and WooCommerce only in order to see if the problem persists?

    Of course not. i installed store, plugins, 1 theme. everything is working.

    I’m working on one of my theme. I’m sure of it.

    RU:

    именно это и имею в виду.
    если мы находимся на странице:

    https:// woo.vveb.ws /shopcat/televizori/?min_price=15790&max_price=26990

    то ссылка “LG” должна быть не:

    https:// woo.vveb.ws /shopcat/televizori?yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg

    а:

    https:// woo.vveb.ws /shopcat/televizori?min_price=15790&max_price=26990&yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg

    Вы пробовали плагин с темой WordPress по умолчанию и WooCommerce только для того, чтобы увидеть, сохраняется ли проблема?

    нет конечно. я установил магазин, плагины, 1 тему. всё работает.

    я дорабатываю одну свою тему. я в ней уверен.

    • This reply was modified 2 years ago by v0van.
    • This reply was modified 2 years ago by v0van.
    • This reply was modified 2 years ago by v0van.
    Plugin Support Facundo Arano

    (@aranofacundo)

    Hi there,

    Please, try adding the following PHP code in the functions.php file of your current theme and then check if the issue is solved.

    add_action( 'wp_enqueue_scripts', function() {
    	wp_add_inline_script( 'yith-wcan-shortcodes', <<<EOJS
    	   jQuery( ( $ ) => {
    		  $( document ).on( 'yith_wcan_supported_filters_parameters', ( ev, parameters ) => {
    			 delete parameters[ parameters.indexOf( 'min_price' ) ];
    			 delete parameters[ parameters.indexOf( 'max_price' ) ];
    			 
    			 return parameters;
    		  } );
    	   } );
    	EOJS );
     } );

    Let us know if this helped you.

    Thread Starter v0van

    (@v0van)

    Yes! works!

    Thank you!

    .

    from your code i created plugin yith-woocommerce-ajax-navigation-save-min-max-price.php and activated it.

    .

    if I choose first “price from and to” – https://woo.vveb.ws/shopcat/televizori/?min_price=15790&max_price=26990

    and then “Manufacturer” “LG” – the URL is obtained – https://woo.vveb.ws/shopcat/televizori/?yith_wcan=1&min_price=15790&max_price=26990&product_cat=televizori&filter_proizvoditel_televizora=televizor_-lg&query_type_proizvoditel_televizora=and

    exactly as it should be!

    a parameter appeared in the url: &min_price=15790&max_price=26990

    .

    however, the link remains in the HTML code: https://woo.vveb.ws/shopcat/televizori?yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg
    remembering the “price from and to” occurs in cookies and scripts, and not in the url. strange, but it will do.

    .

    RU:

    да! работает!

    спасибо!

    .

    из Вашего кода я создал плагин yith-woocommerce-ajax-navigation-save-min-max-price.php и активировал его.

    .

    если я выбираю сначала “цену от и до” – https://woo.vveb.ws/shopcat/televizori/?min_price=15790&max_price=26990

    а потом “Производитель” “LG” – получается урл – https://woo.vveb.ws/shopcat/televizori/?yith_wcan=1&min_price=15790&max_price=26990&product_cat=televizori&filter_proizvoditel_televizora=televizor_-lg&query_type_proizvoditel_televizora=and

    именно так как и должно быть!

    в урле появился параметр: &min_price=15790&max_price=26990

    .

    однако в HTML-коде осталась ссылка: https://woo.vveb.ws/shopcat/televizori?yith_wcan=1&product_cat=televizori&query_type_proizvoditel_televizora=and&filter_proizvoditel_televizora=televizor_-lg

    запоминание “цены от и до” происходит в куках и скриптах, а не в урле. странно, но и так сойдёт.

    • This reply was modified 2 years ago by v0van.
    Thread Starter v0van

    (@v0van)

    Will you add this code to your plugin
    or should I make a separate plugin as an addition to yours?

    RU:

    будете ли Вы вносить этот код в Ваш плагин
    или мне имеет смысл сделать отдельный плагин как дополнение к Вашему?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘YITH filter does not save the previously selected filter “Price from and to”’ is closed to new replies.