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;
}