Site logo

Archived topic

Woocommerce edits

1 reply · Started by Mohamed on September 6, 2020

Viewing posts 1–2 of 2

Hello there,

1-I added a two buttons (add to basket + show details) to product list, But I need the height of Li tag expand to fit its content on all screen sizes and width also

2-I was needed the related products be 3 on pc and 4 on mobile (in the product page)
and I used this code, is this the best method?

function woo_related_products_limit() {
global $product;
$args['posts_per_page'] = 6;
return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' );
function jk_related_products_args( $args ) {

if(wp_is_mobile()){
$args['posts_per_page'] = 4; //  related products
} else{
$args['posts_per_page'] = 3;
}

$args['columns'] = 2; // arranged in 2 columns
return $args;
}

Hi there,

can you explain a little more on #1 - maybe a screenshot of what you're wanting to do?

2. Yes that method is the only way ( without custom development ) to filter the content specifically for mobile devices.

This archived topic is closed to new replies.