I know this can be done by overwrite /woocommerce/content-single-product.php
in my child-theme or using js, however what I’m trying to achieve is without using that ways. The original woocommerce content-single-product.php
like below:
<div id="product-<?php the_ID(); ?>" <?php wc_product_class( '', $product ); ?>>
<?php do_action( 'woocommerce_before_single_product_summary' );?>
<div class="summary entry-summary">
<?php do_action( 'woocommerce_single_product_summary' ); ?>
</div>
<?php do_action( 'woocommerce_after_single_product_summary' ); ?>
</div>
I’m trying to add the div element below the <div class="summary entry-summary">
to wrap the hook woocommerce_single_product_summary
, so the target result should look like this:
<div id="product-<?php the_ID(); ?>" <?php wc_product_class( '', $product ); ?>>
<?php do_action( 'woocommerce_before_single_product_summary' );?>
<div class="summary entry-summary">
<div class="ThisIsMyCustomDiv">
<?php do_action( 'woocommerce_single_product_summary' ); ?>
</div>
</div>
<?php do_action( 'woocommerce_after_single_product_summary' ); ?>
</div>
How to add that div element? Any help appreciated. Thank you!