mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
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:
commit
a29e597ff9
5 changed files with 48 additions and 27 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue