Advertisement
Guest User

Untitled

a guest
May 13th, 2014
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * The Template for displaying all single products.
  4.  *
  5.  * Override this template by copying it to yourtheme/woocommerce/single-product.php
  6.  *
  7.  * @author      WooThemes
  8.  * @package     WooCommerce/Templates
  9.  * @version     1.6.4
  10.  */
  11.  
  12. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  13.  
  14. get_header( 'shop' ); ?>
  15.  
  16.     <?php
  17.         /**
  18.          * woocommerce_before_main_content hook
  19.          *
  20.          * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
  21.          * @hooked woocommerce_breadcrumb - 20
  22.          */
  23.         do_action( 'woocommerce_before_main_content' );
  24.     ?>
  25.         <?php while ( have_posts() ) : the_post(); ?>
  26.  
  27.             <?php print_r( get_the_terms( $product->id, 'product_cat' ) ); ?>
  28.  
  29.         <?php
  30.             if ( has_term( 'custom-1', 'product_cat' ) ) {
  31.                 wc_get_template_part( 'content', 'custom-1' );
  32.             } elseif ( has_term( 'custom-2', 'product_cat' ) ) {
  33.                 wc_get_template_part( 'content', 'single-product-custom-2' );
  34.             } else {
  35.                 wc_get_template_part( 'content', 'single-product' );
  36.             }
  37.         ?>
  38.  
  39.         <?php endwhile; // end of the loop. ?>
  40.  
  41.     <?php
  42.         /**
  43.          * woocommerce_after_main_content hook
  44.          *
  45.          * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
  46.          */
  47.         do_action( 'woocommerce_after_main_content' );
  48.     ?>
  49.  
  50.     <?php
  51.         /**
  52.          * woocommerce_sidebar hook
  53.          *
  54.          * @hooked woocommerce_get_sidebar - 10
  55.          */
  56.         do_action( 'woocommerce_sidebar' );
  57.     ?>
  58.  
  59. <?php get_footer( 'shop' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement