Skip to content

Instantly share code, notes, and snippets.

@Acephalia
Last active March 17, 2023 22:55
Show Gist options
  • Save Acephalia/46f22c1045e20a8107b0b9c54c30b94f to your computer and use it in GitHub Desktop.
Save Acephalia/46f22c1045e20a8107b0b9c54c30b94f to your computer and use it in GitHub Desktop.
Show Variations On Woocommerce Shop Page
/* Variation drop down will need to be styled to match theme. Use this as a starting point. */
li.product-type-variable td {
float: left;
}
#main li.product input {
float: none;
}
//Show Variations On Shop Page
add_action( 'woocommerce_before_shop_loop', 'another_handsome_bearded_guy_select_variations' );
function another_handsome_bearded_guy_select_variations() {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 30 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment