superspeedyplugins / issue-tracker

Submit bugs and feature requests for any of our plugins
0 stars 0 forks source link

Make Super Speedy Filters sort order be compatible with Enfold and other tools which change the sort order or sort order parameters #206

Open thinkjarvisdesignandmarketing opened 2 months ago

thinkjarvisdesignandmarketing commented 2 months ago

IMPORTANT CONTEXT we have the default woocommerce dropdown filters for default, price, popularity and relevance still enabled.

These simply stop working when Super Speedy Filters

I would have expected these to work. A query string is added to the url when clicked.

Please can you confirm if these filters should be working when super speedy filters is installed and why they would suddenly stop working.

I can send test area details privately.

thinkjarvisdesignandmarketing commented 2 months ago

The shop root /shop/ seems to work high to low but categories do not when super speedy filters is enabled.

dhilditch commented 2 months ago

This is not related to filters, it's related to ordering the results.

dhilditch commented 2 months ago

@thinkjarvisdesignandmarketing can you tell me the URL parameters you have when you enable sorting?

I've tested numerous filters on my local with the likes or ?orderby=price-asc ?orderby=price-desc etc and they are working as expected.

thinkjarvisdesignandmarketing commented 2 months ago

Sorry @dhilditch

I've just realised Enfold puts the following on the query. ?avia_extended_shop_select=yes&product_order=price Then when you select the order: ?avia_extended_shop_select=yes&product_order=price&product_sort=desc

If I use product_order=price it breaks the filter if I use the two strings you suggested it works.

Not entirely sure why they would have changed this.

Ill ask support for more information.

This is the standard way enfold filters things. Is there a way to make this compatible with SSF?

thinkjarvisdesignandmarketing commented 2 months ago

Example here: https://www.pinntecdirect.com/product-category/computing-and-peripherals/monitors-televisions-and-accessories/televisions/

thinkjarvisdesignandmarketing commented 2 months ago

TIcket raised to ask https://kriesi.at/support/topic/bug-avia_extended_shop_selectyes-breaks-the-filters

thinkjarvisdesignandmarketing commented 1 month ago

Solution: Reinstate the default woo dropdowns - Applies to all Enfold sites:

The default woo filters are dequeued in enfold > config-woocommerce > config.php and config-365.php

We can requeue them and disable the Enfold filters by adding the following to functions.php in the child theme:

// Removes Enfolds sort by dropdowns
function avia_woocommerce_frontend_search_params()
{
   return;
}

// Re-adds the default sortby dropdown
add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 1 );

Styling fixes Add the following css:

@media only screen and (max-width: 767px) {
    .responsive #top .woocommerce-ordering {
        position: relative;
        float: left;
        clear: both;
        margin: 0;
        padding-bottom: 25px;
    }
}

@media only screen and (min-width: 768px) {
    .responsive #top .woocommerce-ordering {
        position: relative;
        float: left;
        clear: both;
        margin: 0;
        padding-bottom: 25px;
    }
}

#top.woocommerce-page .woocommerce-ordering select {
 width: 100%;
}