Advertisement
Guest User

pro3-child/templates/product-style1.php

a guest
Dec 7th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. <?php global $mp;
  2. /**
  3. * Single Product Page Template - Default Layout
  4. */
  5.  
  6. $post_id = get_the_ID();
  7. $pinit_setting = $mp->get_setting('social->pinterest->show_pinit_button');
  8. $btnclass = mpt_load_mp_btn_color();
  9. $tagcolor = mpt_load_icontag_color();
  10. $labelcolor = mpt_load_mp_label_color();
  11. $meta_prefix = '_mpt_';
  12. $contenttextcolor = esc_attr(get_post_meta( $post_id , $meta_prefix . 'post_content_text_color', true ));
  13. ?>
  14.  
  15. <div class="product-title">
  16. <h1><span<?php echo ($contenttextcolor != '#' && !empty($contenttextcolor) ? ' style="color: '.$contenttextcolor.';"' : '') ?>> <?php the_title(); ?> <?php echo do_shortcode('[mr_rating_form]'); ?> </span></h1>
  17. <div class="product-price align-right">
  18. <?php
  19.  
  20. pro_product_price( array( 'echo' => true , 'post_id' => $post_id , 'label' => '<i class="icon-tags'.$tagcolor.'"></i> ' . __( 'Price: ' , 'pro' ) , 'context' => 'widget'
  21. ) );
  22.  
  23. echo ( function_exists('mp_pinit_button') && $pinit_setting != 'off' ? '<div class="single-page-pinit-btn">' . mp_pinit_button( $post_id ) . '</div>' : '' );
  24. ?>
  25. </div>
  26. </div>
  27.  
  28. <?php mpt_load_top_code(); ?>
  29.  
  30. <div class="product-upfold-contents row-fluid">
  31.  
  32. <?php
  33.  
  34. $default_img_url = esc_url( get_option('mpt_mp_default_product_img') );
  35. $default_img_id = ( !empty($default_img_url) ? intval( get_image_id( $default_img_url ) ) : NULL );
  36.  
  37. if ( has_post_thumbnail( $post_id ) || ( !empty($default_img_id) && is_numeric($default_img_id) ) ) {
  38. echo '<div class="span6">' . pro_product_page_load_images( array(
  39. 'post_id' => $post_id,
  40. 'default_img_id' => $default_img_id,
  41. ) ) . '</div>';
  42. echo '<div class="span6">';
  43. } else {
  44. echo '<div class="span12">';
  45. }
  46. ?>
  47.  
  48. <div class="product-categories">
  49.  
  50. <?php echo __( 'Categorized in:', 'pro' ) . '<br />' . pro_load_product_page_tags( array( 'post_id' => $post_id ) ); ?>
  51.  
  52. </div>
  53.  
  54. <?php
  55. if ( get_option('mpt_pro_page_show_product_short_desc') != 'false' )
  56. echo '<div class="product-excerpt">' . ( !empty($post->post_excerpt) ? $post->post_excerpt : ( !empty($post->post_content) ? wp_trim_words($post->post_content , 20 ) : '' ) ) . '</div>';
  57. ?>
  58.  
  59. <?php
  60.  
  61. $proprice_args = array(
  62. 'echo' => false,
  63. 'post_id' => $post_id,
  64. 'label' => false,
  65. 'context' => ''
  66. );
  67.  
  68. if ( pro_product_price( $proprice_args ) != '') : ?>
  69.  
  70. <div class="product-pricing">
  71. <?php echo pro_product_price( $proprice_args ); ?>
  72. </div>
  73.  
  74. <?php endif; ?>
  75.  
  76. <div class="product-buy-now align-left">
  77.  
  78. <?php
  79.  
  80. $buybtn_args = array(
  81. 'echo' => true,
  82. 'post_id' => $post_id,
  83. 'btnclass' => $btnclass . ' btn-block',
  84. 'context' => 'single'
  85. );
  86.  
  87. pro_buy_button( $buybtn_args );
  88. ?>
  89.  
  90. </div>
  91.  
  92. </div>
  93.  
  94. </div> <!-- End product-upfold-contents -->
  95.  
  96. <div class="clear"></div>
  97.  
  98. <!-- Content tabs -->
  99.  
  100. <div class="product-content-tabs">
  101.  
  102. <!-- menu -->
  103. <ul class="nav nav-tabs producttab" id="producttab" data-tabs="tabs">
  104.  
  105. <?php
  106. $comments_number = get_comments_number( $post_id );
  107. $get_cp_structure = esc_attr( get_option('mpt_pro_page_custom_field_structure') );
  108. $cp_customfields_structure = ( !empty( $get_cp_structure ) ? $get_cp_structure : 'table' );
  109. $cp_customfields = ( get_option('mpt_pro_page_show_custom_field') == 'true' ? do_shortcode("[custom_fields_block wrap='{$cp_customfields_structure}']") : '' );
  110. $producttab_links = '<li class="active"><a href="#product-contents" data-toggle="tab">' . __('Product Description', 'pro') . '</a></li>';
  111. $producttab_links .= ( !empty($cp_customfields) && pro_check_if_cf_available() ? '<li><a href="#product-extra-info" data-toggle="tab">'.__( 'Additional Info' , 'pro' ).'</a></li>' : '' );
  112. $producttab_links .= ( comments_open() ? '<li><a href="#product-comments" data-toggle="tab">' . __('Comments ', 'pro') . ( !empty($comments_number) ? '(' . esc_attr($comments_number) . ')' : '' ) . '</a></li>' : '' );
  113. echo apply_filters( 'pro_product_page_producttab_links' , $producttab_links , $post_id );
  114. ?>
  115.  
  116. </ul>
  117. <!-- product description -->
  118. <div class="tab-content">
  119. <!-- contents -->
  120. <div class="tab-pane fade in active" id="product-contents">
  121.  
  122. <?php
  123. the_content();
  124. edit_post_link( __('Edit this entry.','pro') , '<p class="margin-vertical-15">', '</p>');
  125. ?>
  126.  
  127. </div>
  128.  
  129. <!-- Additional Info -->
  130. <?php
  131. if ( !empty($cp_customfields) && pro_check_if_cf_available() )
  132. echo '<div class="tab-pane fade" id="product-extra-info">' . $cp_customfields . '</div>';
  133. ?>
  134.  
  135. <!-- reviews -->
  136. <?php if ( comments_open() ) : ?>
  137. <div class="tab-pane fade" id="product-comments">
  138. <?php comments_template(); ?>
  139. </div>
  140. <?php endif; ?>
  141.  
  142. <?php do_action( 'pro_product_page_custom_product_tabs' , $post_id ); ?>
  143.  
  144. </div>
  145.  
  146. </div>
  147. <!-- End Content Tabs -->
  148.  
  149. <div class="clear"></div>
  150.  
  151. <!-- Related Products -->
  152. <?php
  153. $related_args = array(
  154. 'echo' => true,
  155. 'querytype' => get_option('mpt_pro_page_related_products_query_type'),
  156. 'current_post' => $post_id,
  157. 'btnclass' => $btnclass,
  158. 'labelcolor' => $labelcolor
  159. );
  160.  
  161. if ( get_option('mpt_pro_page_enable_related_products_feature') != 'false' ) {
  162.  
  163. if ( is_multisite() && function_exists('pro_load_global_related_products') && get_option('mpt_pro_page_enable_global_related_products') == 'true' )
  164. pro_load_global_related_products( $related_args );
  165. else
  166. pro_load_related_products( $related_args );
  167.  
  168. echo '<div class="clear"></div>';
  169. }
  170.  
  171. mpt_load_bottom_code();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement