var/cache/dev/twig/d8/d83c805e58f03282bc29e28492e74920.php line 41
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* @Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig */
class __TwigTemplate_865f56836c4ef6489e3f4a686e234150 extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'stylesheets' => [$this, 'block_stylesheets'],
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "@Flexy/FrontBundle/Themes/IlaveU/templates/layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig"));
$this->parent = $this->loadTemplate("@Flexy/FrontBundle/Themes/IlaveU/templates/layout.html.twig", "@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 4
public function block_stylesheets($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
// line 5
yield "
\t";
// line 6
yield from $this->yieldParentBlock("stylesheets", $context, $blocks);
yield "
\t<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.css\" integrity=\"sha512-wJgJNTBBkLit7ymC6vvzM1EcSWeM9mmOu+1USHaRBbHkm6W9EgM0HY27+UtUaprntaYQJF75rc8gjxllKs5OIQ==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css\" integrity=\"sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css\" integrity=\"sha512-sMXtMNL1zRzolHYKEujM2AqCLUR9F2C4/05cdbxjjLSRvMQIciEPCQZo++nk7go3BtSuK9kfa/s+a4f4i5pLkw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 13
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 14
yield "
<style>
#collectMap,#shippingMap {
width: 100%;
height: 400px;
}
.pay-with-wallet .item{
padding:10px 7px;
margin:0 10px;
font-weight:bold;
background:#45dae9;
color:white;
border-radius:50px;
text-align:center;
font-size:14px;
}
.pay-with-wallet .item.selected{
background:#febc4a;
}
.tips-shipping-agent .item{
padding:10px 15px;
margin:0 10px;
font-weight:bold;
background:#45dae9;
color:white;
border-radius:50px;
text-align:center;
}
.tips-shipping-agent .item.selected{
background:#febc4a;
}
.owl-carousel .owl-nav button.owl-next, .owl-carousel .owl-nav button.owl-prev, .owl-carousel button.owl-dot{
background:#d5d5d5;
}
.owl-dots {
bottom:-35px;
}
\t.choices-shipping{
\t\tfont-size:13px;
}
.choices-shipping div div {
/* border: 2px dotted #ccc; */
padding: 20px;
background: #f2f2f2;
}
.choices-shipping div div.active {
background-color: #45dae9;
border-color: #29cedf;
color: white;
}
\t
\t.jq-toast-wrap {
display: block;
position: fixed;
width: 500px;
pointer-events: none!important;
letter-spacing: normal;
z-index: 9000!important;
}
.jq-icon-warning {
background-color: #9a0062;
}
</style>
\t<div
\t\tclass=\"body-wrapper\" >
\t\t<!-- Begin Li's Breadcrumb Area -->
\t\t<div class=\"breadcrumb-area\">
\t\t\t<div class=\"container\">
\t\t\t\t<ul id=\"progressbar\">
\t\t\t\t\t<li class=\"active\">Livraison
\t\t\t\t\t</li>
\t\t\t\t\t<li>Paiement et coordonnées</li>
\t\t\t\t\t<li>Resumé</li>
\t\t\t\t</ul>
\t\t\t</div>
\t\t</div>
\t\t<!-- Li's Breadcrumb Area End Here -->
\t\t<!--Shopping Cart Area Strat-->
\t\t<div class=\"Shopping-cart-area pt-60 pb-60\">
\t\t\t<div class=\"container\">
\t\t\t\t<div class=\"row \">
\t\t\t\t\t<div class=\"col-12\">
\t\t\t\t\t\t<form action=\"#\">
\t\t\t\t\t\t\t<div class=\"table-content table-responsive d-none\">
\t\t\t\t\t\t\t\t<table class=\"table table-striped\">
\t\t\t\t\t\t\t\t\t<thead>
\t\t\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-remove\">Supprimer</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-thumbnail\">images</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"cart-product-name\">Product</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-price\">Prix unitaire</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-quantity\">Quantité</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-subtotal\">Total</th>
\t\t\t\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t\t\t</thead>
\t\t\t\t\t\t\t\t\t<tbody
\t\t\t\t\t\t\t\t\t\tclass=\"cart\"><!-- LocalStorage Cart Items -->
\t\t\t\t\t\t\t\t\t</tbody>
\t\t\t\t\t\t\t\t</table>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t<div class=\"col-md-7 \">
<div class=\"row\">
<div class=\"col-12\">
<!--Accordion Start-->
<p style=\"font-weight:bold;\">Avez-vous un code promo? <span id=\"showcoupon\" style=\"cursor:pointer;\">Cliquez ici pour saisir votre code</span></p>
<div id=\"checkout_coupon\" class=\"coupon-checkout-content\">
<div class=\"coupon-info\">
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" placeholder=\"Votre code promo\" data-coupon-value=\"0\" data-coupon-type=\"amount\" name=\"codeCoupon\" aria-label=\"Recipient's username\" aria-describedby=\"button-codeCoupon\" value=\"\">
<button class=\"btn btn-success orderPreview\" type=\"button\" id=\"button-codeCoupon\">Appliquer</button>
</div>
</div>
</div>
</div>
</div>
<!--Accordion End-->
<div class=\"row choices-shipping\" style=\"margin-bottom:40px; \">
\t\t\t\t\t\t\t\t\t\t\t";
// line 160
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["shippingMethods"]) || array_key_exists("shippingMethods", $context) ? $context["shippingMethods"] : (function () { throw new RuntimeError('Variable "shippingMethods" does not exist.', 160, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["singleShippingMethod"]) {
// line 161
yield " <div class=\"col-6 mt-4\" >
<div style=\"min-height:180px;\" data-id=\"";
// line 162
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "id", [], "any", false, false, false, 162), "html", null, true);
yield "\" class=\"shippingMethod ";
if (($context["singleShippingMethod"] == Twig\Extension\CoreExtension::first($this->env->getCharset(), (isset($context["shippingMethods"]) || array_key_exists("shippingMethods", $context) ? $context["shippingMethods"] : (function () { throw new RuntimeError('Variable "shippingMethods" does not exist.', 162, $this->source); })())))) {
yield "active";
}
yield "\">
<h4>";
// line 163
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "name", [], "any", false, false, false, 163), "html", null, true);
yield "</h4>
<ul>
<li>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
// line 166
$context["shippingDurationValue"] = CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "shippingDuration", [], "any", false, false, false, 166);
// line 167
yield "\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
$context["shippingDurationUnit"] = "H";
// line 168
yield "\t\t\t\t\t\t\t\t\t\t\t\t\t";
if (((isset($context["shippingDurationValue"]) || array_key_exists("shippingDurationValue", $context) ? $context["shippingDurationValue"] : (function () { throw new RuntimeError('Variable "shippingDurationValue" does not exist.', 168, $this->source); })()) < 1)) {
// line 169
yield "\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
$context["shippingDurationValue"] = (60 * CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "shippingDuration", [], "any", false, false, false, 169));
// line 170
yield "\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
$context["shippingDurationUnit"] = "Min";
// line 171
yield "\t\t\t\t\t\t\t\t\t\t\t\t\t";
}
// line 172
yield "\t\t\t\t\t\t\t\t\t\t\t\t\tTemps d’attente du Speeder <span class=\"float-right slot\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["shippingDurationValue"]) || array_key_exists("shippingDurationValue", $context) ? $context["shippingDurationValue"] : (function () { throw new RuntimeError('Variable "shippingDurationValue" does not exist.', 172, $this->source); })()), "html", null, true);
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["shippingDurationUnit"]) || array_key_exists("shippingDurationUnit", $context) ? $context["shippingDurationUnit"] : (function () { throw new RuntimeError('Variable "shippingDurationUnit" does not exist.', 172, $this->source); })()), "html", null, true);
yield "</span></li>
<li class=\"\">Récuperation de la commande <span class=\"float-right\">";
// line 173
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "preparationDuration", [], "any", false, false, false, 173), "html", null, true);
yield " H</span></li>
<li>Livraison en <span class=\"float-right\">";
// line 174
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "processingDuration", [], "any", false, false, false, 174), "html", null, true);
yield " H</span></li>
\t\t\t\t\t\t\t\t\t\t\t\t\t";
// line 175
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "shippingRules", [], "any", false, false, false, 175)) > 0)) {
// line 176
yield " <li style=\"line-height: 15px;\"><small>";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["singleShippingMethod"], "description", [], "any", false, false, false, 176), "html", null, true);
yield "</small></li>
\t\t\t\t\t\t\t\t\t\t\t\t\t";
}
// line 178
yield " </ul>
</div>
\t\t\t\t\t\t\t\t\t\t\t\t
</div>
\t\t\t\t\t\t\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['singleShippingMethod'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 184
yield "
</div>
\t\t\t\t\t\t\t\t\t<div class=\"row\" >
\t\t\t\t\t\t\t\t\t<div class=\"item aos-init aos-animate col-6\" id=\"accordionRecovery\" data-aos=\"fade-up\">
\t\t\t\t\t\t\t\t\t\t<h6>Informations de récupération</h6>
\t\t\t\t\t\t\t\t\t\t<div class=\"bg-white\">
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-5 col-md-12 col-lg-5\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Date</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"d-flex\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control datedropper chooseDate\" data-dd-min-date=\"";
// line 194
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("now", "Y/m/d"), "html", null, true);
yield "\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("now", "Y/m/d"), "html", null, true);
yield "\" name=\"startProcessingAt\" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-7 col-md-12 col-lg-7\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Heure</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"recovery_slot\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"receive_time\" class=\"custom-select custom-select-recieve\" name=\"collectTime\" data-day=\"0\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"08:00\" >Sélectionner un crénau</option>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t</span>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row justify-content-center\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-group box col-sm-12\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b>Adresse de récupération</b>
\t\t\t\t\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Button trigger modal -->
\t\t\t\t\t\t\t\t\t\t\t\t\t
<select class=\"mb-2\" name=\"collectCityRegion\" >
";
// line 216
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["cityRegions"]) || array_key_exists("cityRegions", $context) ? $context["cityRegions"] : (function () { throw new RuntimeError('Variable "cityRegions" does not exist.', 216, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cityRegion"]) {
// line 217
yield " <option data-lat=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "lat", [], "any", false, false, false, 217), "html", null, true);
yield "\" data-lng=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "lng", [], "any", false, false, false, 217), "html", null, true);
yield "\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "id", [], "any", false, false, false, 217), "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "name", [], "any", false, false, false, 217), "html", null, true);
yield "</option>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cityRegion'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 219
yield " </select>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"collect_address\" name=\"collect_address\" value=\"Maarif, Casablanca, Maroc\" class=\"form-control w-100\" >
<a href=\"#\" id=\"modalShippingMap\" type=\"button\" data-bs-toggle=\"modal\" data-bs-target=\"#collectMapModal\" class=\"btn btn-success mt-2\" style=\"\" ><i class=\"fa-solid fa-location-dot\"></i> Location</a>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t<div class=\"item aos-init aos-animate col-6\" id=\"accordionRecovery\" data-aos=\"fade-up\">
\t\t\t\t\t\t\t\t\t\t<h6>Informations de livraison</h6>
\t\t\t\t\t\t\t\t\t\t<div class=\"bg-white\">
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-5 col-md-12 col-lg-5\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Date</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"d-flex\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control datedropper chooseDate\" name=\"startDeliveryAt\" value=\"";
// line 239
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("now", "Y/m/d"), "html", null, true);
yield "\" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-7 col-md-12 col-lg-7\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Heure</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"recovery_slot\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"receive_time\" class=\"custom-select custom-select-recieve\" name=\"shippingTime\" data-day=\"0\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"08:00\" >Sélectionner un crénau</option>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t</span>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row justify-content-center\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-group box col-sm-12\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b>Adresse de livraison</b>
\t\t\t\t\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t
<select class=\"mb-2\" name=\"shippingCityRegion\" >
";
// line 260
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["cityRegions"]) || array_key_exists("cityRegions", $context) ? $context["cityRegions"] : (function () { throw new RuntimeError('Variable "cityRegions" does not exist.', 260, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cityRegion"]) {
// line 261
yield " <option data-lat=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "lat", [], "any", false, false, false, 261), "html", null, true);
yield "\" data-lng=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "lng", [], "any", false, false, false, 261), "html", null, true);
yield "\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "id", [], "any", false, false, false, 261), "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["cityRegion"], "name", [], "any", false, false, false, 261), "html", null, true);
yield "</option>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cityRegion'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 263
yield " </select>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"shipping_address\" name=\"shipping_address\" value=\"Maarif, Casablanca, Maroc\" class=\"form-control w-100 \" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
<a href=\"#\" id=\"modalShippingMap\" type=\"button\" data-bs-toggle=\"modal\" data-bs-target=\"#collectMapModal\" class=\"btn btn-success mt-2\" style=\"\" ><i class=\"fa-solid fa-location-dot\"></i> Location</a>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
";
// line 278
if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CUSTOMER") && ((isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 278, $this->source); })()) != null))) {
// line 279
yield " <div class=\"col-12 mt-5\" >
<h6>Payer avec ma wallet ";
// line 280
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 280, $this->source); })()), "credit", [], "any", false, false, false, 280), "html", null, true);
yield " DH</h6>
<div class=\"owl-carousel pay-with-wallet d-none mt-4\">
";
// line 282
if ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 282, $this->source); })()), "credit", [], "any", false, false, false, 282) > 0)) {
// line 283
yield " ";
$context["counterCredit"] = 0;
// line 284
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(range(0, (isset($context["totalCart"]) || array_key_exists("totalCart", $context) ? $context["totalCart"] : (function () { throw new RuntimeError('Variable "totalCart" does not exist.', 284, $this->source); })())));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 285
yield " ";
if ((((CoreExtension::getAttribute($this->env, $this->source, // line 286
(isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 286, $this->source); })()), "credit", [], "any", false, false, false, 286) >= $context["i"]) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 286, $this->source); })()), "credit", [], "any", false, false, false, 286) <= (isset($context["totalCart"]) || array_key_exists("totalCart", $context) ? $context["totalCart"] : (function () { throw new RuntimeError('Variable "totalCart" does not exist.', 286, $this->source); })()))) || ((CoreExtension::getAttribute($this->env, $this->source, // line 287
(isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 287, $this->source); })()), "credit", [], "any", false, false, false, 287) >= $context["i"]) && (CoreExtension::getAttribute($this->env, $this->source, (isset($context["customer"]) || array_key_exists("customer", $context) ? $context["customer"] : (function () { throw new RuntimeError('Variable "customer" does not exist.', 287, $this->source); })()), "credit", [], "any", false, false, false, 287) >= (isset($context["totalCart"]) || array_key_exists("totalCart", $context) ? $context["totalCart"] : (function () { throw new RuntimeError('Variable "totalCart" does not exist.', 287, $this->source); })()))))) {
// line 289
yield " <div data-value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["i"], "html", null, true);
yield "\" class=\"item\"> ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["i"], "html", null, true);
yield " DH</div>
";
// line 290
$context["counterCredit"] = ((isset($context["counterCredit"]) || array_key_exists("counterCredit", $context) ? $context["counterCredit"] : (function () { throw new RuntimeError('Variable "counterCredit" does not exist.', 290, $this->source); })()) + $context["i"]);
// line 291
yield " ";
}
// line 292
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 294
yield " ";
}
// line 295
yield "
</div>
</div>
";
}
// line 301
yield "\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t
<hr>
\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t <div class=\"col-lg-5 col-12\">
<div class=\"your-order\">
<h3>Votre commande</h3>
<div class=\"shipping\" >
</div>
<div class=\"your-order-table table-responsive\">
<table class=\"table\">
<thead>
<tr>
<th class=\"cart-product-name\">Produit</th>
<th class=\"cart-product-total\">Total</th>
</tr>
</thead>
<tbody class=\"cart-checkout\">
</tbody>
<tfoot>
<tr class=\"cart-subtotal\">
<th>Sous total</th>
<td><span class=\"amount total-checkout total\">0,00 MAD </span></td>
</tr>
\t\t\t\t\t\t\t\t\t\t\t<tr class=\"cart-subtotal promo\">
<th>Reduction coupon</th>
<td><span class=\"amount codepromo\">0,00 MAD </span></td>
</tr>
";
// line 347
yield "
";
// line 352
yield "
\t\t\t\t\t\t\t\t\t\t\t<tr class=\"cart-subtotal\">
<th>Frais de livraison</th>
<td><span class=\"amount shipping-method-fees\">0,00 MAD </span></td>
</tr>
<tr class=\"order-total\">
<th>Montant á payer</th>
<td><strong><span class=\"amount total-checkout total-to-pay \">0,00 MAD</span></strong></td>
</tr>
\t\t\t\t\t\t\t\t\t\t\t
<tr>
<td colspan=\"2\" ><a href=\"#\" class=\"save-button btn btn-primary d-block\">Continuer</a></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</form>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<!--Shopping Cart Area End-->
\t</div>
\t<!-- Body Wrapper End Here -->
<!-- Button trigger modal -->
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
// line 394
public function block_javascripts($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 395
yield " ";
yield from $this->yieldParentBlock("javascripts", $context, $blocks);
yield "
\t<script type=\"text/javascript\" src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBFliT4Ug0Ugto5davRC7krsyMhTfkI-L4&libraries=places\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js\" integrity=\"sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js\" integrity=\"sha512-zlWWyZq71UMApAjih4WkaRpikgY9Bz1oXIW5G0fED4vk14JjGlQ1UmkGM392jEULP8jbNMiwLWdM8Z87Hu88Fw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
\t<script src=\"";
// line 399
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("flexy/js/datedropper/datedropper-javascript.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 400
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("flexy/js/datedropper/datedropper-javascript-lang-FR.js"), "html", null, true);
yield "\"></script>
<script>
\tdocument.addEventListener(\"turbo:load\", function() {
var isCollectReadyForCheckout = false;
var isShippingReadyForCheckout = false;
new dateDropper({
lang:\"fr\",
//format: \"dd/m/y\",
selector: \"input[name='startProcessingAt']\",
minDate: \"";
// line 413
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("yesterday", "Y-m-d"), "html", null, true);
yield "\",
//autoFill:false,
expandable: true,
onChange: function (res) {
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
}
});
new dateDropper({
lang:\"fr\",
//format: \"dd/m/y\",
selector: \"input[name='startDeliveryAt']\",
//autoFill:false,
expandable: true,
onChange: function (res) {
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
}
});
\$(document).ready(function(){
\$(\".tips-shipping-agent\").owlCarousel({
dots:true,
items:5,
nav:false,
onChanged:function(){
\$(\".tips-shipping-agent\").removeClass(\"d-none\");
}
});
\$(\".pay-with-wallet\").owlCarousel({
dots:true,
items:7,
nav:false,
onChanged:function(){
\$(\".pay-with-wallet\").removeClass(\"d-none\");
}
});
\$(\".pay-with-wallet .item\").click(function(){
\$(\".pay-with-wallet .item\").removeClass(\"selected\");
\$(this).addClass(\"selected\");
walletPayment = parseFloat(\$(this).attr(\"data-value\"));
\$(\".wallet-payment\").html( (walletPayment) + \" DH\");
\$(\".total-to-pay\").html( ((total) - (amount) - (reductionCoupon) - (walletPayment)) + (shippingFees) + (shippingTips) + \" DH\");
});
var inputCollectAddress = document.getElementById('collect_address');
\t var inputShippingAddress = document.getElementById('shipping_address');
var optionsCollect = {
//types: ['(cities)'],
componentRestrictions: {country: 'ma'}
};
var optionsShipping = {
//types: ['(cities)'],
componentRestrictions: {country: 'ma'}
};
var centerLatCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lat\"); // example latitude
var centerLngCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lng\"); // example longitude
var centerLatShipping =\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lat\"); // example latitude
var centerLngShipping =\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lng\"); // example longitude
var centerPointCollect = new google.maps.LatLng(centerLatCollect, centerLngCollect);
var centerPointShipping = new google.maps.LatLng(centerLatShipping, centerLngShipping);
// Set the desired radius in meters
var radius = 10000; // 10 kilometers
var boundsCollect = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
var boundsShipping = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
\$(\"select[name='collectCityRegion']\").change(function(){
centerLatCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lat\");
centerLngCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lng\");
centerPointCollect = new google.maps.LatLng(centerLatCollect, centerLngCollect);
boundsCollect = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
});
\$(\"select[name='shippingCityRegion']\").change(function(){
centerLatShipping = \$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lat\");
centerLngShipping = \$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lng\");
centerPointShipping = new google.maps.LatLng(centerLatShipping, centerLngShipping);
boundsShipping = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
});
var autocompleteCollect = new google.maps.places.Autocomplete(inputCollectAddress, optionsCollect);
var autocompleteShipping = new google.maps.places.Autocomplete(inputShippingAddress, optionsShipping);
google.maps.event.addListener(autocompleteCollect, 'place_changed', function() {
var lngCollect = autocompleteCollect.getPlace().geometry.location.lng();
var latCollect = autocompleteCollect.getPlace().geometry.location.lat();
if (autocompleteCollect.getPlace() && boundsCollect && boundsCollect.contains(autocompleteCollect.getPlace().geometry.location)) {
// Place falls within the specified radius
isCollectReadyForCheckout = true;
console.log('Place collect is within the specified radius:', autocompleteCollect.getPlace());
} else {
isCollectReadyForCheckout = false;
// Place is outside the specified radius
console.log('Place collect is outside the specified radius:', autocompleteCollect.getPlace());
}
});
google.maps.event.addListener(autocompleteShipping, 'place_changed', function() {
var lngShipping = autocompleteShipping.getPlace().geometry.location.lng();
var latShipping = autocompleteShipping.getPlace().geometry.location.lat();
if (autocompleteShipping.getPlace() && boundsShipping && boundsShipping.contains(autocompleteShipping.getPlace().geometry.location)) {
// Place falls within the specified radius
isShippingReadyForCheckout = true;
console.log('Place shipping is within the specified radius:', autocompleteShipping.getPlace());
} else {
isShippingReadyForCheckout = false;
// Place is outside the specified radius
console.log('Place shipping is outside the specified radius:', autocompleteShipping.getPlace());
}
});
\$(\".choices-shipping div div\").click(function(){
\$(\".choices-shipping div div\").removeClass(\"active\");
\$(this).addClass(\"active\");
\t\t\ttotal = cartLS.total();
\t\t\tvar value = \$(this).val();
\t\t\t//shippingFees = parseFloat(\$(this).find(\":selected\").attr(\"data-price\")) ;
\t\t\t//\$(\".shipping-method-fees\").html(shippingFees+ \" DH\");
\t\t\t//\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + \" DH\");
\t\t\t//\$(\"#cash\").trigger(\"keyup\");
\t\t\t\$(\"input[name='startDeliveryAt']\").val(\$(\"input[name='startProcessingAt']\").val());
\t\t\t\$(\"input[name='startProcessingAt']\").trigger(\"change\");
});
\t\$(\".save-button\").click(function(){
if((isCollectReadyForCheckout && isShippingReadyForCheckout) || 1 == 1){
\$.ajax({
url:\"";
// line 580
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pos_cart_checkout");
yield "\",
method:\"POST\",
data:{
\t\t\t\t\t\t\t\torderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\"collecte-and-delivery\",
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
shippingAddress:\$(\"input[name=shipping_address]\").val(),
collectAddress:\$(\"input[name=collect_address]\").val(),
cityRegionCollect:\$(\"select[name='collectCityRegion']\").find(\"option:selected\").val(),
cityRegionShipping:\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").val(),
shippingTips:parseFloat(\$(\".tips-shipping-agent .item.selected\").attr(\"data-value\")),
walletPaymentAmount:parseFloat(\$(\".pay-with-wallet .item.selected\").attr(\"data-value\")),
isReadyForCheckout: true
},
success:function(result){
if(result.status == \"success\");
\t\t\t\t\t\t\t window.location.href = \"";
// line 608
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("checkout");
yield "\";
}
});
}else{
\$.toast({
heading: 'Merci de verifier vos cordonnées',
text: \"Vos cordonnées quartiers ou adresses ne sont pas valident merci de verifier !\",
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
});
\t\$(\"input[name='startProcessingAt']\").change(function(){
\$.toast().reset('all');
\$(\".checkout-area\").html(\"\");
var isWallet = 0;
if(\$(\"#isWallet\").is(':checked')){
isWallet = 1;
}
\$.ajax({
url:\"";
// line 641
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pos_cart_checkout");
yield "\",
method:\"POST\",
data:{
orderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\"collecte-and-delivery\",
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"";
// line 661
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("next year", "Y-m-d"), "html", null, true);
yield "\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"#shipping-method\").find(\"option:selected\").attr(\"data-price\",result.shippingFees);
shippingFees = parseFloat(result.shippingFees) ;
\$(\".shipping-method-fees\").html(shippingFees.toFixed(2)+ \" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
//\$(\"select[name='collectTime']\").modal('show');
\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
/*
\$(\"input[name='startDeliveryAt']\").dateDropper({
large: true,
lang: 'fr',
theme: 'datedropper',
format: \"d-m-Y\",
expandable: true,
rangeStart: result.shippingDate,
rangeEnd: \"";
// line 682
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(" next year ", "Y/m/d"), "html", null, true);
yield "\",
disabledDays: \"";
// line 683
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::join(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["settings"]) || array_key_exists("settings", $context) ? $context["settings"] : (function () { throw new RuntimeError('Variable "settings" does not exist.', 683, $this->source); })()), "get", [], "method", false, false, false, 683), "getExcludeDatesOnlyDates", [], "method", false, false, false, 683), ","), "html", null, true);
yield "\",
disabledWeekDays: '6'
});
*/
if(result.messages.length > 0){
\$.toast({
heading: 'Décalage de date',
text: result.messages,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
}
});
});
\t\$(\"input[name='startDeliveryAt']\").change(function(){
\$.toast().reset('all');
var isWallet = 0;
if(\$(\"#isWallet\").is(':checked')){
isWallet = 1;
}
\$.ajax({
url:\"";
// line 716
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pos_cart_checkout");
yield "\",
method:\"POST\",
data:{
orderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\$(\"select[name='delivery-type'] option:selected\").val(),
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"";
// line 735
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("next year", "Y-m-d"), "html", null, true);
yield "\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"#shipping-method\").find(\"option:selected\").attr(\"data-price\",result.shippingFees);
shippingFees = parseFloat(result.shippingFees) ;
\$(\".shipping-method-fees\").html(shippingFees.toFixed(2)+ \" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
//\$(\"select[name='collectTime']\").modal('show');
//\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
//\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
\$(\"select[name='shippingTime']\").find(\"option:first\").attr(\"selected\",true);
/*
\$(\"input[name='startDeliveryAt']\").dateDropper({
large: true,
lang: 'fr',
theme: 'datedropper',
format: \"d-m-Y\",
expandable: true,
rangeStart: result.shippingDate,
rangeEnd: \"";
// line 757
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(" next year ", "Y/m/d"), "html", null, true);
yield "\",
disabledDays: \"";
// line 758
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::join(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["settings"]) || array_key_exists("settings", $context) ? $context["settings"] : (function () { throw new RuntimeError('Variable "settings" does not exist.', 758, $this->source); })()), "get", [], "method", false, false, false, 758), "getExcludeDatesOnlyDates", [], "method", false, false, false, 758), ","), "html", null, true);
yield "\",
disabledWeekDays: '6'
});
*/
if(result.messages.length > 0){
\$.toast({
heading: 'Décalage de date',
text: result.messages,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
}
});
});
\$(\"select[name='collectTime']\").change(function(){
\$.ajax({
url:\"";
// line 786
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pos_cart_checkout");
yield "\",
method:\"POST\",
data:{
\t\t\t\t\t\t\t\torderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\$(\"select[name='delivery-type'] option:selected\").val(),
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"";
// line 804
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate("next year", "Y-m-d"), "html", null, true);
yield "\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"select[name='collectTime']\").modal('show');
//\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
//\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
}
});
});
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
});
\$(\".orderPreview\").click(function(){
\$(\".checkout-area\").html(\"\");
if(cartLS.list().length > 0){
\$.ajax({
url:\"";
// line 824
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pos_cart_checkout");
yield "\",
method:\"POST\",
data:{
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
isPromoPreview: true
},
success:function(result){
reductionCoupon = 0;
if(result.coupon ){
if(result.coupon.typeReduction==\"percent\"){
reductionCoupon = (total / 100) * result.coupon.valueReduction;
}else{
reductionCoupon = result.coupon.valueReduction;
}
\$(\"input[name='codeCoupon']\").attr(\"data-coupon-value\",result.coupon.valueReduction);
\$(\"input[name='codeCoupon']\").attr(\"data-type-value\",result.coupon.typeReduction);
\$.toast({
heading: result.coupon.code,
text: result.message,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'success',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}else{
\$.toast({
heading: \"Remarque\",
text: result.message,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
\$(\".promo .codepromo\").html(reductionCoupon.toFixed(2)+\" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
}
});
}
else{
alert(\"Veuillez rajouter des produit au panier\");
}
});
})
</script>
<script>
document.addEventListener(\"turbo:load\", function() {
var collectMap;
var collectGeocoder;
function initCollectMap() {
collectMap = new google.maps.Map(document.getElementById(\"collectMap\"), {
center: { lat: centerLatCollect, lng: centerLngCollect }, // Set initial map center
zoom: 8, // Set initial zoom level
});
collectMap.addListener(\"click\", function (event) {
collectPlaceMarker(event.latLng);
getCollectAddress(event.latLng);
});
}
window.addEventListener('resize', function() {
google.maps.event.trigger(collectMap, 'resize');
});
function collectPlaceMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: collectMap,
});
collectMap.panTo(location);
}
function getCollectAddress(latLng) {
collectGeocoder = new google.maps.Geocoder();
collectGeocoder.geocode({ location: latLng }, function (results, status) {
console.log(results);
if (status === \"OK\") {
if (results[0]) {
console.log(results[0].formatted_address);
} else {
console.log(\"No results found\");
}
} else {
console.log(\"Geocoder failed due to: \" + status);
}
});
}
initCollectMap();
var shippingMap;
var shippingGeocoder;
function initShippingMap() {
shippingMap = new google.maps.Map(document.getElementById(\"shippingMap\"), {
center: { lat: centerLatShipping, lng: centerLngShipping }, // Set initial map center
zoom: 8, // Set initial zoom level
});
shippingMap.addListener(\"click\", function (event) {
shippingPlaceMarker(event.latLng);
getShippingAddress(event.latLng);
});
}
window.addEventListener('resize', function() {
google.maps.event.trigger(shippingMap, 'resize');
});
function shippingPlaceMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: shippingMap,
});
shippingMap.panTo(location);
}
function getShippingAddress(latLng) {
shippingGeocoder = new google.maps.Geocoder();
shippingGeocoder.geocode({ location: latLng }, function (results, status) {
console.log(results);
if (status === \"OK\") {
if (results[0]) {
console.log(results[0].formatted_address);
} else {
console.log(\"No results found\");
}
} else {
console.log(\"Geocoder failed due to: \" + status);
}
});
}
initShippingMap();
\$(\"#modalShippingMap\").click(function(){
\$(\"#shippingMap\").removeClass(\"d-none\");
\$(\"#collectMap\").addClass(\"d-none\");
});
\$(\"#modalCollectMap\").click(function(){
\$(\"#shippingMap\").addClass(\"d-none\");
\$(\"#collectMap\").removeClass(\"d-none\");
});
});
</script>
<!-- Modal -->
<div class=\"modal fade\" id=\"collectMapModal\" tabindex=\"-1\" aria-labelledby=\"collectMapModalLabel\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-xl\" style=\"width:800px;\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"collectMapModalLabel\">Cordonnées de collect</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<div id=\"collectMap\"></div>
<div id=\"shippingMap\" class=\"d-none\"></div>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Annuler</button>
<button type=\"button\" class=\"btn btn-primary\">Séléctionner</button>
</div
</div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 1099 => 824, 1076 => 804, 1055 => 786, 1024 => 758, 1020 => 757, 995 => 735, 973 => 716, 937 => 683, 933 => 682, 909 => 661, 886 => 641, 850 => 608, 819 => 580, 649 => 413, 633 => 400, 629 => 399, 621 => 395, 611 => 394, 563 => 352, 560 => 347, 516 => 301, 508 => 295, 505 => 294, 498 => 292, 495 => 291, 493 => 290, 486 => 289, 484 => 287, 483 => 286, 481 => 285, 476 => 284, 473 => 283, 471 => 282, 466 => 280, 463 => 279, 461 => 278, 444 => 263, 429 => 261, 425 => 260, 401 => 239, 379 => 219, 364 => 217, 360 => 216, 333 => 194, 321 => 184, 310 => 178, 304 => 176, 302 => 175, 298 => 174, 294 => 173, 287 => 172, 284 => 171, 281 => 170, 278 => 169, 275 => 168, 272 => 167, 270 => 166, 264 => 163, 256 => 162, 253 => 161, 249 => 160, 101 => 14, 91 => 13, 74 => 6, 71 => 5, 61 => 4, 38 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends \"@Flexy/FrontBundle/Themes/IlaveU/templates/layout.html.twig\" %}
{% block stylesheets %}
\t{{parent()}}
\t<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.css\" integrity=\"sha512-wJgJNTBBkLit7ymC6vvzM1EcSWeM9mmOu+1USHaRBbHkm6W9EgM0HY27+UtUaprntaYQJF75rc8gjxllKs5OIQ==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css\" integrity=\"sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css\" integrity=\"sha512-sMXtMNL1zRzolHYKEujM2AqCLUR9F2C4/05cdbxjjLSRvMQIciEPCQZo++nk7go3BtSuK9kfa/s+a4f4i5pLkw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\" />
{% endblock %}
{% block body %}
<style>
#collectMap,#shippingMap {
width: 100%;
height: 400px;
}
.pay-with-wallet .item{
padding:10px 7px;
margin:0 10px;
font-weight:bold;
background:#45dae9;
color:white;
border-radius:50px;
text-align:center;
font-size:14px;
}
.pay-with-wallet .item.selected{
background:#febc4a;
}
.tips-shipping-agent .item{
padding:10px 15px;
margin:0 10px;
font-weight:bold;
background:#45dae9;
color:white;
border-radius:50px;
text-align:center;
}
.tips-shipping-agent .item.selected{
background:#febc4a;
}
.owl-carousel .owl-nav button.owl-next, .owl-carousel .owl-nav button.owl-prev, .owl-carousel button.owl-dot{
background:#d5d5d5;
}
.owl-dots {
bottom:-35px;
}
\t.choices-shipping{
\t\tfont-size:13px;
}
.choices-shipping div div {
/* border: 2px dotted #ccc; */
padding: 20px;
background: #f2f2f2;
}
.choices-shipping div div.active {
background-color: #45dae9;
border-color: #29cedf;
color: white;
}
\t
\t.jq-toast-wrap {
display: block;
position: fixed;
width: 500px;
pointer-events: none!important;
letter-spacing: normal;
z-index: 9000!important;
}
.jq-icon-warning {
background-color: #9a0062;
}
</style>
\t<div
\t\tclass=\"body-wrapper\" >
\t\t<!-- Begin Li's Breadcrumb Area -->
\t\t<div class=\"breadcrumb-area\">
\t\t\t<div class=\"container\">
\t\t\t\t<ul id=\"progressbar\">
\t\t\t\t\t<li class=\"active\">Livraison
\t\t\t\t\t</li>
\t\t\t\t\t<li>Paiement et coordonnées</li>
\t\t\t\t\t<li>Resumé</li>
\t\t\t\t</ul>
\t\t\t</div>
\t\t</div>
\t\t<!-- Li's Breadcrumb Area End Here -->
\t\t<!--Shopping Cart Area Strat-->
\t\t<div class=\"Shopping-cart-area pt-60 pb-60\">
\t\t\t<div class=\"container\">
\t\t\t\t<div class=\"row \">
\t\t\t\t\t<div class=\"col-12\">
\t\t\t\t\t\t<form action=\"#\">
\t\t\t\t\t\t\t<div class=\"table-content table-responsive d-none\">
\t\t\t\t\t\t\t\t<table class=\"table table-striped\">
\t\t\t\t\t\t\t\t\t<thead>
\t\t\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-remove\">Supprimer</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-thumbnail\">images</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"cart-product-name\">Product</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-price\">Prix unitaire</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-quantity\">Quantité</th>
\t\t\t\t\t\t\t\t\t\t\t<th class=\"li-product-subtotal\">Total</th>
\t\t\t\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t\t\t</thead>
\t\t\t\t\t\t\t\t\t<tbody
\t\t\t\t\t\t\t\t\t\tclass=\"cart\"><!-- LocalStorage Cart Items -->
\t\t\t\t\t\t\t\t\t</tbody>
\t\t\t\t\t\t\t\t</table>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t<div class=\"col-md-7 \">
<div class=\"row\">
<div class=\"col-12\">
<!--Accordion Start-->
<p style=\"font-weight:bold;\">Avez-vous un code promo? <span id=\"showcoupon\" style=\"cursor:pointer;\">Cliquez ici pour saisir votre code</span></p>
<div id=\"checkout_coupon\" class=\"coupon-checkout-content\">
<div class=\"coupon-info\">
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" placeholder=\"Votre code promo\" data-coupon-value=\"0\" data-coupon-type=\"amount\" name=\"codeCoupon\" aria-label=\"Recipient's username\" aria-describedby=\"button-codeCoupon\" value=\"\">
<button class=\"btn btn-success orderPreview\" type=\"button\" id=\"button-codeCoupon\">Appliquer</button>
</div>
</div>
</div>
</div>
</div>
<!--Accordion End-->
<div class=\"row choices-shipping\" style=\"margin-bottom:40px; \">
\t\t\t\t\t\t\t\t\t\t\t{% for singleShippingMethod in shippingMethods %}
<div class=\"col-6 mt-4\" >
<div style=\"min-height:180px;\" data-id=\"{{singleShippingMethod.id}}\" class=\"shippingMethod {% if singleShippingMethod == shippingMethods|first %}active{% endif %}\">
<h4>{{singleShippingMethod.name}}</h4>
<ul>
<li>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t{% set shippingDurationValue = singleShippingMethod.shippingDuration %}
\t\t\t\t\t\t\t\t\t\t\t\t\t\t{% set shippingDurationUnit = \"H\" %}
\t\t\t\t\t\t\t\t\t\t\t\t\t{% if shippingDurationValue < 1 %}
\t\t\t\t\t\t\t\t\t\t\t\t\t\t{% set shippingDurationValue = 60 * singleShippingMethod.shippingDuration %}
\t\t\t\t\t\t\t\t\t\t\t\t\t\t{% set shippingDurationUnit = \"Min\" %}
\t\t\t\t\t\t\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t\t\t\t\t\t\tTemps d’attente du Speeder <span class=\"float-right slot\">{{shippingDurationValue}} {{shippingDurationUnit}}</span></li>
<li class=\"\">Récuperation de la commande <span class=\"float-right\">{{singleShippingMethod.preparationDuration}} H</span></li>
<li>Livraison en <span class=\"float-right\">{{singleShippingMethod.processingDuration}} H</span></li>
\t\t\t\t\t\t\t\t\t\t\t\t\t{% if singleShippingMethod.shippingRules|length > 0 %}
<li style=\"line-height: 15px;\"><small>{{singleShippingMethod.description}}</small></li>
\t\t\t\t\t\t\t\t\t\t\t\t\t{% endif %}
</ul>
</div>
\t\t\t\t\t\t\t\t\t\t\t\t
</div>
\t\t\t\t\t\t\t\t\t\t\t\t{% endfor %}
</div>
\t\t\t\t\t\t\t\t\t<div class=\"row\" >
\t\t\t\t\t\t\t\t\t<div class=\"item aos-init aos-animate col-6\" id=\"accordionRecovery\" data-aos=\"fade-up\">
\t\t\t\t\t\t\t\t\t\t<h6>Informations de récupération</h6>
\t\t\t\t\t\t\t\t\t\t<div class=\"bg-white\">
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-5 col-md-12 col-lg-5\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Date</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"d-flex\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control datedropper chooseDate\" data-dd-min-date=\"{{\"now\"|date('Y/m/d')}}\" value=\"{{\"now\"|date('Y/m/d')}}\" name=\"startProcessingAt\" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-7 col-md-12 col-lg-7\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Heure</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"recovery_slot\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"receive_time\" class=\"custom-select custom-select-recieve\" name=\"collectTime\" data-day=\"0\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"08:00\" >Sélectionner un crénau</option>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t</span>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row justify-content-center\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-group box col-sm-12\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b>Adresse de récupération</b>
\t\t\t\t\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Button trigger modal -->
\t\t\t\t\t\t\t\t\t\t\t\t\t
<select class=\"mb-2\" name=\"collectCityRegion\" >
{% for cityRegion in cityRegions %}
<option data-lat=\"{{cityRegion.lat}}\" data-lng=\"{{cityRegion.lng}}\" value=\"{{cityRegion.id}}\">{{cityRegion.name}}</option>
{% endfor %}
</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"collect_address\" name=\"collect_address\" value=\"Maarif, Casablanca, Maroc\" class=\"form-control w-100\" >
<a href=\"#\" id=\"modalShippingMap\" type=\"button\" data-bs-toggle=\"modal\" data-bs-target=\"#collectMapModal\" class=\"btn btn-success mt-2\" style=\"\" ><i class=\"fa-solid fa-location-dot\"></i> Location</a>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t<div class=\"item aos-init aos-animate col-6\" id=\"accordionRecovery\" data-aos=\"fade-up\">
\t\t\t\t\t\t\t\t\t\t<h6>Informations de livraison</h6>
\t\t\t\t\t\t\t\t\t\t<div class=\"bg-white\">
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-5 col-md-12 col-lg-5\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Date</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"d-flex\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control datedropper chooseDate\" name=\"startDeliveryAt\" value=\"{{\"now\"|date('Y/m/d')}}\" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box col-sm-7 col-md-12 col-lg-7\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Heure</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t<span id=\"recovery_slot\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select id=\"receive_time\" class=\"custom-select custom-select-recieve\" name=\"shippingTime\" data-day=\"0\">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"08:00\" >Sélectionner un crénau</option>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t</span>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t<div class=\"row justify-content-center\">
\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-group box col-sm-12\">
\t\t\t\t\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<b>Adresse de livraison</b>
\t\t\t\t\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t\t\t\t\t\t
<select class=\"mb-2\" name=\"shippingCityRegion\" >
{% for cityRegion in cityRegions %}
<option data-lat=\"{{cityRegion.lat}}\" data-lng=\"{{cityRegion.lng}}\" value=\"{{cityRegion.id}}\">{{cityRegion.name}}</option>
{% endfor %}
</select>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"shipping_address\" name=\"shipping_address\" value=\"Maarif, Casablanca, Maroc\" class=\"form-control w-100 \" />
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
<a href=\"#\" id=\"modalShippingMap\" type=\"button\" data-bs-toggle=\"modal\" data-bs-target=\"#collectMapModal\" class=\"btn btn-success mt-2\" style=\"\" ><i class=\"fa-solid fa-location-dot\"></i> Location</a>
\t\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
{% if is_granted(\"ROLE_CUSTOMER\") and customer != null %}
<div class=\"col-12 mt-5\" >
<h6>Payer avec ma wallet {{customer.credit}} DH</h6>
<div class=\"owl-carousel pay-with-wallet d-none mt-4\">
{% if customer.credit > 0 %}
{% set counterCredit = 0 %}
{% for i in 0..totalCart %}
{% if
(customer.credit >= i and customer.credit <= totalCart) or
(customer.credit >= i and customer.credit >= totalCart)
%}
<div data-value=\"{{i}}\" class=\"item\"> {{i}} DH</div>
{% set counterCredit = counterCredit + i %}
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t
<hr>
\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t <div class=\"col-lg-5 col-12\">
<div class=\"your-order\">
<h3>Votre commande</h3>
<div class=\"shipping\" >
</div>
<div class=\"your-order-table table-responsive\">
<table class=\"table\">
<thead>
<tr>
<th class=\"cart-product-name\">Produit</th>
<th class=\"cart-product-total\">Total</th>
</tr>
</thead>
<tbody class=\"cart-checkout\">
</tbody>
<tfoot>
<tr class=\"cart-subtotal\">
<th>Sous total</th>
<td><span class=\"amount total-checkout total\">0,00 MAD </span></td>
</tr>
\t\t\t\t\t\t\t\t\t\t\t<tr class=\"cart-subtotal promo\">
<th>Reduction coupon</th>
<td><span class=\"amount codepromo\">0,00 MAD </span></td>
</tr>
{# <tr class=\"cart-subtotal\">
<th>Paiement par wallet</th>
<td><span class=\"amount wallet-payment\">0,00 MAD </span></td>
</tr> #}
{# <tr class=\"cart-subtotal\">
<th>Pourboire pour le livreur</th>
<td><span class=\"amount shipping-tips\">0,00 MAD </span></td>
</tr> #}
\t\t\t\t\t\t\t\t\t\t\t<tr class=\"cart-subtotal\">
<th>Frais de livraison</th>
<td><span class=\"amount shipping-method-fees\">0,00 MAD </span></td>
</tr>
<tr class=\"order-total\">
<th>Montant á payer</th>
<td><strong><span class=\"amount total-checkout total-to-pay \">0,00 MAD</span></strong></td>
</tr>
\t\t\t\t\t\t\t\t\t\t\t
<tr>
<td colspan=\"2\" ><a href=\"#\" class=\"save-button btn btn-primary d-block\">Continuer</a></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</form>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<!--Shopping Cart Area End-->
\t</div>
\t<!-- Body Wrapper End Here -->
<!-- Button trigger modal -->
{% endblock %}
{% block javascripts %}
{{parent()}}
\t<script type=\"text/javascript\" src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBFliT4Ug0Ugto5davRC7krsyMhTfkI-L4&libraries=places\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js\" integrity=\"sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js\" integrity=\"sha512-zlWWyZq71UMApAjih4WkaRpikgY9Bz1oXIW5G0fED4vk14JjGlQ1UmkGM392jEULP8jbNMiwLWdM8Z87Hu88Fw==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
\t<script src=\"{{asset('flexy/js/datedropper/datedropper-javascript.js')}}\"></script>
<script src=\"{{asset('flexy/js/datedropper/datedropper-javascript-lang-FR.js')}}\"></script>
<script>
\tdocument.addEventListener(\"turbo:load\", function() {
var isCollectReadyForCheckout = false;
var isShippingReadyForCheckout = false;
new dateDropper({
lang:\"fr\",
//format: \"dd/m/y\",
selector: \"input[name='startProcessingAt']\",
minDate: \"{{\"yesterday\"|date(\"Y-m-d\")}}\",
//autoFill:false,
expandable: true,
onChange: function (res) {
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
}
});
new dateDropper({
lang:\"fr\",
//format: \"dd/m/y\",
selector: \"input[name='startDeliveryAt']\",
//autoFill:false,
expandable: true,
onChange: function (res) {
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
}
});
\$(document).ready(function(){
\$(\".tips-shipping-agent\").owlCarousel({
dots:true,
items:5,
nav:false,
onChanged:function(){
\$(\".tips-shipping-agent\").removeClass(\"d-none\");
}
});
\$(\".pay-with-wallet\").owlCarousel({
dots:true,
items:7,
nav:false,
onChanged:function(){
\$(\".pay-with-wallet\").removeClass(\"d-none\");
}
});
\$(\".pay-with-wallet .item\").click(function(){
\$(\".pay-with-wallet .item\").removeClass(\"selected\");
\$(this).addClass(\"selected\");
walletPayment = parseFloat(\$(this).attr(\"data-value\"));
\$(\".wallet-payment\").html( (walletPayment) + \" DH\");
\$(\".total-to-pay\").html( ((total) - (amount) - (reductionCoupon) - (walletPayment)) + (shippingFees) + (shippingTips) + \" DH\");
});
var inputCollectAddress = document.getElementById('collect_address');
\t var inputShippingAddress = document.getElementById('shipping_address');
var optionsCollect = {
//types: ['(cities)'],
componentRestrictions: {country: 'ma'}
};
var optionsShipping = {
//types: ['(cities)'],
componentRestrictions: {country: 'ma'}
};
var centerLatCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lat\"); // example latitude
var centerLngCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lng\"); // example longitude
var centerLatShipping =\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lat\"); // example latitude
var centerLngShipping =\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lng\"); // example longitude
var centerPointCollect = new google.maps.LatLng(centerLatCollect, centerLngCollect);
var centerPointShipping = new google.maps.LatLng(centerLatShipping, centerLngShipping);
// Set the desired radius in meters
var radius = 10000; // 10 kilometers
var boundsCollect = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
var boundsShipping = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
\$(\"select[name='collectCityRegion']\").change(function(){
centerLatCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lat\");
centerLngCollect = \$(\"select[name='collectCityRegion']\").find(\"option:selected\").attr(\"data-lng\");
centerPointCollect = new google.maps.LatLng(centerLatCollect, centerLngCollect);
boundsCollect = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
});
\$(\"select[name='shippingCityRegion']\").change(function(){
centerLatShipping = \$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lat\");
centerLngShipping = \$(\"select[name='shippingCityRegion']\").find(\"option:selected\").attr(\"data-lng\");
centerPointShipping = new google.maps.LatLng(centerLatShipping, centerLngShipping);
boundsShipping = new google.maps.Circle({ center: centerPointCollect, radius: radius }).getBounds();
});
var autocompleteCollect = new google.maps.places.Autocomplete(inputCollectAddress, optionsCollect);
var autocompleteShipping = new google.maps.places.Autocomplete(inputShippingAddress, optionsShipping);
google.maps.event.addListener(autocompleteCollect, 'place_changed', function() {
var lngCollect = autocompleteCollect.getPlace().geometry.location.lng();
var latCollect = autocompleteCollect.getPlace().geometry.location.lat();
if (autocompleteCollect.getPlace() && boundsCollect && boundsCollect.contains(autocompleteCollect.getPlace().geometry.location)) {
// Place falls within the specified radius
isCollectReadyForCheckout = true;
console.log('Place collect is within the specified radius:', autocompleteCollect.getPlace());
} else {
isCollectReadyForCheckout = false;
// Place is outside the specified radius
console.log('Place collect is outside the specified radius:', autocompleteCollect.getPlace());
}
});
google.maps.event.addListener(autocompleteShipping, 'place_changed', function() {
var lngShipping = autocompleteShipping.getPlace().geometry.location.lng();
var latShipping = autocompleteShipping.getPlace().geometry.location.lat();
if (autocompleteShipping.getPlace() && boundsShipping && boundsShipping.contains(autocompleteShipping.getPlace().geometry.location)) {
// Place falls within the specified radius
isShippingReadyForCheckout = true;
console.log('Place shipping is within the specified radius:', autocompleteShipping.getPlace());
} else {
isShippingReadyForCheckout = false;
// Place is outside the specified radius
console.log('Place shipping is outside the specified radius:', autocompleteShipping.getPlace());
}
});
\$(\".choices-shipping div div\").click(function(){
\$(\".choices-shipping div div\").removeClass(\"active\");
\$(this).addClass(\"active\");
\t\t\ttotal = cartLS.total();
\t\t\tvar value = \$(this).val();
\t\t\t//shippingFees = parseFloat(\$(this).find(\":selected\").attr(\"data-price\")) ;
\t\t\t//\$(\".shipping-method-fees\").html(shippingFees+ \" DH\");
\t\t\t//\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + \" DH\");
\t\t\t//\$(\"#cash\").trigger(\"keyup\");
\t\t\t\$(\"input[name='startDeliveryAt']\").val(\$(\"input[name='startProcessingAt']\").val());
\t\t\t\$(\"input[name='startProcessingAt']\").trigger(\"change\");
});
\t\$(\".save-button\").click(function(){
if((isCollectReadyForCheckout && isShippingReadyForCheckout) || 1 == 1){
\$.ajax({
url:\"{{path('pos_cart_checkout')}}\",
method:\"POST\",
data:{
\t\t\t\t\t\t\t\torderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\"collecte-and-delivery\",
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
shippingAddress:\$(\"input[name=shipping_address]\").val(),
collectAddress:\$(\"input[name=collect_address]\").val(),
cityRegionCollect:\$(\"select[name='collectCityRegion']\").find(\"option:selected\").val(),
cityRegionShipping:\$(\"select[name='shippingCityRegion']\").find(\"option:selected\").val(),
shippingTips:parseFloat(\$(\".tips-shipping-agent .item.selected\").attr(\"data-value\")),
walletPaymentAmount:parseFloat(\$(\".pay-with-wallet .item.selected\").attr(\"data-value\")),
isReadyForCheckout: true
},
success:function(result){
if(result.status == \"success\");
\t\t\t\t\t\t\t window.location.href = \"{{path('checkout')}}\";
}
});
}else{
\$.toast({
heading: 'Merci de verifier vos cordonnées',
text: \"Vos cordonnées quartiers ou adresses ne sont pas valident merci de verifier !\",
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
});
\t\$(\"input[name='startProcessingAt']\").change(function(){
\$.toast().reset('all');
\$(\".checkout-area\").html(\"\");
var isWallet = 0;
if(\$(\"#isWallet\").is(':checked')){
isWallet = 1;
}
\$.ajax({
url:\"{{path('pos_cart_checkout')}}\",
method:\"POST\",
data:{
orderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\"collecte-and-delivery\",
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"{{ \"next year\"| date('Y-m-d') }}\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"#shipping-method\").find(\"option:selected\").attr(\"data-price\",result.shippingFees);
shippingFees = parseFloat(result.shippingFees) ;
\$(\".shipping-method-fees\").html(shippingFees.toFixed(2)+ \" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
//\$(\"select[name='collectTime']\").modal('show');
\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
/*
\$(\"input[name='startDeliveryAt']\").dateDropper({
large: true,
lang: 'fr',
theme: 'datedropper',
format: \"d-m-Y\",
expandable: true,
rangeStart: result.shippingDate,
rangeEnd: \"{{ \" next year \"|date('Y/m/d') }}\",
disabledDays: \"{{settings.get().getExcludeDatesOnlyDates()|join(',')}}\",
disabledWeekDays: '6'
});
*/
if(result.messages.length > 0){
\$.toast({
heading: 'Décalage de date',
text: result.messages,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
}
});
});
\t\$(\"input[name='startDeliveryAt']\").change(function(){
\$.toast().reset('all');
var isWallet = 0;
if(\$(\"#isWallet\").is(':checked')){
isWallet = 1;
}
\$.ajax({
url:\"{{path('pos_cart_checkout')}}\",
method:\"POST\",
data:{
orderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\$(\"select[name='delivery-type'] option:selected\").val(),
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val()+\" \"+\$(\"select[name='shippingTime']\").find(\"option:selected\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"{{ \"next year\"| date('Y-m-d') }}\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"#shipping-method\").find(\"option:selected\").attr(\"data-price\",result.shippingFees);
shippingFees = parseFloat(result.shippingFees) ;
\$(\".shipping-method-fees\").html(shippingFees.toFixed(2)+ \" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
//\$(\"select[name='collectTime']\").modal('show');
//\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
//\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
\$(\"select[name='shippingTime']\").find(\"option:first\").attr(\"selected\",true);
/*
\$(\"input[name='startDeliveryAt']\").dateDropper({
large: true,
lang: 'fr',
theme: 'datedropper',
format: \"d-m-Y\",
expandable: true,
rangeStart: result.shippingDate,
rangeEnd: \"{{ \" next year \"|date('Y/m/d') }}\",
disabledDays: \"{{settings.get().getExcludeDatesOnlyDates()|join(',')}}\",
disabledWeekDays: '6'
});
*/
if(result.messages.length > 0){
\$.toast({
heading: 'Décalage de date',
text: result.messages,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
}
});
});
\$(\"select[name='collectTime']\").change(function(){
\$.ajax({
url:\"{{path('pos_cart_checkout')}}\",
method:\"POST\",
data:{
\t\t\t\t\t\t\t\torderItems: cartLS.list(),
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
deliveryType:\$(\"select[name='delivery-type'] option:selected\").val(),
//reduction:\$(\"#reduction\").val(),
//payedAmount:\$(\"#cash\").val(),
startProcessingAt: \$(\"input[name=startProcessingAt]\").val()+\" \"+\$(\"select[name='collectTime']\").find(\"option:selected\").val(),
startDeliveryAt:\$(\"input[name=startDeliveryAt]\").val(),
isChooseDatePreview: true
},
success:function(result){
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-min-date\",result.minDateShipping);
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-max-date\",\"{{ \"next year\"| date('Y-m-d') }}\");
\$(\"input[name='startDeliveryAt']\").attr(\"data-dd-opt-default-date\",result.shippingDate);
//\$(\"select[name='collectTime']\").modal('show');
//\$(\"select[name='collectTime']\").html(result.collectHoursHTML);
\$(\"select[name='shippingTime']\").html(result.shippingHoursHTML);
//\$(\"input[name='startProcessingAt']\").val(result.collectDate);
\$(\"input[name='startDeliveryAt']\").val(result.shippingDate);
}
});
});
\$(\"input[name='startProcessingAt']\").trigger(\"change\");
});
\$(\".orderPreview\").click(function(){
\$(\".checkout-area\").html(\"\");
if(cartLS.list().length > 0){
\$.ajax({
url:\"{{path('pos_cart_checkout')}}\",
method:\"POST\",
data:{
shippingMethod:\$(\".shippingMethod.active\").attr(\"data-id\"),
codeCoupon:\$(\"input[name=codeCoupon]\").val(),
isPromoPreview: true
},
success:function(result){
reductionCoupon = 0;
if(result.coupon ){
if(result.coupon.typeReduction==\"percent\"){
reductionCoupon = (total / 100) * result.coupon.valueReduction;
}else{
reductionCoupon = result.coupon.valueReduction;
}
\$(\"input[name='codeCoupon']\").attr(\"data-coupon-value\",result.coupon.valueReduction);
\$(\"input[name='codeCoupon']\").attr(\"data-type-value\",result.coupon.typeReduction);
\$.toast({
heading: result.coupon.code,
text: result.message,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'success',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}else{
\$.toast({
heading: \"Remarque\",
text: result.message,
showHideTransition: 'slide',
hideAfter:12000,
icon: 'warning',
loaderBg: '#1ca5df',
position:\"top-right\",
allowToastClose: true,
stack: false
})
}
\$(\".promo .codepromo\").html(reductionCoupon.toFixed(2)+\" DH\");
\$(\".total-to-pay\").html(((total) - (amount) - (reductionCoupon)) + (shippingFees) + (shippingTips) + \" DH\");
}
});
}
else{
alert(\"Veuillez rajouter des produit au panier\");
}
});
})
</script>
<script>
document.addEventListener(\"turbo:load\", function() {
var collectMap;
var collectGeocoder;
function initCollectMap() {
collectMap = new google.maps.Map(document.getElementById(\"collectMap\"), {
center: { lat: centerLatCollect, lng: centerLngCollect }, // Set initial map center
zoom: 8, // Set initial zoom level
});
collectMap.addListener(\"click\", function (event) {
collectPlaceMarker(event.latLng);
getCollectAddress(event.latLng);
});
}
window.addEventListener('resize', function() {
google.maps.event.trigger(collectMap, 'resize');
});
function collectPlaceMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: collectMap,
});
collectMap.panTo(location);
}
function getCollectAddress(latLng) {
collectGeocoder = new google.maps.Geocoder();
collectGeocoder.geocode({ location: latLng }, function (results, status) {
console.log(results);
if (status === \"OK\") {
if (results[0]) {
console.log(results[0].formatted_address);
} else {
console.log(\"No results found\");
}
} else {
console.log(\"Geocoder failed due to: \" + status);
}
});
}
initCollectMap();
var shippingMap;
var shippingGeocoder;
function initShippingMap() {
shippingMap = new google.maps.Map(document.getElementById(\"shippingMap\"), {
center: { lat: centerLatShipping, lng: centerLngShipping }, // Set initial map center
zoom: 8, // Set initial zoom level
});
shippingMap.addListener(\"click\", function (event) {
shippingPlaceMarker(event.latLng);
getShippingAddress(event.latLng);
});
}
window.addEventListener('resize', function() {
google.maps.event.trigger(shippingMap, 'resize');
});
function shippingPlaceMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: shippingMap,
});
shippingMap.panTo(location);
}
function getShippingAddress(latLng) {
shippingGeocoder = new google.maps.Geocoder();
shippingGeocoder.geocode({ location: latLng }, function (results, status) {
console.log(results);
if (status === \"OK\") {
if (results[0]) {
console.log(results[0].formatted_address);
} else {
console.log(\"No results found\");
}
} else {
console.log(\"Geocoder failed due to: \" + status);
}
});
}
initShippingMap();
\$(\"#modalShippingMap\").click(function(){
\$(\"#shippingMap\").removeClass(\"d-none\");
\$(\"#collectMap\").addClass(\"d-none\");
});
\$(\"#modalCollectMap\").click(function(){
\$(\"#shippingMap\").addClass(\"d-none\");
\$(\"#collectMap\").removeClass(\"d-none\");
});
});
</script>
<!-- Modal -->
<div class=\"modal fade\" id=\"collectMapModal\" tabindex=\"-1\" aria-labelledby=\"collectMapModalLabel\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-xl\" style=\"width:800px;\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"collectMapModalLabel\">Cordonnées de collect</h5>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<div id=\"collectMap\"></div>
<div id=\"shippingMap\" class=\"d-none\"></div>
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Annuler</button>
<button type=\"button\" class=\"btn btn-primary\">Séléctionner</button>
</div
</div>
</div>
</div>
{% endblock %}", "@Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig", "/home/gebcloud/public_html/ilaveu/src/Flexy/FrontBundle/Themes/IlaveU/templates/cart/cart.html.twig");
}
}