Created
September 21, 2017 16:43
-
-
Save everaldomatias/8afc2b2befe2f98c8cbebe959d11d8d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS | |
jQuery(function() { | |
jQuery('.add-request-quote-button').on('click', function() { | |
jQuery.ajax({ | |
type : 'POST', | |
url : 'wp-admin/admin-ajax.php', | |
dataType: 'json', | |
data : action_agp_qdt_itens, | |
success: function (response) { | |
jQuery('#raq_item_number').addClass('teste'); | |
} | |
}); | |
}); | |
}); | |
// PHP | |
function agp_qdt_itens_ajax() { | |
echo YITH_Request_Quote()->get_raq_item_number(); | |
} | |
add_action( 'wp_ajax_action_agp_qdt_itens', 'agp_qdt_itens_ajax' ); | |
add_action( 'wp_ajax_nopriv_action_agp_qdt_itens', 'agp_qdt_itens_ajax' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment