1> Create folder "
woocommerce" in your theme.
2> your product page templte at following address:
"
/public_html/wp-content/plugins/woocommerce/templates"
3> download "
content-single-product.php" file & put in theme "woocommerce" folder
4> "
content-single-product.php" code Under standing below:
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' );
?>
Above code can be print product title,Price,short discription etc.
To change it go follwing path
"/public_html/wp-content/plugins/woocommerce/includes/wc-template-hooks.php" file.
You can see follwing code:
/**
* Product Summary Box.
*
* @see woocommerce_template_single_title()
* @see woocommerce_template_single_rating()
* @see woocommerce_template_single_price()
* @see woocommerce_template_single_excerpt()
* @see woocommerce_template_single_meta()
* @see woocommerce_template_single_sharing()
*/
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
From here it comes output.
5> for remove any function copy following code in your "
functions.php" file in your theme.
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
Code for Product Title:-
<?php if( mfn_opts_get('shop-product-title') != 'sub' ): ?>
<center><h1 itemprop="name" class="product_title entry-title product_title"><?php the_title(); ?></h1></center>
<?php endif; ?>
Code for Short discription:-
<div itemprop="description" class="wooshortdiscription">
<?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
</div>
Take code from "/public_html/wp-content/plugins/woocommerce/templates/single-product" files & put in Your "content-single-product.php" as you need.
6> Never change original file because when its update your modified code will be lost.
For more Interesting, Useful Article & codes visit IT New Code.