Advertisement
BackuPs-nl

rt19 v 2.3.2 outdated content-single-product.php file

May 29th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.93 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying product content in the single-product.php template
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.php.
  6.  *
  7.  * HOWEVER, on occasion WooCommerce will need to update template files and you
  8.  * (the theme developer) will need to copy the new files to your theme to
  9.  * maintain compatibility. We try to do this as little as possible, but it does
  10.  * happen. When this occurs the version of the template file will be bumped and
  11.  * the readme will list any important changes.
  12.  *
  13.  * @see         https://docs.woocommerce.com/document/template-structure/
  14.  * @author      WooThemes
  15.  * @package     WooCommerce/Templates
  16.  * @version     3.0.0
  17.  */
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) {
  20.     exit; // Exit if accessed directly
  21. }
  22.  
  23. global $layout;
  24. ?>
  25.  
  26. <?php
  27.     /**
  28.      * woocommerce_before_single_product hook.
  29.      *
  30.      * @hooked wc_print_notices - 10
  31.      */
  32.     do_action( 'woocommerce_before_single_product' );
  33.  
  34.     if ( post_password_required() ) {
  35.         echo get_the_password_form();
  36.         return;
  37.     }
  38.  
  39.  
  40.     //single content layout
  41.     $single_content_layout = get_post_meta( $post->ID, RT_COMMON_THEMESLUG.'_product_content_layout_options', true);
  42.     $content_width         = $single_content_layout == "new" ? get_post_meta( $post->ID, RT_COMMON_THEMESLUG.'_product_content_width', true) : get_theme_mod( RT_THEMESLUG."_woo_content_width" );
  43.     $content_style         = $single_content_layout == "new" ? get_post_meta( $post->ID, RT_COMMON_THEMESLUG.'_product_content_style', true) : get_theme_mod( RT_THEMESLUG."_woo_content_style" );
  44.     $content_width         = ! empty( $content_width ) ? $content_width : "1/1" ;
  45.     $content_style         = ! empty( $content_style ) ? $content_style : "1" ;
  46.     $share_buttons         =  get_theme_mod( RT_THEMESLUG ."_hide_woo_share_buttons" ) ? false : true;
  47.    
  48.     //layout
  49.     $layout = apply_filters("woo_single_products_layout", array( "share_buttons" => $share_buttons, "content_width" => $content_width, "content_style" => $content_style ) ) ;
  50.  
  51.     extract( $layout ) ;
  52.  
  53.     //calculate tabs content width
  54.     $slider_width = explode("/", $content_width);
  55.     $slider_width = $slider_width[1] - $slider_width[0] ."/". $slider_width[1];
  56.  
  57.     //add row class
  58.     $add_class = "row border_grid single-product";
  59.     $add_class .= $layout["content_width"] != "1/1" ? ' fixed_heights' : '';
  60. ?>
  61.  
  62. <div id="product-<?php the_ID(); ?>" <?php post_class( $add_class ); ?>>
  63.  
  64.     <div class="col <?php echo rt_column_class( $content_width ) ?> col-xs-12">
  65.  
  66.             <meta itemprop="name" content="<?php echo get_the_title();?>">
  67.  
  68.             <?php
  69.             /**
  70.              * Force this row to be 1/1 when content_width (tabs) is not 1/1
  71.              * if content_width is 1/1 make the columns 12/5 (slider) to 12/7 (short info)
  72.              */
  73.             ?>
  74.             <div class="row <?php echo $content_width == "1/1" ? 'fixed_heights' : '';?> ">
  75.                
  76.                 <?php if( $content_width == "1/1" ): ?>
  77.                     <div class="col col-sm-5 col-xs-12">
  78.                 <?php else:?>
  79.                     <div class="col col-sm-12 col-xs-12">
  80.                 <?php endif;?>
  81.  
  82.                         <?php
  83.                             /**
  84.                              * woocommerce_before_single_product_summary hook
  85.                              *
  86.                              * @hooked woocommerce_show_product_sale_flash - 10
  87.                              * @hooked woocommerce_show_product_images - 20
  88.                              */
  89.                             do_action( 'woocommerce_before_single_product_summary' );
  90.                         ?>
  91.  
  92.                 <?php if( $content_width == "1/1" ): ?>
  93.                     </div><!-- end .col -->
  94.                     <div class="col col-sm-7 col-xs-12">
  95.                 <?php endif;?>
  96.  
  97.                         <div class="summary entry-summary">
  98.  
  99.                             <?php
  100.                                 /**
  101.                                  * woocommerce_single_product_summary hook.
  102.                                  *
  103.                                  * @hooked woocommerce_template_single_title - 5
  104.                                  * @hooked woocommerce_template_single_rating - 10
  105.                                  * @hooked woocommerce_template_single_price - 10
  106.                                  * @hooked woocommerce_template_single_excerpt - 20
  107.                                  * @hooked woocommerce_template_single_add_to_cart - 30
  108.                                  * @hooked rt_woocommerce_template_single_sharing - 35
  109.                                  * @hooked woocommerce_template_single_meta - 40
  110.                                  * @hooked woocommerce_template_single_sharing - 50
  111.                                  * @hooked WC_Structured_Data::generate_product_data() - 60                  
  112.                                  */
  113.                                 do_action( 'woocommerce_single_product_summary' );
  114.                             ?>
  115.  
  116.                         </div><!-- .summary -->
  117.  
  118.                 </div><!-- end .col -->
  119.  
  120.             </div><!-- end .row -->
  121.  
  122.     </div><!-- end .col -->
  123.  
  124. <?php if( $content_width == "1/1" ): ?>
  125. </div>
  126. <div class="row product_content_row">
  127. <?php endif;?>
  128.  
  129.     <div class="col <?php echo rt_column_class( $slider_width ) ?>  col-xs-12">
  130.  
  131.         <?php
  132.             /**
  133.              * woocommerce_after_single_product_summary hook
  134.              *
  135.              * @hooked woocommerce_output_product_data_tabs - 10
  136.              * @hooked woocommerce_upsell_display - 15
  137.              * @hooked woocommerce_output_related_products - 20
  138.              */
  139.             do_action( 'woocommerce_after_single_product_summary' );
  140.         ?>
  141.     </div><!-- end .col -->
  142.  
  143.  
  144. </div><!-- #product-<?php the_ID(); ?> -->
  145.  
  146. <?php do_action( 'woocommerce_after_single_product' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement