mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Use the default button wrapper on the checkout
This commit is contained in:
parent
774ae69762
commit
4b9147fce4
4 changed files with 8 additions and 11 deletions
|
@ -130,7 +130,7 @@ const bootstrap = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderer = new _modules_Renderer__WEBPACK_IMPORTED_MODULE_0__["default"](PayPalCommerceGateway.button.order_button_wrapper);
|
const renderer = new _modules_Renderer__WEBPACK_IMPORTED_MODULE_0__["default"](PayPalCommerceGateway.button.wrapper);
|
||||||
renderer.render(defaultConfigurator.configuration());
|
renderer.render(defaultConfigurator.configuration());
|
||||||
|
|
||||||
jQuery(document.body).trigger('payment_method_selected');
|
jQuery(document.body).trigger('payment_method_selected');
|
||||||
|
@ -140,10 +140,10 @@ const bootstrap = () => {
|
||||||
const currentPaymentMethod = jQuery('input[name="payment_method"]:checked').val();
|
const currentPaymentMethod = jQuery('input[name="payment_method"]:checked').val();
|
||||||
|
|
||||||
if (currentPaymentMethod !== 'ppcp-gateway') {
|
if (currentPaymentMethod !== 'ppcp-gateway') {
|
||||||
jQuery(PayPalCommerceGateway.button.order_button_wrapper).hide();
|
jQuery(PayPalCommerceGateway.button.wrapper).hide();
|
||||||
jQuery('#place_order').show();
|
jQuery('#place_order').show();
|
||||||
} else {
|
} else {
|
||||||
jQuery(PayPalCommerceGateway.button.order_button_wrapper).show();
|
jQuery(PayPalCommerceGateway.button.wrapper).show();
|
||||||
jQuery('#place_order').hide();
|
jQuery('#place_order').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -36,7 +36,7 @@ const bootstrap = ()=> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderer = new Renderer(
|
const renderer = new Renderer(
|
||||||
PayPalCommerceGateway.button.order_button_wrapper
|
PayPalCommerceGateway.button.wrapper
|
||||||
);
|
);
|
||||||
renderer.render(defaultConfigurator.configuration());
|
renderer.render(defaultConfigurator.configuration());
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@ const bootstrap = ()=> {
|
||||||
const currentPaymentMethod = jQuery('input[name="payment_method"]:checked').val();
|
const currentPaymentMethod = jQuery('input[name="payment_method"]:checked').val();
|
||||||
|
|
||||||
if (currentPaymentMethod !== 'ppcp-gateway') {
|
if (currentPaymentMethod !== 'ppcp-gateway') {
|
||||||
jQuery(PayPalCommerceGateway.button.order_button_wrapper).hide();
|
jQuery(PayPalCommerceGateway.button.wrapper).hide();
|
||||||
jQuery('#place_order').show();
|
jQuery('#place_order').show();
|
||||||
} else {
|
} else {
|
||||||
jQuery(PayPalCommerceGateway.button.order_button_wrapper).show();
|
jQuery(PayPalCommerceGateway.button.wrapper).show();
|
||||||
jQuery('#place_order').hide();
|
jQuery('#place_order').hide();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -42,9 +42,7 @@ class SmartButton
|
||||||
}
|
}
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_review_order_after_submit',
|
'woocommerce_review_order_after_submit',
|
||||||
function () {
|
$renderer,
|
||||||
echo '<span id="ppc-button-checkout"></span>';
|
|
||||||
},
|
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
add_action(
|
add_action(
|
||||||
|
@ -90,7 +88,6 @@ class SmartButton
|
||||||
'button' => [
|
'button' => [
|
||||||
'wrapper' => '#ppc-button',
|
'wrapper' => '#ppc-button',
|
||||||
'mini_cart_wrapper' => '#ppc-button-minicart',
|
'mini_cart_wrapper' => '#ppc-button-minicart',
|
||||||
'order_button_wrapper' => '#ppc-button-checkout',
|
|
||||||
'cancel_wrapper' => '#ppcp-cancel',
|
'cancel_wrapper' => '#ppcp-cancel',
|
||||||
'url' =>$smartButtonUrl,
|
'url' =>$smartButtonUrl,
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue