# easy-invoice/2.3.6/assets/js/promotion.js

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.3.6. 60 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.3.6/code/assets/js/promotion.js
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.3.6/raw/assets/js/promotion.js
- Modified: 2026-03-13T13:11:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.3.6/code/assets/js/promotion.js#L10-L20`.

```javascript
/**
 * Easy Invoice Promotion Banner JavaScript
 */
jQuery(document).ready(function($) {
    
    // Handle promotion banner dismissal
    $('#easy-invoice-promotion-dismiss').on('click', function(e) {
        e.preventDefault();
        
        $.ajax({
            url: easyInvoicePromotion.ajaxUrl,
            type: 'POST',
            data: {
                action: 'easy_invoice_dismiss_promotion',
                nonce: easyInvoicePromotion.nonce
            },
            success: function(response) {
                if (response.success) {
                    // Hide the notice with a smooth fade out
                    $('#easy-invoice-promotion-notice').fadeOut(300, function() {
                        $(this).remove();
                    });
                }
            },
            error: function() {
                // If AJAX fails, still hide the notice
                $('#easy-invoice-promotion-notice').fadeOut(300, function() {
                    $(this).remove();
                });
            }
        });
    });
    
    // Override the default WordPress notice dismiss handler for our promotion notice
    $(document).on('click', '#easy-invoice-promotion-notice .notice-dismiss', function(e) {
        e.preventDefault();
        
        $.ajax({
            url: easyInvoicePromotion.ajaxUrl,
            type: 'POST',
            data: {
                action: 'easy_invoice_dismiss_promotion',
                nonce: easyInvoicePromotion.nonce
            },
            success: function(response) {
                if (response.success) {
                    $('#easy-invoice-promotion-notice').fadeOut(300, function() {
                        $(this).remove();
                    });
                }
            },
            error: function() {
                $('#easy-invoice-promotion-notice').fadeOut(300, function() {
                    $(this).remove();
                });
            }
        });
    });
});

```
