Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#buyButton").click(function(e) {
- e.preventDefault();
- var shpId = $("#id_shp").val();
- var amount = $("#amount").val();
- var element = $(this);
- $.post("/shop/add-to-cart", {id:shpId, amount: amount}, function (){
- element.addClass("buyButtonAnim");
- element.attr("href", "/e-shop/kosik");
- $("span", element).html("Přidáno, přejít do košíku?");
- $(".buyButtonAnim").click(function() {
- window.location = "/e-shop/kosik";
- });
- });
- });
- $("#buyButton").click(function(e) {
- e.preventDefault();
- var buttonEl = $(this);
- var formEl = $('#productForm');
- $.post(formEl.attr('action'), formEl.serialize(), function (){
- buttonEl.addClass("buyButtonAnim");
- $("span", buttonEl).html("Přidáno, přejít do košíku?");
- buttonEl.unbind('click');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement