Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created July 28, 2016 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kreamweb/8c2de09a04975d34421ad6da286a647b to your computer and use it in GitHub Desktop.
Save kreamweb/8c2de09a04975d34421ad6da286a647b to your computer and use it in GitHub Desktop.
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