Advertisement
Guest User

Untitled

a guest
May 13th, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  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 print_r( get_the_terms( $post->id, 'product_cat' ) ); ?>
  26.         <?php
  27.             if ( has_term( 'custom-1', 'product_cat' ) ) {
  28.                 wc_get_template_part( 'content', 'custom-1' );
  29.             } elseif ( has_term( 'custom-2', 'product_cat' ) ) {
  30.                 wc_get_template_part( 'content', 'single-product-custom-2' );
  31.             } else {
  32.                 wc_get_template_part( 'content', 'single-product' );
  33.             }
  34.         ?>
  35.         <?php endwhile; // end of the loop. ?>
  36.  
  37.     <?php
  38.         /**
  39.          * woocommerce_after_main_content hook
  40.          *
  41.          * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
  42.          */
  43.         do_action( 'woocommerce_after_main_content' );
  44.     ?>
  45.  
  46.     <?php
  47.         /**
  48.          * woocommerce_sidebar hook
  49.          *
  50.          * @hooked woocommerce_get_sidebar - 10
  51.          */
  52.         do_action( 'woocommerce_sidebar' );
  53.     ?>
  54.  
  55. <?php get_footer( 'shop' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement