Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_ajax_nopriv_get_cart_totals', 'get_cart_totals_callback');
- function get_cart_totals_callback() {
- global $woocommerce;
- echo json_encode(array(
- 'cart_count' => $woocommerce->cart->cart_contents_count
- ));
- wp_die();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement