mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Do not consider needShipping from single page
This commit is contained in:
parent
4a72743d0f
commit
b96c87597a
1 changed files with 7 additions and 1 deletions
|
@ -139,7 +139,7 @@ class Renderer {
|
|||
};
|
||||
|
||||
// Check the condition and add the handler if needed
|
||||
if ( this.defaultSettings.should_handle_shipping_in_paypal && this.defaultSettings.needShipping ) {
|
||||
if ( this.shouldEnableShippingCallback() ) {
|
||||
options.onShippingOptionsChange = ( data, actions ) => {
|
||||
let shippingOptionsChange =
|
||||
! this.isVenmoButtonClickedWhenVaultingIsEnabled(
|
||||
|
@ -227,6 +227,12 @@ class Renderer {
|
|||
return venmoButtonClicked && this.defaultSettings.vaultingEnabled;
|
||||
};
|
||||
|
||||
shouldEnableShippingCallback = () => {
|
||||
console.log(this.defaultSettings.context, this.defaultSettings)
|
||||
let needShipping = this.defaultSettings.needShipping || this.defaultSettings.context === 'product'
|
||||
return this.defaultSettings.should_handle_shipping_in_paypal && needShipping
|
||||
};
|
||||
|
||||
isAlreadyRendered( wrapper, fundingSource ) {
|
||||
return this.renderedSources.has( wrapper + ( fundingSource ?? '' ) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue