kreamweb
7/28/2016 - 11:00 AM

YITH Dynamic Pricing and Discount - calculate_totals to fix some theme

YITH Dynamic Pricing and Discount - calculate_totals to fix some theme

<?php
if ( class_exists( 'YITH_WC_Dynamic_Pricing_Frontend' ) ) {
	add_action( 'ywdpd_after_cart_process_discounts', 'ywdpd_after_cart_process_discounts' );

	function ywdpd_after_cart_process_discounts() {
		if ( current_filter() == 'woocommerce_ajax_added_to_cart' || defined( 'DOING_AJAX' ) ) {
			WC()->cart->calculate_totals();
		}
	}

}