I create custom checkout page with custom calculation. How i cant change total and tax_total via Ajax (or refresh page if need).
I create custom page for ajax request and set this code
$ss = new WC_Session_Handler();
$ss->set('tax_total',9999999);
$ss->save_data();
$ss->set('total',9999999);
$ss->save_data();
var_dump(WC());
On this page i can see my changes, but ‘checkout page’ nothing happens (even after refresh). How can I change the arbitrary total
or tax_total
.
Try to use
Also it shoul be
tax_total
in cart object and you will can change it.I’ve had problems getting other solutions to work for me, but at least for v.3.0.1, this worked great: