Trigger quantity update on changing variant, update the variant price in main price html
Trigger quantity update when changing variants and update the variant price in the main price HTML.
add_filter('woocommerce_after_add_to_cart_form', function (){
?>
<script>
jQuery( document ).ready( function() {
jQuery( ".single_variation_wrap" ).on( "show_variation", function ( event, variation, purchasable ) {
jQuery(this).closest('form').find('input[name="quantity"]').trigger('change');
});
jQuery('input[name="quantity"]').trigger('change');
});
</script>
<?php
}, 10);
add_filter('advanced_woo_discount_rules_custom_target_for_variable_product_on_qty_update', function ($target){
$target = 'div.product .woocommerce-variation-price .price, div.product span.price';
return $target;
});