Change Group Style / Layout for Products / Categories

Filter & Hooks Viewed: 1345

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 Group Style / Layout for Products / Categories

Leave a Reply

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