Add sale count next to star rating in woocommerce single product page


I am trying to add order, sale count next to star rating at single product page, my store is build with wordpress and woocommerce, i have tried a code but it add this function before add to cart button/form. website url for referrence: and image

add_action( 'woocommerce_before_add_to_cart_button', 'product_sold_count', 10 );
  function product_sold_count() {
   global $product;
   $units_sold = $product->get_total_sales();
   if ( $units_sold ) echo '<p>' . sprintf( __( 'Sold: %s', 'woocommerce' ), $units_sold ) . '</p>';

I will appreciate if any one help me in this matter.

, , Asif Mughal 1 year 2020-07-20T12:10:27-05:00 0 Answers 23 views 0

Leave an answer