Change Attribute Group Layout for Products or Categories

You can change the group attributes layout for custom single products or categories with the below filter.

In this example the product ID 87 gets the layout 2 and the product with the ID 333 the layout 3.

function modify_group_attributes_layout( $layout, $product_id) {

	if($product_id == 87) {
		$layout = 2;
	}
	if($product_id == 333) {
		$layout = 3;
	}
    return $layout;
}
add_filter( 'woocommerce_group_attributes_layout', 'modify_group_attributes_layout', 10, 2 );

2 thoughts on “Change Attribute Group Layout for Products or Categories

    • WeLaunch

      The Real Person!

      Author WeLaunch acts as a real person and verified as not a bot.
      Passed all tests against spam bots. Anti-Spam by CleanTalk.
      says:

      You can hide the attribute name with this CSS:

      .attribute_group_name {
      	display: none;
      }
      

Leave a Reply

Your email address will not be published. Required fields are marked *