Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 102102

k.devantoni on "[Plugin: WooCommerce - excelling eCommerce] Different page layouts for category vs subcategory?"

$
0
0

Okie got it fixed
http://wordpress.stackexchange.com/questions/3507/custom-field-values-in-permalink/3517#3517

<?php
global $post;
$terms = wp_get_post_terms( $post->ID, 'product_cat' );
foreach ( $terms as $term ) $categories[] = $term->slug;

if ( in_array( 'audio', $categories ) ) {
  echo 'In audio';
  woocommerce_get_template_part( 'content', 'single-product' );
} elseif ( in_array( 'elektro', $categories ) ) {
  echo 'In elektro';
  woocommerce_get_template_part( 'content', 'single-product' );
} else {
  echo 'some blabla';
} ?>

Viewing all articles
Browse latest Browse all 102102

Trending Articles