Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/83273b78200e416ec0a0f081f351c724 to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/83273b78200e416ec0a0f081f351c724 to your computer and use it in GitHub Desktop.
// Fix - Dynamic Strikeout not Update during Add to Cart (Ajax) in Product page
add_action('wp_footer', function () {
if (function_exists('is_product') && is_product()) {
?>
<script>
jQuery(function($) {
$(document.body).on('added_to_cart removed_from_cart wc_fragments_refreshed', function() {
$('[name="quantity"]').trigger('change');
});
});
</script>
<?php
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment