| Server IP : 198.38.94.67 / Your IP : 216.73.217.142 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/wpforms-lite/assets/js/integrations/woocommerce/ |
Upload File : |
/* global wpforms_woocommerce_notifications */
/**
* WooCommerce Notifications integration script.
*
* @since 1.8.9
*/
const WPFormsWoocommerceNotifications = window.WPFormsWoocommerceNotifications || ( function( document, window, $ ) {
/**
* Public functions and properties.
*
* @since 1.8.9
*/
const app = {
/**
* Start the engine.
*
* @since 1.8.9
*/
init() {
$( app.ready );
},
/**
* Document ready.
*
* @since 1.8.9
*/
ready() {
app.events();
},
/**
* Events.
*
* @since 1.8.9
*/
events() {
$( '#wpforms-woocommerce-close' ).on( 'click', app.dismiss );
},
/**
* Hide notification.
*
* @since 1.8.9
*/
dismiss() {
const $btn = $( this );
const $notification = $btn.closest( '.wpforms-woocommerce-notification' );
$notification.remove();
const data = {
action: 'wpforms_woocommerce_dismiss',
nonce: wpforms_woocommerce_notifications.nonce,
};
$.post( wpforms_woocommerce_notifications.ajax_url, data, function( res ) {
if ( ! res.success ) {
// eslint-disable-next-line no-console
console.log( res );
}
} ).fail( function( xhr ) {
// eslint-disable-next-line no-console
console.log( xhr.responseText );
} );
},
};
return app;
}( document, window, jQuery ) );
// Initialize.
WPFormsWoocommerceNotifications.init();