Create a gist now

Instantly share code, notes, and snippets.

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();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment