seperate dcc and buttons on checkout

This commit is contained in:
David Remer 2020-08-18 11:38:41 +03:00
parent a96fddd586
commit 07524cf106
2 changed files with 10 additions and 4 deletions

View file

@ -50,15 +50,21 @@ class CheckoutBootstap {
const currentPaymentMethod = jQuery(
'input[name="payment_method"]:checked').val();
if (currentPaymentMethod !== 'ppcp-gateway') {
if (currentPaymentMethod !== 'ppcp-gateway' && currentPaymentMethod !== 'ppcp-credit-card-gateway') {
this.renderer.hideButtons(this.gateway.button.wrapper);
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
jQuery('#place_order').show();
}
else {
this.renderer.showButtons(this.gateway.button.wrapper);
this.renderer.showButtons(this.gateway.hosted_fields.wrapper);
jQuery('#place_order').hide();
if (currentPaymentMethod === 'ppcp-gateway') {
this.renderer.showButtons(this.gateway.button.wrapper);
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
}
if (currentPaymentMethod === 'ppcp-credit-card-gateway') {
this.renderer.hideButtons(this.gateway.button.wrapper);
this.renderer.showButtons(this.gateway.hosted_fields.wrapper);
}
}
}
}

View file

@ -8,7 +8,7 @@ class CreditCardRenderer {
render(wrapper, contextConfig) {
if (
this.defaultConfig !== 'checkout'
this.defaultConfig.context !== 'checkout'
|| wrapper === null
|| document.querySelector(wrapper) === null
) {