I want to show product total sales after custom date:
I have this code, but I would like to custom it for showing only the total sales after a custom date for example 05/26/2016
function total_sales()
{
global $product;
$units_sold = get_post_meta(206, 'total_sales', true);
echo '<p>' . sprintf(__('Units Sold: %s', 'woocommerce'), $units_sold) . '</p>';
}
Code goes in
functions.php
file of your active child theme (or theme). Or also in any plugin php files.USAGE
Please Note: All the date are in
Y-m-d
format.Code is tested and works.
Hope this helps!