mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
hide publish button
This commit is contained in:
parent
4ccc38eb7b
commit
dabdbb632a
1 changed files with 18 additions and 1 deletions
|
@ -1,15 +1,32 @@
|
|||
document.addEventListener( 'DOMContentLoaded', () => {
|
||||
const form = document.querySelector('#mainform');
|
||||
const table = form.querySelector('.form-table');
|
||||
|
||||
table.insertAdjacentHTML('afterend', '<div id="messaging-configurator"></div>');
|
||||
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const form = document.querySelector('#mainform');
|
||||
const messagingConfigurator = form.querySelector('#messaging-configurator');
|
||||
const publishButton = messagingConfigurator.querySelector('#configurator-publishButton');
|
||||
|
||||
if (publishButton) {
|
||||
publishButton.style.display = 'none';
|
||||
}
|
||||
|
||||
form.addEventListener('submit', () => {
|
||||
publishButton.click();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
merchantConfigurators.Messaging({
|
||||
config: PcpPayLaterConfigurator.config,
|
||||
merchantClientId: PcpPayLaterConfigurator.merchantClientId,
|
||||
partnerClientId: PcpPayLaterConfigurator.partnerClientId,
|
||||
partnerName: 'WooCommerce',
|
||||
bnCode: 'Woo_PPCP',
|
||||
placements: ['cart', 'checkout', 'product', 'category', 'homepage'],
|
||||
placements: ['cart', 'checkout', 'product', 'category', 'homepage', 'custom_placement'],
|
||||
onSave: data => {
|
||||
fetch(PcpPayLaterConfigurator.ajax.save_config.endpoint, {
|
||||
method: 'POST',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue