<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="{{ asset('images/Iconos/estrella_Mesa1.png') }}" />
<link
href="https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/animate.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/chosen.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/pe-icon-7-stroke.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/jquery.scrollbar.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/lightbox.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/magnific-popup.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/slick.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('fonts/flaticon.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/megamenu.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/dreaming-attribute.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}" />
<title>{% block title %}Los Vascos | Tienda Online{% endblock %}</title>
{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<script src="{{ asset('js/jquery-1.12.4.min.js') }}"></script>
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
<script src="{{ asset('js/chosen.min.js') }}"></script>
<script src="{{ asset('js/countdown.min.js') }}"></script>
<script src="{{ asset('js/jquery.scrollbar.min.js') }}"></script>
<script src="{{ asset('js/lightbox.min.js') }}"></script>
<script src="{{ asset('js/magnific-popup.min.js') }}"></script>
<script src="{{ asset('js/slick.js') }}"></script>
<script src="{{ asset('js/jquery.zoom.min.js') }}"></script>
<script src="{{ asset('js/threesixty.min.js') }}"></script>
<script src="{{ asset('js/jquery-ui.min.js') }}"></script>
<script src="{{ asset('js/mobilemenu.js') }}"></script>
<script src='https://maps.googleapis.com/maps/api/js?key=AIzaSyC3nDHy1dARR-Pa_2jjPCjvsOR4bcILYsM'></script>
<script src="{{ asset('js/functions.js') }}"></script>
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>
{% block javascripts %}{% endblock %}
<script>
$( document ).ready(function() {
if("{{app.session.get('cartId')}}"){
console.log("here");
$.ajax({
type: 'GET',
url: '{{path('currentItems')}}',
dataType: "json",
beforeSend: function(){
},
success: function(response){
var formatter = new Intl.NumberFormat('es-CL', {
style: 'currency',
currency: 'CLP',
// These options are needed to round to whole numbers if that's what you want.
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
console.log(response);
//$(".cart-count").text(response.products_sales.length + response.bookings.length );
$(".minicart-number-items").text(response.products_sales.length);
$("#cart-count").text(response.products_sales.length);
$("#cart-count2").text(response.products_sales.length);
response.products_sales.forEach(element => {
$("#shopping-cart").append(`
<li class="kreen-mini-cart-item mini_cart_item MejMedium">
<a href="#" onclick="eliminarProductoCarrito(`+element.sale_id+`)" class="remove remove_from_cart_button">×</a>
<a href="#">
<img src="`+element.product_image+`"
class="attachment-kreen_thumbnail size-kreen_thumbnail"
alt="img" width="600" height="778">`+element.product_name+`
</a>
<span class="quantity">`+element.quantity +` × <span
class="kreen-Price-amount amount"><span
class="kreen-Price-currencySymbol">$</span>`+formatter.format(element.original_price).replace(/^(\D+)/, '')+`</span>
</li>
`);
$("#shopping-cart2").append(`
<li class="kreen-mini-cart-item mini_cart_item">
<a href="#" onclick="eliminarProductoCarrito(`+element.sale_id+`)" style="margin-top: 30px!important;" class="remove remove_from_cart_button">×</a>
<a href="#">
<img src="`+element.product_image+`"
class="attachment-kreen_thumbnail size-kreen_thumbnail"
alt="img" width="600" height="778">`+element.product_name+`
</a>
<span class="quantity">`+element.quantity +` × <span
class="kreen-Price-amount amount"><span
class="kreen-Price-currencySymbol">$</span>`+formatter.format(element.original_price).replace(/^(\D+)/, '')+`</span>
</li>
`);
});
if(response.tarifa_monto_min <= response.total_price){
$('#comprar1').show();
$('#comprar2').show();
}else{
$('#comprar1').hide();
$('#comprar2').hide();
}
console.log(response);
$("#cart-total").text("$"+formatter.format(response.total_price).replace(/^(\D+)/, ''));
$("#cart-total2").text("$"+formatter.format(response.total_price).replace(/^(\D+)/, ''));
$("#cart-subtotal").text("$"+formatter.format(response.subtotal).replace(/^(\D+)/, ''));
$("#cart-subtotal2").text("$"+formatter.format(response.subtotal).replace(/^(\D+)/, ''));
$("#cart-descuento").text("$"+formatter.format(response.total_discount).replace(/^(\D+)/, ''));
$("#cart-descuento2").text("$"+formatter.format(response.total_discount).replace(/^(\D+)/, ''));
}
});
}
});
$('#full-carrito').hide();
$('#full-carrito2').hide();
function eliminarProductoCarrito(id_producto) {
parametros = {'saleId': id_producto, 'code': $('#codigoCupon').val()}
url = Routing.generate('deleteFromCart', parametros);
location.href = url;
}
</script>
</body>
</html>