jQuery(document).ready(function ($) {
    // When the notice is dismissed
    $(document).on('click', '.supermarket-shopping-notice .notice-dismiss', function () {
        $.post(ajaxurl, {
            action: 'supermarket_shopping_dismiss_notice'
        });
    });
});