Advertisement
Guest User

Pobieranie liczby produktów WooCommerce - Krok 3

a guest
Apr 5th, 2017
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $("body").on("updated_cart_totals", function() {
  2.  
  3.     var data = {
  4.         action: "get_cart_totals"
  5.     };
  6.  
  7.     $.getJSON(AJAX_URL, data, function(res) {
  8.  
  9.         // zwróci ilość produktów w koszyku,
  10.         // którą można wstawić na stronę
  11.         console.log(res.cart_count);
  12.  
  13.     });
  14.  
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement