How to show the number of sales at the listing block

Hi, I’m using the marketplace extension. How to show the number of sales at the listing block (secondary attribute) like the example below? Or maybe i can show it in the single listing page as a well.

thank you!

image

Hi,

Unfortunately, there is no simple solution here, it will require a detailed custom implementation.

Is there any specific hp hook that should I use because when i use the php code below for WooCommerce, it didn’t work.

add_action( 'woocommerce_single_product_summary', 'wp_product_sold_count', 11 );
function wp_product_sold_count() {
  global $product;
  $total_sold = $product->get_total_sales();
  if ( $total_sold ) {
   echo '<p>'. sprintf(__('Total Sold: %s','woocommerce'), $total_sold). '</p>';
  }
}

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work: https://fvrr.co/32e7LvY. But thanks for your suggestion, we’ll consider adding this feature.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.