mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +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 ( $cart->needs_shipping() ) {
|
||||||
if ( ! $shipping_method ) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
list(
|
list(
|
||||||
$shipping_methods_array, $selected_shipping_method
|
$shipping_methods_array, $selected_shipping_method
|
||||||
) = $this->cart_shipping_methods(
|
) = $this->cart_shipping_methods(
|
||||||
|
@ -602,14 +599,14 @@ class ApplePayButton implements ButtonInterface {
|
||||||
*
|
*
|
||||||
* @param WC_Cart $cart WC Cart instance.
|
* @param WC_Cart $cart WC Cart instance.
|
||||||
* @param array $customer_address Customer address.
|
* @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.
|
* @param string $shipping_method_id Shipping method id.
|
||||||
*/
|
*/
|
||||||
protected function cart_shipping_methods(
|
protected function cart_shipping_methods(
|
||||||
$cart,
|
$cart,
|
||||||
$customer_address,
|
$customer_address,
|
||||||
$shipping_method,
|
$shipping_method = null,
|
||||||
$shipping_method_id
|
$shipping_method_id = ''
|
||||||
): array {
|
): array {
|
||||||
|
|
||||||
$shipping_methods_array = array();
|
$shipping_methods_array = array();
|
||||||
|
@ -731,9 +728,6 @@ class ApplePayButton implements ButtonInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $cart->needs_shipping() ) {
|
if ( $cart->needs_shipping() ) {
|
||||||
if ( ! $shipping_method ) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
list(
|
list(
|
||||||
$shipping_methods_array, $selected_shipping_method
|
$shipping_methods_array, $selected_shipping_method
|
||||||
) = $this->cart_shipping_methods(
|
) = $this->cart_shipping_methods(
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ApplePayDataObjectHttp {
|
||||||
*
|
*
|
||||||
* @var mixed
|
* @var mixed
|
||||||
*/
|
*/
|
||||||
protected $product_id;
|
protected $product_id = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The caller page.
|
* The caller page.
|
||||||
|
@ -55,9 +55,9 @@ class ApplePayDataObjectHttp {
|
||||||
/**
|
/**
|
||||||
* The product quantity.
|
* The product quantity.
|
||||||
*
|
*
|
||||||
* @var mixed
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $product_quantity;
|
protected $product_quantity = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The shipping methods.
|
* The shipping methods.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue