Answer the question
In order to leave comments, you need to log in
How to sort by large label match?
Good afternoon.
WOOCOMMERCE has a related.php file that displays related (similar) products on the product page, sorting is currently on:
global $product, $porto_settings, $porto_woocommerce_loop;
if ( empty( $product ) || ! $product->exists() ) {
return;
}
$related = wc_get_related_products( $product->get_id(), $porto_settings['product-related-count'] );
if ( sizeof( $related ) === 0 || ! $porto_settings['product-related'] ) {
return;
}
$args = apply_filters(
'woocommerce_related_products_args',
array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'no_found_rows' => 1,
'posts_per_page' => $porto_settings['product-related-count'],
'orderby' => 'rand',
'tag__in' => $tag_ids,
'post__not_in' => array( $product->get_id() ),
)
);
$products = new WP_Query( $args );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question