Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery("#product-addtocart-button").on('click', function() {
- var canvas = jQuery('canvas.canvas');
- var canvasImage = canvas[0].toDataURL("image/jpeg", 0.7);
- jQuery.ajax({
- type: "POST",
- dataType: 'json',
- url: UPLOADER_URL,
- data: {
- imgBase64: canvasImage
- }
- }).done(function(response) {
- last_option.val(response.filename);
- console.log("Generated filename", response.filename);
- // TRIGGER ADD TO CART FUNCTION HERE
- // BUT THE ADD TO CART IS BEING TRIGGERED EVEN IF THE AJAX IS NOT YET FINISH
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement