Home › Forums › WoodMart support forum › On Product Page Move Product tab and Related Products › Reply To: On Product Page Move Product tab and Related Products
January 23, 2018 at 10:54 am
#34960
Artem Temos
Keymaster
Hi,
There is no such function in our theme so you will need to make some extra customization to achieve this.
1. Add this snippet to the functions.php
file in the child theme
add_action( 'wp', 'woodmart_disable_related', 10000 );
function woodmart_disable_related() {
remove_action( 'woodmart_woocommerce_after_sidebar', 'woocommerce_output_related_products', 20 );
}
2. Create a file woodmart-child/woocommerce/content-single-product.php
with the following content
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$product_images_class = woodmart_product_images_class();
$product_summary_class = woodmart_product_summary_class();
$single_product_class = woodmart_single_product_class();
$content_class = woodmart_get_content_class();
$product_design = woodmart_product_design();
$container_summary = 'container';
if( woodmart_get_opt( 'single_full_width' ) ) {
$container_summary = 'container-fluid';
}
?>
<?php if ( $product_design == 'alt' ): ?>
<div class="single-breadcrumbs-wrapper">
<div class="container">
<?php woocommerce_breadcrumb(); ?>
<?php if ( woodmart_get_opt( 'products_nav' ) ): ?>
<?php woodmart_products_nav(); ?>
<?php endif ?>
</div>
</div>
<?php endif ?>
<div class="container">
<?php
do_action( 'woocommerce_before_single_product' );
?>
</div>
<div id="product-<?php the_ID(); ?>" <?php post_class( $single_product_class ); ?>>
<div class="<?php echo esc_attr( $container_summary ); ?>">
<div class="row product-image-summary-wrap">
<div class="product-image-summary <?php echo esc_attr( $content_class ); ?>">
<div class="row product-image-summary-inner">
<div class="<?php echo esc_attr( $product_images_class ); ?> product-images">
<div class="product-images-inner">
<?php
do_action( 'woocommerce_before_single_product_summary' );
?>
</div>
</div>
<div class="<?php echo esc_attr( $product_summary_class ); ?> summary entry-summary">
<div class="summary-inner">
<?php if ( $product_design == 'default' ): ?>
<div class="single-breadcrumbs-wrapper">
<div class="single-breadcrumbs">
<?php woocommerce_breadcrumb(); ?>
<?php if ( woodmart_get_opt( 'products_nav' ) ): ?>
<?php woodmart_products_nav(); ?>
<?php endif ?>
</div>
</div>
<?php endif ?>
<?php
do_action( 'woocommerce_single_product_summary' );
?>
</div>
</div>
</div><!-- .summary -->
<div class="product-tabs-wrapper">
<div class="container">
<div class="row">
<div class="col-sm-12 poduct-tabs-inner">
<?php
do_action( 'woocommerce_after_single_product_summary' );
?>
</div>
</div>
</div>
</div>
</div>
<?php
do_action( 'woocommerce_sidebar' );
?>
</div>
<?php
do_action( 'woodmart_after_product_content' );
?>
</div>
<?php
do_action( 'woodmart_after_product_tabs' );
?>
</div><!-- #product-<?php the_ID(); ?> -->
<?php do_action( 'woocommerce_after_single_product' ); ?>
Regards