Advertisement
A7mdxd

Untitled

Sep 28th, 2019
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.53 KB | None | 0 0
  1.                                 $('.add_to_cart_functionality').get({{forloop.counter0}}).on('click', function(event){
  2.  
  3.  
  4.                                      $.ajax({
  5.                                         type:'POST',
  6.                                         url: "{% url 'core:add-to-cart' %}",
  7.                                         data:{
  8.                                             product_id:"{{ product.product_id }}",
  9.                                             csrfmiddlewaretoken:$('input[name=csrfmiddlewaretoken]').val()
  10.                                         },
  11.                                         success: function(response){
  12.                                             if(response.status === 200){
  13.                                                 console.log('3zma')
  14.                                             }
  15.                                         }
  16.                                     })
  17.                                 })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement