[[Woocommerce]] - Displaying product variation inside loop (4 posts)

  1. adamccc
    Posted 3 years ago #

    Currently in Woocommerce if you have a variable product, it will replace the 'add to basket' button with a 'select options' which then takes you to the product page were you can select the option from dropdown and then add to your basket -


    I'm looking to modify this so if the product has variations - display the dropdown in the loop_shop.php with a 'add to basket' button so users can add variable products to their basket straight from the catalogue page - like this:


    Tried pulling in some of variable.php but can't seem to get it to work, wondered if anyone had come across this or has a solution

  2. sk
    Posted 3 years ago #

    Would be awesome, I'm looking to do something like this too. Have you had any luck yet?

    The file single-product\add-to-cart\variable.php handles the processing, so would need to modify this then call it on the product archive page. If I have any luck I'll post back but might be a bit too much for me.

  3. adamccc
    Posted 3 years ago #

  4. tubo
    Posted 3 years ago #

    I got this from a good friend in the past:

    in /woocommerce/content-product.php
    look for do_action( 'woocommerce_after_shop_loop_item' ); and replace it by :

    remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
    do_action( 'woocommerce_after_shop_loop_item' );

    Edit the original and create a new file, same name: content-product.php and place it in the themes folder inside woocommerce subfolder. This will do the job, style it and done!

Topic Closed

This topic has been closed to new replies.

About this Topic