mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Fix amount logic in cart
This commit is contained in:
parent
8acfc94002
commit
465f41b34b
2 changed files with 6 additions and 12 deletions
|
@ -546,9 +546,6 @@ class ApplePayButton implements ButtonInterface {
|
|||
);
|
||||
}
|
||||
if ( $cart->needs_shipping() ) {
|
||||
if ( ! $shipping_method ) {
|
||||
return array();
|
||||
}
|
||||
list(
|
||||
$shipping_methods_array, $selected_shipping_method
|
||||
) = $this->cart_shipping_methods(
|
||||
|
@ -602,14 +599,14 @@ class ApplePayButton implements ButtonInterface {
|
|||
*
|
||||
* @param WC_Cart $cart WC Cart instance.
|
||||
* @param array $customer_address Customer address.
|
||||
* @param array $shipping_method Shipping method.
|
||||
* @param array|null $shipping_method Shipping method.
|
||||
* @param string $shipping_method_id Shipping method id.
|
||||
*/
|
||||
protected function cart_shipping_methods(
|
||||
$cart,
|
||||
$customer_address,
|
||||
$shipping_method,
|
||||
$shipping_method_id
|
||||
$shipping_method = null,
|
||||
$shipping_method_id = ''
|
||||
): array {
|
||||
|
||||
$shipping_methods_array = array();
|
||||
|
@ -731,9 +728,6 @@ class ApplePayButton implements ButtonInterface {
|
|||
}
|
||||
|
||||
if ( $cart->needs_shipping() ) {
|
||||
if ( ! $shipping_method ) {
|
||||
return array();
|
||||
}
|
||||
list(
|
||||
$shipping_methods_array, $selected_shipping_method
|
||||
) = $this->cart_shipping_methods(
|
||||
|
|
|
@ -43,7 +43,7 @@ class ApplePayDataObjectHttp {
|
|||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $product_id;
|
||||
protected $product_id = '';
|
||||
|
||||
/**
|
||||
* The caller page.
|
||||
|
@ -55,9 +55,9 @@ class ApplePayDataObjectHttp {
|
|||
/**
|
||||
* The product quantity.
|
||||
*
|
||||
* @var mixed
|
||||
* @var string
|
||||
*/
|
||||
protected $product_quantity;
|
||||
protected $product_quantity = '';
|
||||
|
||||
/**
|
||||
* The shipping methods.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue