WordPress.org

Forums

WooCommerce - excelling eCommerce
Display a count of total product published (4 posts)

  1. lucamoretto
    Member
    Posted 1 year ago #

    Hi Guys, i need a code in php to display a count total of products in my woocommerce shop. Ty so much in advance.

    http://wordpress.org/plugins/woocommerce/

  2. Roy Ho
    Member
    Posted 1 year ago #

    Not tested...just off the top of my head.

    $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1 );
    
    $products = new WP_Query( $args );
    
    echo $products->found_posts;
  3. lucamoretto
    Member
    Posted 1 year ago #

    WORKS fine!!! ty so much man!!!

  4. lucamoretto
    Member
    Posted 1 year ago #

    Hi SplashingPixels,
    u can help me to solve this problem?

    "i wanna display in the profile of every author (subscriber) a list of all products (woocommerce) uploaded by author with a title + permalink… u can help me in this? TY so much in advance… good day!"

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic