• Resolved kelitu

    (@kelitu)


    @niyht I wanted to see if you will be able to add the total number of all products within the woocommerce store next to the sellable for your next release. This worked on my end. Thank you as always.

    $total_stock = (int) $wpdb->get_var(
    “SELECT SUM(CAST(pm.meta_value AS SIGNED))
    FROM {$wpdb->postmeta} pm
    INNER JOIN {$wpdb->postmeta} ms
    ON pm.post_id = ms.post_id
    INNER JOIN {$wpdb->posts} p
    ON pm.post_id = p.ID
    WHERE pm.meta_key = ‘_stock’
    AND ms.meta_key = ‘_manage_stock’
    AND ms.meta_value = ‘yes’
    AND p.post_status = ‘publish’
    AND p.post_type IN (‘product’, ‘product_variation’)
    AND pm.meta_value REGEXP ‘^-?[0-9]+$'”
    );

Viewing 1 replies (of 1 total)
  • Plugin Support latti

    (@niyht)

    Thank you very much, I’ve made all the changes you requested and released the new version 3.2.11 . If you notice anything missing, please let me know here. In the meantime, you need to download and install the new version from the plugin’s wp.org page because the update notification will appear after 24 hours.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.