[Support request] Woocommerce edits

Home Forums Support Woocommerce edits

  • This topic has 1 reply, 2 voices, and was last updated 3 weeks ago by David.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1433410
    Mohamed

    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;
    }
    #1433568
    David
    Staff
    Customer Support

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.