Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php global $mp;
- /**
- * Single Product Page Template - Default Layout
- */
- $post_id = get_the_ID();
- $pinit_setting = $mp->get_setting('social->pinterest->show_pinit_button');
- $btnclass = mpt_load_mp_btn_color();
- $tagcolor = mpt_load_icontag_color();
- $labelcolor = mpt_load_mp_label_color();
- $meta_prefix = '_mpt_';
- $contenttextcolor = esc_attr(get_post_meta( $post_id , $meta_prefix . 'post_content_text_color', true ));
- ?>
- <div class="product-title">
- <h1><span<?php echo ($contenttextcolor != '#' && !empty($contenttextcolor) ? ' style="color: '.$contenttextcolor.';"' : '') ?>> <?php the_title(); ?> <?php echo do_shortcode('[mr_rating_form]'); ?> </span></h1>
- <div class="product-price align-right">
- <?php
- pro_product_price( array( 'echo' => true , 'post_id' => $post_id , 'label' => '<i class="icon-tags'.$tagcolor.'"></i> ' . __( 'Price: ' , 'pro' ) , 'context' => 'widget'
- ) );
- echo ( function_exists('mp_pinit_button') && $pinit_setting != 'off' ? '<div class="single-page-pinit-btn">' . mp_pinit_button( $post_id ) . '</div>' : '' );
- ?>
- </div>
- </div>
- <?php mpt_load_top_code(); ?>
- <div class="product-upfold-contents row-fluid">
- <?php
- $default_img_url = esc_url( get_option('mpt_mp_default_product_img') );
- $default_img_id = ( !empty($default_img_url) ? intval( get_image_id( $default_img_url ) ) : NULL );
- if ( has_post_thumbnail( $post_id ) || ( !empty($default_img_id) && is_numeric($default_img_id) ) ) {
- echo '<div class="span6">' . pro_product_page_load_images( array(
- 'post_id' => $post_id,
- 'default_img_id' => $default_img_id,
- ) ) . '</div>';
- echo '<div class="span6">';
- } else {
- echo '<div class="span12">';
- }
- ?>
- <div class="product-categories">
- <?php echo __( 'Categorized in:', 'pro' ) . '<br />' . pro_load_product_page_tags( array( 'post_id' => $post_id ) ); ?>
- </div>
- <?php
- if ( get_option('mpt_pro_page_show_product_short_desc') != 'false' )
- echo '<div class="product-excerpt">' . ( !empty($post->post_excerpt) ? $post->post_excerpt : ( !empty($post->post_content) ? wp_trim_words($post->post_content , 20 ) : '' ) ) . '</div>';
- ?>
- <?php
- $proprice_args = array(
- 'echo' => false,
- 'post_id' => $post_id,
- 'label' => false,
- 'context' => ''
- );
- if ( pro_product_price( $proprice_args ) != '') : ?>
- <div class="product-pricing">
- <?php echo pro_product_price( $proprice_args ); ?>
- </div>
- <?php endif; ?>
- <div class="product-buy-now align-left">
- <?php
- $buybtn_args = array(
- 'echo' => true,
- 'post_id' => $post_id,
- 'btnclass' => $btnclass . ' btn-block',
- 'context' => 'single'
- );
- pro_buy_button( $buybtn_args );
- ?>
- </div>
- </div>
- </div> <!-- End product-upfold-contents -->
- <div class="clear"></div>
- <!-- Content tabs -->
- <div class="product-content-tabs">
- <!-- menu -->
- <ul class="nav nav-tabs producttab" id="producttab" data-tabs="tabs">
- <?php
- $comments_number = get_comments_number( $post_id );
- $get_cp_structure = esc_attr( get_option('mpt_pro_page_custom_field_structure') );
- $cp_customfields_structure = ( !empty( $get_cp_structure ) ? $get_cp_structure : 'table' );
- $cp_customfields = ( get_option('mpt_pro_page_show_custom_field') == 'true' ? do_shortcode("[custom_fields_block wrap='{$cp_customfields_structure}']") : '' );
- $producttab_links = '<li class="active"><a href="#product-contents" data-toggle="tab">' . __('Product Description', 'pro') . '</a></li>';
- $producttab_links .= ( !empty($cp_customfields) && pro_check_if_cf_available() ? '<li><a href="#product-extra-info" data-toggle="tab">'.__( 'Additional Info' , 'pro' ).'</a></li>' : '' );
- $producttab_links .= ( comments_open() ? '<li><a href="#product-comments" data-toggle="tab">' . __('Comments ', 'pro') . ( !empty($comments_number) ? '(' . esc_attr($comments_number) . ')' : '' ) . '</a></li>' : '' );
- echo apply_filters( 'pro_product_page_producttab_links' , $producttab_links , $post_id );
- ?>
- </ul>
- <!-- product description -->
- <div class="tab-content">
- <!-- contents -->
- <div class="tab-pane fade in active" id="product-contents">
- <?php
- the_content();
- edit_post_link( __('Edit this entry.','pro') , '<p class="margin-vertical-15">', '</p>');
- ?>
- </div>
- <!-- Additional Info -->
- <?php
- if ( !empty($cp_customfields) && pro_check_if_cf_available() )
- echo '<div class="tab-pane fade" id="product-extra-info">' . $cp_customfields . '</div>';
- ?>
- <!-- reviews -->
- <?php if ( comments_open() ) : ?>
- <div class="tab-pane fade" id="product-comments">
- <?php comments_template(); ?>
- </div>
- <?php endif; ?>
- <?php do_action( 'pro_product_page_custom_product_tabs' , $post_id ); ?>
- </div>
- </div>
- <!-- End Content Tabs -->
- <div class="clear"></div>
- <!-- Related Products -->
- <?php
- $related_args = array(
- 'echo' => true,
- 'querytype' => get_option('mpt_pro_page_related_products_query_type'),
- 'current_post' => $post_id,
- 'btnclass' => $btnclass,
- 'labelcolor' => $labelcolor
- );
- if ( get_option('mpt_pro_page_enable_related_products_feature') != 'false' ) {
- if ( is_multisite() && function_exists('pro_load_global_related_products') && get_option('mpt_pro_page_enable_global_related_products') == 'true' )
- pro_load_global_related_products( $related_args );
- else
- pro_load_related_products( $related_args );
- echo '<div class="clear"></div>';
- }
- mpt_load_bottom_code();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement