/**
 * Move WooCommerce categories outside the container.
 */
function kalium_woocommerce_bookstore_displace_categories() {
	$container_wrapped_categories = function() {
		wc_set_loop_prop( 'columns', 10 );
		echo sprintf( '<div class="container shop-categories-heading">%s</div>', kalium_woocommerce_wrapped_categories() );
	};

	add_action( 'woocommerce_before_main_content', $container_wrapped_categories, 4 );

	remove_action( 'wp_loaded', 'kalium_woocommerce_separate_categories_from_products_container' );
	remove_action( 'woocommerce_product_loop_start', 'woocommerce_maybe_show_product_subcategories' );
}

add_action( 'woocommerce_init', 'kalium_woocommerce_bookstore_displace_categories' );
