public function __construct()
{
add_action('wp_loaded', array($this, 'init'));
// Get cart after WP and plugins are loaded.
add_action('wp', array($this, 'maybe_set_cart_cookies'), 99);
// Set cookies
add_action('shutdown', array($this, 'maybe_set_cart_cookies'), 0);
// Set cookies before shutdown and ob flushing
add_action('woocommerce_add_to_cart', array($this, 'calculate_totals'), 20, 0);
add_action('woocommerce_applied_coupon', array($this, 'calculate_totals'), 20, 0);
}