mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Fix GooglePay preview buttons
This commit is contained in:
parent
8847cbbd21
commit
9ab11b40e4
3 changed files with 24 additions and 4 deletions
|
@ -36,6 +36,17 @@ import widgetBuilder from "../../../ppcp-button/resources/js/modules/Renderer/Wi
|
|||
}
|
||||
});
|
||||
|
||||
// Maybe we can find a more elegant reload method when transitioning from styling modes.
|
||||
jQuery([
|
||||
'#ppcp-smart_button_enable_styling_per_location'
|
||||
].join(',')).on('change', () => {
|
||||
setTimeout(() => {
|
||||
for (const [selector, ppcpConfig] of Object.entries(activeButtons)) {
|
||||
createButton(ppcpConfig);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
const applyConfigOptions = function (buttonConfig) {
|
||||
buttonConfig.button = buttonConfig.button || {};
|
||||
buttonConfig.button.style = buttonConfig.button.style || {};
|
||||
|
|
|
@ -109,10 +109,13 @@ class AvailabilityNotice {
|
|||
static function ( $notices ): array {
|
||||
|
||||
$message = sprintf(
|
||||
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.
|
||||
__(
|
||||
'<p>Notice: We could not determine your PayPal seller status to list your available features. Disconnect and reconnect your PayPal account through our onboarding process to resolve this.</p><p>Don\'t worry if you cannot use the onboarding process; most functionalities available to your account should work.</p>',
|
||||
'<p>Notice: We could not determine your PayPal seller status to list your available features. Disconnect and reconnect your PayPal account through our %1$sonboarding process%2$s to resolve this.</p><p>Don\'t worry if you cannot use the %1$sonboarding process%2$s; most functionalities available to your account should work.</p>',
|
||||
'woocommerce-paypal-payments'
|
||||
)
|
||||
),
|
||||
'<a href="https://woocommerce.com/document/woocommerce-paypal-payments/#connect-paypal-account" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
// Name the key so it can be overridden in other modules.
|
||||
|
|
|
@ -19,7 +19,10 @@ document.addEventListener(
|
|||
|
||||
if (! toggleElement.checked) {
|
||||
group.forEach( (elementToHide) => {
|
||||
document.querySelector(elementToHide).style.display = 'none';
|
||||
const element = document.querySelector(elementToHide);
|
||||
if (element) {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
})
|
||||
}
|
||||
toggleElement.addEventListener(
|
||||
|
@ -27,7 +30,10 @@ document.addEventListener(
|
|||
(event) => {
|
||||
if (! event.target.checked) {
|
||||
group.forEach( (elementToHide) => {
|
||||
document.querySelector(elementToHide).style.display = 'none';
|
||||
const element = document.querySelector(elementToHide);
|
||||
if (element) {
|
||||
element.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue