hide publish button

This commit is contained in:
Narek Zakarian 2024-02-05 19:03:38 +04:00
parent 4ccc38eb7b
commit dabdbb632a
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -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',