diff --git a/assets/js/product.js b/assets/js/product.js new file mode 100644 index 0000000..3a9a4d0 --- /dev/null +++ b/assets/js/product.js @@ -0,0 +1,20 @@ +$(window).on('load', function(){ + $('#btn-check-out').click(function(){ + let productId = $(this).attr("data-id"); + addToBag(productId); + window.location.replace($('meta[name="checkout"]').attr('content')); + }); + $('#btn-add-to-bag').click(function(){ + let productId = $(this).attr("data-id"); + let parentElement = $('#count-products-in-bag').parent(); + let copyElemetn = $('#count-products-in-bag').clone(); + copyElemetn.attr('id', ''); + copyElemetn.appendTo(parentElement); + $('#count-products-in-bag').addClass('animate__animated animate__backInUp'); + $('#count-products-in-bag').on('animationend', function(){ + $('#count-products-in-bag').removeClass('animate__animated animate__backInUp'); + copyElemetn.remove(); + }); + addToBag(productId); + }); +}); \ No newline at end of file diff --git a/content/contents/balkonkraftwerk.blade.php b/content/contents/balkonkraftwerk.blade.php index 7ed5717..342281a 100644 --- a/content/contents/balkonkraftwerk.blade.php +++ b/content/contents/balkonkraftwerk.blade.php @@ -79,26 +79,5 @@ @stop @section('scripts') - -@stop + +@stop \ No newline at end of file diff --git a/content/contents/produkt.blade.php b/content/contents/produkt.blade.php index dffa762..00ab8a8 100644 --- a/content/contents/produkt.blade.php +++ b/content/contents/produkt.blade.php @@ -84,17 +84,5 @@ @stop @section('scripts') - + @stop \ No newline at end of file diff --git a/content/contents/solarmodule.blade.php b/content/contents/solarmodule.blade.php index 9d1bfd3..388c8c4 100644 --- a/content/contents/solarmodule.blade.php +++ b/content/contents/solarmodule.blade.php @@ -84,17 +84,5 @@ @stop @section('scripts') - + @stop