Merge pull request #1441 from woocommerce/PCP-1762-cart-paylater-amount

Update Pay Later amount on the cart page and checkout when total changes
This commit is contained in:
Emili Castells 2023-07-18 15:39:35 +02:00 committed by GitHub
commit a29e597ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 27 deletions

View file

@ -67,7 +67,12 @@ class CartScriptParamsEndpoint implements EndpointInterface {
try {
$script_data = $this->smart_button->script_data();
wp_send_json_success( $script_data['url_params'] );
wp_send_json_success(
array(
'url_params' => $script_data['url_params'],
'amount' => WC()->cart->get_total( 'raw' ),
)
);
return true;
} catch ( Throwable $error ) {