PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

filter-result page displays incorrect

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi,

When I set the filter on a product categorie, the results page shows the products in a strange kind of grid while it should be in 4 rows (on desktop).
https://lab-meubilair.nl/droogstoven/

(I'm using the plugin with exact the same settings on another website (same product, same theme, same page builder). On that other website, the display is correct.)

Kind regards,

Linda

Hello Linda

Please  try  to  disable  ajax  mode.

If  no  luck  - Advanced->Options- https://share.pluginus.net/image/i20230124093213.png  and  do a test

Are you using any custom code for the filter?

Hi Pablo,

Thanks for your reply!

I already disabled ajax mode before but unfortunately, I didn't work out.
In the advanced sections I set the default swoof influence to yes but it also didn't help.
There is some custom css code I'm using and to test if that was the problem, I removed it and tested again without any result.

As I mentioned before I'm using this plugin also on another Woocommerce website with the same settings and there it works fine...

Any idea how to solve it?

Hello Linda

I see that a third party script changes the URL. if I change the swoof=1 parameter in the URL, then the third-party script will completely remove the search query( https://share.pluginus.net/video/v20230125104832.mp4 ) This could be the reason

also you don't have shop template configured. This can also cause products to display incorrectly.

can  you drop me wp-admin access - https://share.pluginus.net/image/i20210618130558.png ->  https://share.pluginus.net/image/i20210618130637.png

Hi Pablo,

I'm using some functions (in the functions.php) to remove the category-slug and product-slug. This I'm using also on the website I mentioned where everything works fine (see script below)
The website I'm talking about (where everything works fine) is apollo-labequipment.nl

/*
Code Purpose : Remove woocommerce product-category slug
*/
add_filter('request', function( $vars ) {
global $wpdb;
if( ! empty( $vars['pagename'] ) || ! empty( $vars['category_name'] ) || ! empty( $vars['name'] ) || ! empty( $vars['attachment'] ) ) {
$slug = ! empty( $vars['pagename'] ) ? $vars['pagename'] : ( ! empty( $vars['name'] ) ? $vars['name'] : ( !empty( $vars['category_name'] ) ? $vars['category_name'] : $vars['attachment'] ) );
$exists = $wpdb->get_var( $wpdb->prepare("SELECT t.term_id FROM $wpdb->terms t LEFT JOIN $wpdb->term_taxonomy tt ON tt.term_id = t.term_id WHERE tt.taxonomy = 'product_cat' AND t.slug = %s" ,array( $slug )));
if( $exists ){
$old_vars = $vars;
$vars = array('product_cat' => $slug );
if ( !empty( $old_vars['paged'] ) || !empty( $old_vars['page'] ) )
$vars['paged'] = ! empty( $old_vars['paged'] ) ? $old_vars['paged'] : $old_vars['page'];
if ( !empty( $old_vars['orderby'] ) )
$vars['orderby'] = $old_vars['orderby'];
if ( !empty( $old_vars['order'] ) )
$vars['order'] = $old_vars['order'];
}
}
return $vars;
});

add_filter('term_link', 'term_link_filter', 10, 3);
function term_link_filter( $url, $term, $taxonomy ) {
$url=str_replace("/./","/",$url);
return $url;
}
/*
!! END !! Code Purpose : Remove woocommerce product-category slug
*/

/*
Code Purpose : Remove woocommerce product slug
*/
function na_remove_slug( $post_link, $post, $leavename ) {
if ( 'product' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/product/', '/', $post_link );
return $post_link;
}
add_filter( 'post_type_link', 'na_remove_slug', 10, 3 );

function change_slug_struct( $query ) {

if ( ! $query->is_main_query() || 2 != count( $query->query ) || ! isset( $query->query['page'] ) ) {
return;
}

if ( ! empty( $query->query['name'] ) ) {
$query->set( 'post_type', array( 'post', 'product', 'page' ) );
} elseif ( ! empty( $query->query['pagename'] ) && false === strpos( $query->query['pagename'], '/' ) ) {
$query->set( 'post_type', array( 'post', 'product', 'page' ) );

// We also need to set the name query var since redirect_guess_404_permalink() relies on it.
$query->set( 'name', $query->query['pagename'] );
}
}
add_action( 'pre_get_posts', 'change_slug_struct', 99 );
/*
!! END !! Code Purpose : Remove woocommerce product slug
*/

Hello

Ok!  Can I  disable  plugins/theme  to test?

Yes, this code may be incompatible( I'm 90% sure ) with filtering

This I'm using also on the website I mentioned where everything works fine  - I figured it out but better check

I set up the filter  - https://c2n.me/4hG0ZHc

Hi Pablo,

Lookin great now. Was it because of the CSS?

And do you still need to disable plugins/theme to test? In that case I'll first have to create a staging website.

Kind regards,

Linda

Hello  Linda

Was it because of the CSS?  - I made the settings that I wrote to you before - https://c2n.me/4hHKopj.png

And do you still need to disable plugins/theme to test? - not if everything works well

Hi Pablo,

Everything seems to work fine now.
Thank you very much!

Kind regards,

Linda

Hello Linda

Welcome;)