Last active
June 21, 2017 11:29
-
-
Save bhavik-kiri/2f6701deda5a0af4c06cb69130927968 to your computer and use it in GitHub Desktop.
It will modify the quantity & calculate the total of the cart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function update_order_review() { | |
$values = array(); | |
parse_str($_POST['post_data'], $values); | |
$cart = $values['cart']; | |
foreach ( $cart as $cart_key => $cart_value ){ | |
WC()->cart->set_quantity( $cart_key, $cart_value['qty'], false ); | |
WC()->cart->calculate_totals(); | |
woocommerce_cart_totals(); | |
} | |
wp_die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment