ACF values to Script with auto refresh

Ok. Solved. PHP function counter_script() { wp_enqueue_script(‘counter’, get_template_directory_uri() . ‘/js/counter.js’); wp_localize_script( ‘counter’, ‘numbers’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) )); } add_action( ‘wp_enqueue_scripts’, ‘counter_script’ ); add_action( ‘wp_ajax_nopriv_numberstotal’, ‘numberstotal’ ); add_action( ‘wp_ajax_numberstotal’, ‘numberstotal’ ); function numberstotal() { global $post; $postargs = array( ‘post_type’ => ‘cpt’, ‘posts_per_page’ => -1 ); $cpt_query = new WP_Query($postargs); if ($cpt_query->have_posts()) : … Read more

Woocommerce – get daily sales meta

The question that you posted is unfortunately not all that specific but take a look at Woocommerce analytics. Otherwise there are 2 ways to do this on your own. 1. Query all the orders for day X and count the qty of a specific product. 2. Update the products sold after each purchase. Perhaps to … Read more