Home Forums WoodMart support forum On Product Page Move Product tab and Related Products

On Product Page Move Product tab and Related Products

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34938

    Haresh
    Participant

    Hello,

    I Want to move “Product Tab” and “Related Products” section, after product image summary section. Please check my screenshot.

    Any help will be appreciated.

    Thanks in advance!

    Attachments:
    You must be logged in to view attached files.
    #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

    #34963

    Haresh
    Participant

    Hello,

    Thank you so much for your kind response, it is working perfectly for only “Product Tab“. But “Related Product” section is not showing. Can you please check it once. I want to show it after “Product Tab”.

    Thanks.

    #34977

    Artem Temos
    Keymaster

    Sorry, try to replace the code for functions.php file with this one

    add_action( 'wp', 'woodmart_disable_related', 10000 );
    function woodmart_disable_related() {
    	remove_action( 'woodmart_woocommerce_after_sidebar', 'woocommerce_output_related_products', 20 );
    	add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 30 );
    }
    #34983

    Haresh
    Participant

    Hello,

    It is working fine, Thank Thank so much.

    #34985

    Artem Temos
    Keymaster

    Great, you are welcome.

Viewing 6 posts - 1 through 6 (of 6 total)