mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add needs shipping to classic cart
This commit is contained in:
parent
2bf6e5e8cf
commit
af286c8f82
2 changed files with 4 additions and 1 deletions
|
@ -139,7 +139,7 @@ class Renderer {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check the condition and add the handler if needed
|
// Check the condition and add the handler if needed
|
||||||
if ( this.defaultSettings.should_handle_shipping_in_paypal ) {
|
if ( this.defaultSettings.should_handle_shipping_in_paypal && this.defaultSettings.needShipping ) {
|
||||||
options.onShippingOptionsChange = ( data, actions ) => {
|
options.onShippingOptionsChange = ( data, actions ) => {
|
||||||
let shippingOptionsChange =
|
let shippingOptionsChange =
|
||||||
! this.isVenmoButtonClickedWhenVaultingIsEnabled(
|
! this.isVenmoButtonClickedWhenVaultingIsEnabled(
|
||||||
|
|
|
@ -1094,6 +1094,8 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
||||||
|
|
||||||
$url_params = $this->url_params();
|
$url_params = $this->url_params();
|
||||||
|
|
||||||
|
$cart = WC()->cart;
|
||||||
|
|
||||||
$this->request_data->enqueue_nonce_fix();
|
$this->request_data->enqueue_nonce_fix();
|
||||||
$localize = array(
|
$localize = array(
|
||||||
'url' => add_query_arg( $url_params, 'https://www.paypal.com/sdk/js' ),
|
'url' => add_query_arg( $url_params, 'https://www.paypal.com/sdk/js' ),
|
||||||
|
@ -1295,6 +1297,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
||||||
'is_logged' => is_user_logged_in(),
|
'is_logged' => is_user_logged_in(),
|
||||||
),
|
),
|
||||||
'should_handle_shipping_in_paypal' => $this->should_handle_shipping_in_paypal && ! $this->is_checkout(),
|
'should_handle_shipping_in_paypal' => $this->should_handle_shipping_in_paypal && ! $this->is_checkout(),
|
||||||
|
'needShipping' => $cart && $cart->needs_shipping(),
|
||||||
'vaultingEnabled' => $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ),
|
'vaultingEnabled' => $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue