I'm currently building a custom WP theme with WooCommerce integration. So a little background first. My theme is using Foundation 6. I have disabled the WooCommerce styles and layouts. I am using overriding templates so that I can integrate Foundation.
My shop page is listing product categories, not individual products. Then once a category is selected, you get another list of sub-categories, then finally the products.
I'm able to put the products into 4 column rows just fine with the following code:
loop-start.php
<div class="row">
archive-product.php
<?php woocommerce_product_loop_start(); ?>
<?php woocommerce_product_subcategories(); ?>
<?php $counter = 1; while ( have_posts() ) : the_post(); ?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php
if( $counter % 4 == 0 ) : echo '</div><div class="row">'; endif;
$counter++;
endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
loop-end.php
</div>
content-product.php
<div <?php if($wcp_last_loop) : post_class('medium-3 columns end'); else : post_class('medium-3 columns'); endif; ?>>
<?php
/**
* woocommerce_before_shop_loop_item hook.
*
* @hooked woocommerce_template_loop_product_link_open - 10
*/
do_action( 'woocommerce_before_shop_loop_item' );
/**
* woocommerce_before_shop_loop_item_title hook.
*
* @hooked woocommerce_show_product_loop_sale_flash - 10
* @hooked woocommerce_template_loop_product_thumbnail - 10
*/
do_action( 'woocommerce_before_shop_loop_item_title' );
/**
* woocommerce_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_product_title - 10
*/
do_action( 'woocommerce_shop_loop_item_title' );
/**
* woocommerce_after_shop_loop_item_title hook.
*
* @hooked woocommerce_template_loop_rating - 5
* @hooked woocommerce_template_loop_price - 10
*/
do_action( 'woocommerce_after_shop_loop_item_title' );
/**
* woocommerce_after_shop_loop_item hook.
*
* @hooked woocommerce_template_loop_product_link_close - 5
* @hooked woocommerce_template_loop_add_to_cart - 10
*/
do_action( 'woocommerce_after_shop_loop_item' );
?>
</div>
So this works great for products not categories though. I know the categories and subcategories are being pulled in by
<?php woocommerce_product_subcategories(); ?>
I also know I will have to use a hook or filter to put every 4 categories in a row, but I'm not well versed in WP hooks and filters, so are struggling to find a solution. I've been trying to read up on hooks and filters, but are hoping to find some help more specific to what I'm trying to do.
Any advice would be greatly appreciated.