mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
✨ Store shipping cost in the DTO
This commit is contained in:
parent
611ab4c5a7
commit
3b92eaac81
6 changed files with 30 additions and 7 deletions
|
@ -90,7 +90,8 @@ class UpdatePaymentDataEndpoint {
|
|||
WC()->cart->calculate_fees();
|
||||
WC()->cart->calculate_totals();
|
||||
|
||||
$total = (float) WC()->cart->get_total( 'numeric' );
|
||||
$total = (float) WC()->cart->get_total( 'numeric' );
|
||||
$shipping_fee = (float) WC()->cart->get_shipping_total();
|
||||
|
||||
// Shop settings.
|
||||
$base_location = wc_get_base_location();
|
||||
|
@ -100,7 +101,7 @@ class UpdatePaymentDataEndpoint {
|
|||
wp_send_json_success(
|
||||
array(
|
||||
'total' => $total,
|
||||
'total_str' => ( new Money( $total, $currency_code ) )->value_str(),
|
||||
'shipping_fee' => $shipping_fee,
|
||||
'currency_code' => $currency_code,
|
||||
'country_code' => $shop_country_code,
|
||||
'shipping_options' => $this->get_shipping_options(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue