<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;
/* frontend/productMasonry.html.twig */
class __TwigTemplate_4d231d4decfc66a6c382465bb358cf2d5803e2f298f7c3f824b97f855a3a1b3e extends \Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
'masonryProducts' => [$this, 'block_masonryProducts'],
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/productMasonry.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/productMasonry.html.twig"));
// line 1
$this->displayBlock('masonryProducts', $context, $blocks);
// line 230
echo "
";
// line 231
if (((isset($context["products"]) || array_key_exists("products", $context)) && (isset($context["noPagination"]) || array_key_exists("noPagination", $context)))) {
// line 232
echo " ";
if ((isset($context["noPagination"]) || array_key_exists("noPagination", $context) ? $context["noPagination"] : (function () { throw new RuntimeError('Variable "noPagination" does not exist.', 232, $this->source); })())) {
// line 233
echo " <script>
function updateLoader() {
if (document.getElementsByClassName('masonry-product').length ==
parseInt(document.getElementById('amountProducts').innerText)
&&
document.getElementById('product-loader')
) {
document.getElementById('product-loader').style.display = 'none';
}
}
updateLoader();
document.addEventListener(\"DOMContentLoaded\", updateLoader);
</script>
";
}
}
// line 249
echo "
";
// line 250
if (((isset($context["products"]) || array_key_exists("products", $context)) && !(isset($context["noPagination"]) || array_key_exists("noPagination", $context)))) {
// line 251
echo " <script>
if( typeof lazyload !== 'undefined')
lazyload();
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
if(supportsTouch){
var elems = document.querySelectorAll(\".button-touch\");
[].forEach.call(elems, function(el) {
el.classList.remove(\"d-none\");
});
}
//console.log('Binding add to cart');
function updateLoader() {
if (document.getElementsByClassName('masonry-product').length ==
parseInt(document.getElementById('amountProducts').innerText)
&&
document.getElementById('product-loader')
) {
document.getElementById('product-loader').style.display = 'none';
}
}
updateLoader();
document.addEventListener(\"DOMContentLoaded\", updateLoader);
function addToCart()
{
console.log('Masonry add to cart called');
event.preventDefault();
var type= this.getAttribute(\"data-type\");
var id= this.getAttribute(\"data-id\");
var quantityWidget = this.getAttribute('data-quantity');
if(quantityWidget && document.getElementById(quantityWidget)){
var quantity = document.getElementById(quantityWidget).value;
}else
var quantity = 1;
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
var total = parseInt(document.getElementById('menu-cart-count').innerHTML);
document.getElementById('menu-cart-count').innerHTML = total+1;
document.getElementById('menu-cart-count').style.display = 'block';;
window.addToCartNotification++;
var json = JSON.parse(xmlHttp.responseText);
console.log(json);
if(document.getElementById('menu_subtotal_cart'))
document.getElementById('menu_subtotal_cart').innerHTML = json.totalCart;
if(document.getElementById('mobile_menu_subtotal_cart'))
document.getElementById('mobile_menu_subtotal_cart').innerHTML = json.totalCart;
}
}
//xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity);
var subscribe = this.getAttribute('data-subscribe');
if( subscribe )
xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity+'/'+subscribe);
else
xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity);
xmlHttp.send();
/*
\$.ajax({
url: Routing.generate('addToCart', {id: id, quantity: quantity}),
method: 'POST',
dataType: 'json',
complete: _this.addedToCart
});
*/
}
var classname = document.getElementsByClassName(\"add-to-cart\");
for (var i = 0; i < classname.length; i++) {
if(!classname[i].classList.contains(\"binded\")){
var classString = classname[i].className;
var newClass = classString.concat(\" binded\");
classname[i].className = newClass;
classname[i].addEventListener('click', addToCart, false);
}
}
</script>
";
// line 355
echo "
<div id=\"paginatorDefaultPage\" class=\"d-none\">";
// line 358
echo $this->extensions['Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension']->render($this->env, (isset($context["products"]) || array_key_exists("products", $context) ? $context["products"] : (function () { throw new RuntimeError('Variable "products" does not exist.', 358, $this->source); })()));
echo "</div>
";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 1
public function block_masonryProducts($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "masonryProducts"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "masonryProducts"));
// line 2
echo "
<div class=\"row mobile_product_row\">
";
// line 4
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["masonryProducts"]) || array_key_exists("masonryProducts", $context) ? $context["masonryProducts"] : (function () { throw new RuntimeError('Variable "masonryProducts" does not exist.', 4, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 5
echo " <div class=\"col-xs-6 col-sm-6 col-md-3 pb-5 mobile_product_box\">
";
// line 7
echo " <div class=\"masonry-product\" data-product=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 7), "html", null, true);
echo "\">
";
// line 9
echo " <div class=\"product-group\">
";
// line 10
if (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 10, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 10)) {
// line 11
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("viewProductInAssociation", ["producerUrl" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 11), "UrlName", [], "any", false, false, false, 11), "productName" => twig_get_attribute($this->env, $this->source, $context["product"], "UrlName", [], "any", false, false, false, 11), "id" => twig_get_attribute($this->env, $this->source, $context["product"], "Id", [], "any", false, false, false, 11), "groupUrlName" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 11, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 11), "urlName", [], "any", false, false, false, 11)]), "html", null, true);
echo "\"
";
// line 12
if ((twig_get_attribute($this->env, $this->source, $context["product"], "isDisplayedInAssociationOnly", [], "any", false, false, false, 12) && (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 12, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 12) == false))) {
echo " style=\"color: red !important;\" ";
}
// line 13
echo " >
";
} else {
// line 15
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("viewProduct", ["producerUrl" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 15), "UrlName", [], "any", false, false, false, 15), "productName" => twig_get_attribute($this->env, $this->source, $context["product"], "UrlName", [], "any", false, false, false, 15), "id" => twig_get_attribute($this->env, $this->source, $context["product"], "Id", [], "any", false, false, false, 15)]), "html", null, true);
echo "\"
";
// line 16
if ((twig_get_attribute($this->env, $this->source, $context["product"], "isDisplayedInAssociationOnly", [], "any", false, false, false, 16) && (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 16, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 16) == false))) {
echo " style=\"color: red !important;\" ";
}
// line 17
echo " >
";
}
// line 19
echo "
";
// line 20
if ((isset($context["forcedProductThumbnail"]) || array_key_exists("forcedProductThumbnail", $context))) {
// line 21
echo " ";
$context["size"] = (isset($context["forcedProductThumbnail"]) || array_key_exists("forcedProductThumbnail", $context) ? $context["forcedProductThumbnail"] : (function () { throw new RuntimeError('Variable "forcedProductThumbnail" does not exist.', 21, $this->source); })());
// line 22
echo " ";
} else {
// line 23
echo " ";
$context["size"] = "250";
// line 24
echo " ";
}
// line 25
echo "
";
// line 26
if (twig_get_attribute($this->env, $this->source, $context["product"], "mainImage", [], "any", false, false, false, 26)) {
// line 27
echo " <img id=\"masonry-product-image-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 27), "html", null, true);
echo "\" class=\"product-image lazyload\" src=\"/images/none.png\" data-src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("getImageAsCroppedThumb", ["id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "mainImage", [], "any", false, false, false, 27), "Id", [], "any", false, false, false, 27), "height" => (isset($context["size"]) || array_key_exists("size", $context) ? $context["size"] : (function () { throw new RuntimeError('Variable "size" does not exist.', 27, $this->source); })()), "width" => (isset($context["size"]) || array_key_exists("size", $context) ? $context["size"] : (function () { throw new RuntimeError('Variable "size" does not exist.', 27, $this->source); })())]), "html", null, true);
echo "\" style=\"margin-left: auto; margin-right: auto;\">
";
} else {
// line 29
echo " <img id=\"masonry-product-image-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 29), "html", null, true);
echo "\" class=\"product-image\" src=\"/assets/frontend/images/noProductPicture.jpg\" style=\"margin-left: auto; margin-right: auto;\">
";
}
// line 31
echo "
</a>
<div class=\"product-btn\">
<button type=\"button\" class=\"product-btn-overview\"
data-toggle=\"modal\"
data-target=\"#previewProduct_";
// line 36
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 36), "html", null, true);
echo "\" style=\"font-size: 9px;\">
APERÇU RAPIDE
</button>
<button class=\"product-btn-like ";
// line 39
if (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 39, $this->source); })()), "hasFavorite", [0 => $context["product"]], "method", false, false, false, 39)) {
echo "product-btn-liked ";
}
echo "\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 39), "html", null, true);
echo "\"></button>
";
// line 41
if (twig_get_attribute($this->env, $this->source, $context["product"], "isSalable", [], "any", false, false, false, 41)) {
// line 42
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["product"], "isSubscribable", [], "any", false, false, false, 42)) {
// line 43
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 43))) {
// line 44
echo " <div class=\"product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 44), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 44), "html", null, true);
echo "\" data-subscribe=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribable", [], "any", false, false, false, 44), "html", null, true);
echo "\">
AJOUTER AU PANIER
</div>
";
} else {
// line 48
echo " <button style=\"background-color: #f0632f;color: white;width:fit-content;\" class=\"product-btn-add-to-cart button button-200 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">AJOUTER AU PANIER
</button>
<div class=\"dropdown-menu\" style=\"width: 300px;text-transform: uppercase;\">
<input id=\"qty-for-product-";
// line 51
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 51), "html", null, true);
echo "\" type=\"hidden\" value=\"1\">
";
// line 52
if ( !twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribable", [], "any", false, false, false, 52)) {
// line 53
echo " <a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 53), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 53), "html", null, true);
echo "\">Sans abonnement</a>
";
}
// line 55
echo " ";
if (( !twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 55) || (twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 55) == 2))) {
// line 56
echo " <a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 56), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 56), "html", null, true);
echo "\" data-subscribe=\"2\">Abonnement hebdomadaire</a>
";
}
// line 58
echo " ";
if (( !twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 58) || (twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 58) == 3))) {
// line 59
echo " <a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 59), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 59), "html", null, true);
echo "\" data-subscribe=\"3\">Abonnement bi-mensuel</a>
";
}
// line 61
echo " ";
if (( !twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 61) || (twig_get_attribute($this->env, $this->source, $context["product"], "isOnlySubscribableToType", [], "any", false, false, false, 61) == 4))) {
// line 62
echo " <a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 62), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 62), "html", null, true);
echo "\" data-subscribe=\"4\">Abonnement mensuel</a>
";
}
// line 64
echo " </div>
";
}
// line 66
echo " ";
} else {
// line 67
echo " <div class=\"product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 67), "html", null, true);
echo "\">
AJOUTER AU PANIER
</div>
";
}
// line 71
echo " ";
} else {
// line 72
echo " <a href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("viewProduct", ["producerUrl" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 72), "UrlName", [], "any", false, false, false, 72), "productName" => twig_get_attribute($this->env, $this->source, $context["product"], "UrlName", [], "any", false, false, false, 72), "id" => twig_get_attribute($this->env, $this->source, $context["product"], "Id", [], "any", false, false, false, 72)]), "html", null, true);
echo "\" class=\"button button-200 button-orange product-btn-add-to-cart\" style=\"background-color: white!important;color: black!important;\">VOIR LE DÉTAIL</a>
";
}
// line 74
echo " </div>
</div>
<div class=\"product\">
";
// line 77
if (twig_get_attribute($this->env, $this->source, $context["product"], "isSalable", [], "any", false, false, false, 77)) {
// line 78
echo " <div class=\"button button-orange add-to-cart button-touch d-none d-none-btn-add-to-cart\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 78), "html", null, true);
echo "\">
AU PANIER
</div>
";
}
// line 82
echo " <div class=\"product-title underline-effect-wrapper\">
<a ";
// line 83
if ((twig_get_attribute($this->env, $this->source, $context["product"], "isDisplayedInAssociationOnly", [], "any", false, false, false, 83) && (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 83, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 83) == false))) {
echo " style=\"color: red !important;\" ";
}
// line 84
echo " class=\"underline-effect underline-effect-h1 underline-effect-black\" href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("viewProduct", ["producerUrl" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 84), "UrlName", [], "any", false, false, false, 84), "productName" => twig_get_attribute($this->env, $this->source, $context["product"], "UrlName", [], "any", false, false, false, 84), "id" => twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 84)]), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "Name", [], "any", false, false, false, 84), "html", null, true);
echo "</a>
</div>
<div class=\"product-subtitle\">
<a href=\"";
// line 87
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("companyStore", ["urlname" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 87), "urlname", [], "any", false, false, false, 87), "id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 87), "id", [], "any", false, false, false, 87)]), "html", null, true);
echo "\"
";
// line 88
if ((twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 88, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 88) && (twig_test_empty(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 88), "associations", [], "any", false, false, false, 88)) || (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 88, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 88), "UrlName", [], "any", false, false, false, 88) != twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 88), "associations", [], "any", false, false, false, 88), 0, [], "array", false, false, false, 88), "UrlName", [], "any", false, false, false, 88))))) {
echo " style=\"color: red !important;\" ";
}
// line 89
echo " >";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 89), "name", [], "any", false, false, false, 89), "html", null, true);
echo "</a>
</div>
<div class=\"product-price\" style=\"align-items: center;\">
";
// line 92
if (twig_get_attribute($this->env, $this->source, $context["product"], "hasDiscount", [], "any", false, false, false, 92)) {
// line 93
echo " <span class=\"\" style=\"\">
<strike>";
// line 94
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "displayPrice", [], "any", false, false, false, 94), "html", null, true);
echo "</strike> ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "displayPrice", [0 => true], "method", false, false, false, 94), "html", null, true);
echo "
</span>
";
} else {
// line 97
echo " ";
// line 98
echo " <span class=\"\" style=\"\">
";
// line 99
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "getPriceUnitStandard", [], "any", false, false, false, 99), "html", null, true);
echo "
</span>
";
}
// line 102
echo " <br>
<span class=\"\" style=\"font-size: 12px;color: gray;display: block;\">
";
// line 104
if (((twig_get_attribute($this->env, $this->source, $context["product"], "getUnitAmount", [], "any", false, false, false, 104) && (twig_get_attribute($this->env, $this->source, $context["product"], "isBoxOfProducts", [], "any", false, false, false, 104) == false)) && twig_get_attribute($this->env, $this->source, $context["product"], "getPricePer100gramme", [], "any", false, false, false, 104))) {
// line 105
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "getPricePer100gramme", [], "any", false, false, false, 105), "html", null, true);
echo "
";
}
// line 107
echo " </span>
</div>
<div>
";
// line 110
if (twig_get_attribute($this->env, $this->source, $context["product"], "isShippedByMaturin", [], "any", false, false, false, 110)) {
// line 111
echo " <img style=\"padding-right: 15px;margin-top: 3px;\" src=\"/images/maturinshipping.png\" alt=\"Livraison par Maturin\" title=\"Livraison par Maturin\" class=\"pull-right\">
";
}
// line 113
echo " ";
if ( !(null === twig_get_attribute($this->env, $this->source, $context["product"], "subCategory", [], "any", false, false, false, 113))) {
// line 114
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["product"], "getOrgaCertification", [], "any", false, false, false, 114) == true)) {
echo "
<img style=\"padding-right: 5px;\" src=\"/images/biosymbol.png\" alt=\"produit biologique\" title=\"produit biologique\" class=\"pull-right\">
";
}
// line 116
echo "
";
// line 117
if ((twig_get_attribute($this->env, $this->source, $context["product"], "conservation", [], "any", false, false, false, 117) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "conservation", [], "any", false, false, false, 117), "id", [], "any", false, false, false, 117) == 6))) {
// line 118
echo " <img style=\"padding-right: 5px;\" src=\"/images/froozen.png\" alt=\"Congelé\" title=\"Congelé\" class=\"pull-right\">
";
} elseif ((twig_get_attribute($this->env, $this->source, // line 119
$context["product"], "conservation", [], "any", false, false, false, 119) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "conservation", [], "any", false, false, false, 119), "id", [], "any", false, false, false, 119) == 5))) {
// line 120
echo " <img style=\"padding-right: 5px;\" src=\"/images/snow.png\" alt=\"Réfrigéré\" title=\"Réfrigéré\" class=\"pull-right\">
";
}
// line 122
echo " ";
}
// line 123
echo " </div>
</div>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 128
echo " </div>
";
// line 130
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["masonryProducts"]) || array_key_exists("masonryProducts", $context) ? $context["masonryProducts"] : (function () { throw new RuntimeError('Variable "masonryProducts" does not exist.', 130, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 131
echo " <!-- Product Modal -->
<div class=\"modal\" id=\"previewProduct_";
// line 132
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "Id", [], "any", false, false, false, 132), "html", null, true);
echo "\" tabindex=\"-1\" role=\"dialog\"
aria-labelledby=\"previewModalTitle\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-dialog-centered modal-lg\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-body\">
<div class=\"row\">
<div class=\"col-6\">
";
// line 139
if (twig_get_attribute($this->env, $this->source, $context["product"], "mainImage", [], "any", false, false, false, 139)) {
// line 140
echo " <img class=\"modal-product-image lazyload\" src=\"/images/none.png\" data-src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("getImageAsFixedWidth", ["id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "mainImage", [], "any", false, false, false, 140), "Id", [], "any", false, false, false, 140), "width" => "270"]), "html", null, true);
echo "\">
";
} else {
// line 142
echo " <img class=\"modal-product-image\" src=\"/assets/frontend/images/noProductPicture.jpg\">
";
}
// line 144
echo " </div>
<div class=\"col-6\">
<div class=\"modal-product-title\" ";
// line 146
if ((twig_get_attribute($this->env, $this->source, $context["product"], "isDisplayedInAssociationOnly", [], "any", false, false, false, 146) && (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 146, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 146) == false))) {
echo " style=\"color: red !important;\" ";
}
echo " >";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "Name", [], "any", false, false, false, 146), "html", null, true);
echo "</div>
<div class=\"modal-product-subtitle\">
<a ";
// line 148
if ((twig_get_attribute($this->env, $this->source, $context["product"], "isDisplayedInAssociationOnly", [], "any", false, false, false, 148) && (twig_get_attribute($this->env, $this->source, (isset($context["global"]) || array_key_exists("global", $context) ? $context["global"] : (function () { throw new RuntimeError('Variable "global" does not exist.', 148, $this->source); })()), "associationUserIsBrowsing", [], "any", false, false, false, 148) == false))) {
echo " style=\"color: red !important;\" ";
}
echo " href=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("companyStore", ["urlname" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 148), "urlname", [], "any", false, false, false, 148), "id" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 148), "id", [], "any", false, false, false, 148)]), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 148), "name", [], "any", false, false, false, 148), "html", null, true);
echo "</a>
</div>
<br><p>";
// line 150
echo twig_join_filter(twig_slice($this->env, twig_split_filter($this->env, strip_tags(twig_get_attribute($this->env, $this->source, $context["product"], "description", [], "any", false, false, false, 150)), " "), 0, 30), " ");
echo "...</p>
<div class=\"product-price\">
";
// line 152
if (twig_get_attribute($this->env, $this->source, $context["product"], "hasDiscount", [], "any", false, false, false, 152)) {
// line 153
echo " <strike>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "displayPrice", [], "any", false, false, false, 153), "html", null, true);
echo "</strike> ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "displayPrice", [0 => true], "method", false, false, false, 153), "html", null, true);
echo "
";
} else {
// line 155
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "displayPrice", [], "any", false, false, false, 155), "html", null, true);
echo "
";
}
// line 157
echo " ";
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "pricings", [], "any", false, false, false, 157)) > 1)) {
// line 158
echo " <h5 class=\"font-weight-bold\">
Format économique
</h5>
<ul style=\"color: darkgray; font-size: small;\">
";
// line 162
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["product"], "pricings", [], "any", false, false, false, 162));
foreach ($context['_seq'] as $context["_key"] => $context["price"]) {
// line 163
echo " <li>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["price"], "displayPrice", [], "any", false, false, false, 163), "html", null, true);
echo "</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['price'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 165
echo " </ul>
";
}
// line 167
echo " </div>
";
// line 169
if (twig_get_attribute($this->env, $this->source, $context["product"], "isShippedByMaturin", [], "any", false, false, false, 169)) {
// line 170
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["product"], "qtyReadyToShip", [], "any", false, false, false, 170) > 0)) {
// line 171
echo " <div class=\"modal-product-in-stock\">En inventaire</div>
";
} else {
// line 173
echo " <div class=\"modal-product-in-stock\">Inventaire épuisé</div>
";
}
// line 175
echo " ";
} else {
// line 176
echo " <div class=\"modal-product-in-stock\">Livraison indépendante</div>
";
}
// line 178
echo "
";
// line 180
if (twig_get_attribute($this->env, $this->source, $context["product"], "isSalable", [], "any", false, false, false, 180)) {
// line 181
echo " <div class=\"modal-product-amount\">
";
// line 182
if ( !twig_get_attribute($this->env, $this->source, $context["product"], "isSubscribable", [], "any", false, false, false, 182)) {
// line 183
echo " <div class=\"modal-product-amount-title\">Quantité</div>
";
}
// line 185
echo " <div class=\"row\">
";
// line 186
if ( !twig_get_attribute($this->env, $this->source, $context["product"], "isSubscribable", [], "any", false, false, false, 186)) {
// line 187
echo " <div class=\"col-12 pb-3\">
<input class=\"form-control modal-product-btn-amount\" id=\"qty-for-product-";
// line 188
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 188), "html", null, true);
echo "\" type=\"number\" name=\"points\" step=\"1\" value=\"1\" min=\"1\">
</div>
";
}
// line 191
echo " <div class=\"col-12\">
";
// line 192
if (twig_get_attribute($this->env, $this->source, $context["product"], "isSubscribable", [], "any", false, false, false, 192)) {
// line 193
echo " <button style=\"background-color: #f0632f;color: white;white-space: nowrap;\" class=\"button button-200 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">AJOUTER AU PANIER
</button>
<div class=\"dropdown-menu\" style=\"width: 300px;text-transform: uppercase;\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
// line 196
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 196), "html", null, true);
echo "\" data-quantity=\"p-qty-s-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 196), "html", null, true);
echo "\">Une seul fois</a>
<input type=\"hidden\" value=\"1\" id=\"p-qty-s-";
// line 197
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 197), "html", null, true);
echo "\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
// line 198
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 198), "html", null, true);
echo "\" data-quantity=\"p-qty-1-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 198), "html", null, true);
echo "\">Abonnement hebdomadaire</a>
<input type=\"hidden\" value=\"2\" id=\"p-qty-1-";
// line 199
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 199), "html", null, true);
echo "\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
// line 200
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 200), "html", null, true);
echo "\" data-quantity=\"p-qty-2-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 200), "html", null, true);
echo "\">Abonnement bi-mensuel</a>
<input type=\"hidden\" value=\"3\" id=\"p-qty-2-";
// line 201
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 201), "html", null, true);
echo "\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"";
// line 202
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 202), "html", null, true);
echo "\" data-quantity=\"p-qty-3-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 202), "html", null, true);
echo "\">Abonnement mensuel</a>
<input type=\"hidden\" value=\"4\" id=\"p-qty-3-";
// line 203
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 203), "html", null, true);
echo "\">
</div>
";
} else {
// line 206
echo " <button class=\"modal-product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 206), "html", null, true);
echo "\" data-quantity=\"qty-for-product-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 206), "html", null, true);
echo "\">
AJOUTER AU PANIER
</button>
";
}
// line 210
echo " </div>
</div>
</div>
";
}
// line 214
echo " <br>
<div class=\"modal-product-complete-list\">
<a href=\"";
// line 216
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("viewProduct", ["producerUrl" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["product"], "company", [], "any", false, false, false, 216), "UrlName", [], "any", false, false, false, 216), "productName" => twig_get_attribute($this->env, $this->source, $context["product"], "UrlName", [], "any", false, false, false, 216), "id" => twig_get_attribute($this->env, $this->source, $context["product"], "id", [], "any", false, false, false, 216)]), "html", null, true);
echo "\">VOIR LA FICHE DU PRODUIT
<span class=\"modal-product-complete-list-arrow\"> </span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Product Modal -->
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "frontend/productMasonry.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 762 => 216, 758 => 214, 752 => 210, 742 => 206, 736 => 203, 730 => 202, 726 => 201, 720 => 200, 716 => 199, 710 => 198, 706 => 197, 700 => 196, 695 => 193, 693 => 192, 690 => 191, 684 => 188, 681 => 187, 679 => 186, 676 => 185, 672 => 183, 670 => 182, 667 => 181, 665 => 180, 661 => 178, 657 => 176, 654 => 175, 650 => 173, 646 => 171, 643 => 170, 641 => 169, 637 => 167, 633 => 165, 624 => 163, 620 => 162, 614 => 158, 611 => 157, 605 => 155, 597 => 153, 595 => 152, 590 => 150, 579 => 148, 570 => 146, 566 => 144, 562 => 142, 556 => 140, 554 => 139, 544 => 132, 541 => 131, 537 => 130, 533 => 128, 523 => 123, 520 => 122, 516 => 120, 514 => 119, 511 => 118, 509 => 117, 506 => 116, 499 => 114, 496 => 113, 492 => 111, 490 => 110, 485 => 107, 479 => 105, 477 => 104, 473 => 102, 467 => 99, 464 => 98, 462 => 97, 454 => 94, 451 => 93, 449 => 92, 442 => 89, 438 => 88, 434 => 87, 425 => 84, 421 => 83, 418 => 82, 410 => 78, 408 => 77, 403 => 74, 397 => 72, 394 => 71, 386 => 67, 383 => 66, 379 => 64, 371 => 62, 368 => 61, 360 => 59, 357 => 58, 349 => 56, 346 => 55, 338 => 53, 336 => 52, 332 => 51, 327 => 48, 315 => 44, 312 => 43, 309 => 42, 307 => 41, 298 => 39, 292 => 36, 285 => 31, 279 => 29, 271 => 27, 269 => 26, 266 => 25, 263 => 24, 260 => 23, 257 => 22, 254 => 21, 252 => 20, 249 => 19, 245 => 17, 241 => 16, 236 => 15, 232 => 13, 228 => 12, 223 => 11, 221 => 10, 218 => 9, 213 => 7, 210 => 5, 206 => 4, 202 => 2, 192 => 1, 177 => 358, 172 => 355, 77 => 251, 75 => 250, 72 => 249, 54 => 233, 51 => 232, 49 => 231, 46 => 230, 44 => 1,);
}
public function getSourceContext()
{
return new Source("{% block masonryProducts %}
<div class=\"row mobile_product_row\">
{% for product in masonryProducts %}
<div class=\"col-xs-6 col-sm-6 col-md-3 pb-5 mobile_product_box\">
{# <div class=\"masonry-layout\"> #}
<div class=\"masonry-product\" data-product=\"{{product.id}}\">
{# <div class=\"masonry-layout__panel-content\"> #}
<div class=\"product-group\">
{% if global.associationUserIsBrowsing %}
<a href=\"{{path('viewProductInAssociation', {'producerUrl': product.company.UrlName, 'productName': product.UrlName, 'id': product.Id, 'groupUrlName': global.associationUserIsBrowsing.urlName})}}\"
{% if product.isDisplayedInAssociationOnly and global.associationUserIsBrowsing == false %} style=\"color: red !important;\" {% endif %}
>
{% else %}
<a href=\"{{path('viewProduct', {'producerUrl': product.company.UrlName, 'productName': product.UrlName, 'id': product.Id })}}\"
{% if product.isDisplayedInAssociationOnly and global.associationUserIsBrowsing == false %} style=\"color: red !important;\" {% endif %}
>
{% endif %}
{% if forcedProductThumbnail is defined %}
{% set size = forcedProductThumbnail %}
{% else %}
{% set size = '250' %}
{% endif %}
{% if product.mainImage %}
<img id=\"masonry-product-image-{{product.id}}\" class=\"product-image lazyload\" src=\"/images/none.png\" data-src=\"{{path('getImageAsCroppedThumb', {'id': product.mainImage.Id, 'height': size, 'width': size})}}\" style=\"margin-left: auto; margin-right: auto;\">
{% else %}
<img id=\"masonry-product-image-{{product.id}}\" class=\"product-image\" src=\"/assets/frontend/images/noProductPicture.jpg\" style=\"margin-left: auto; margin-right: auto;\">
{% endif %}
</a>
<div class=\"product-btn\">
<button type=\"button\" class=\"product-btn-overview\"
data-toggle=\"modal\"
data-target=\"#previewProduct_{{product.id}}\" style=\"font-size: 9px;\">
APERÇU RAPIDE
</button>
<button class=\"product-btn-like {% if global.hasFavorite(product) %}product-btn-liked {% endif %}\" data-id=\"{{product.id}}\"></button>
{% if product.isSalable %}
{% if product.isSubscribable %}
{% if product.isOnlySubscribableToType is not empty %}
<div class=\"product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\" data-subscribe=\"{{product.isOnlySubscribable}}\">
AJOUTER AU PANIER
</div>
{% else %}
<button style=\"background-color: #f0632f;color: white;width:fit-content;\" class=\"product-btn-add-to-cart button button-200 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">AJOUTER AU PANIER
</button>
<div class=\"dropdown-menu\" style=\"width: 300px;text-transform: uppercase;\">
<input id=\"qty-for-product-{{product.id}}\" type=\"hidden\" value=\"1\">
{% if not product.isOnlySubscribable %}
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\">Sans abonnement</a>
{% endif %}
{% if not product.isOnlySubscribableToType or product.isOnlySubscribableToType == 2 %}
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\" data-subscribe=\"2\">Abonnement hebdomadaire</a>
{% endif %}
{% if not product.isOnlySubscribableToType or product.isOnlySubscribableToType == 3 %}
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\" data-subscribe=\"3\">Abonnement bi-mensuel</a>
{% endif %}
{% if not product.isOnlySubscribableToType or product.isOnlySubscribableToType == 4 %}
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\" data-subscribe=\"4\">Abonnement mensuel</a>
{% endif %}
</div>
{% endif %}
{% else %}
<div class=\"product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"{{product.id}}\">
AJOUTER AU PANIER
</div>
{% endif %}
{% else %}
<a href=\"{{path('viewProduct', {'producerUrl':product.company.UrlName, 'productName': product.UrlName, 'id': product.Id})}}\" class=\"button button-200 button-orange product-btn-add-to-cart\" style=\"background-color: white!important;color: black!important;\">VOIR LE DÉTAIL</a>
{% endif %}
</div>
</div>
<div class=\"product\">
{% if product.isSalable %}
<div class=\"button button-orange add-to-cart button-touch d-none d-none-btn-add-to-cart\" data-type=\"product\" data-id=\"{{product.id}}\">
AU PANIER
</div>
{% endif %}
<div class=\"product-title underline-effect-wrapper\">
<a {% if product.isDisplayedInAssociationOnly and global.associationUserIsBrowsing == false %} style=\"color: red !important;\" {% endif %}
class=\"underline-effect underline-effect-h1 underline-effect-black\" href=\"{{path('viewProduct', {'producerUrl': product.company.UrlName, 'productName': product.UrlName, 'id': product.id})}}\">{{product.Name}}</a>
</div>
<div class=\"product-subtitle\">
<a href=\"{{path('companyStore', {'urlname': product.company.urlname, 'id':product.company.id })}}\"
{% if global.associationUserIsBrowsing and (product.company.associations is empty or global.associationUserIsBrowsing.UrlName != product.company.associations[0].UrlName) %} style=\"color: red !important;\" {% endif %}
>{{product.company.name}}</a>
</div>
<div class=\"product-price\" style=\"align-items: center;\">
{% if product.hasDiscount %}
<span class=\"\" style=\"\">
<strike>{{product.displayPrice}}</strike> {{product.displayPrice(true)}}
</span>
{% else %}
{# {{product.displayPrice}} #}
<span class=\"\" style=\"\">
{{ product.getPriceUnitStandard }}
</span>
{% endif %}
<br>
<span class=\"\" style=\"font-size: 12px;color: gray;display: block;\">
{% if product.getUnitAmount and product.isBoxOfProducts == false and product.getPricePer100gramme %}
{{product.getPricePer100gramme}}
{% endif %}
</span>
</div>
<div>
{% if product.isShippedByMaturin %}
<img style=\"padding-right: 15px;margin-top: 3px;\" src=\"/images/maturinshipping.png\" alt=\"Livraison par Maturin\" title=\"Livraison par Maturin\" class=\"pull-right\">
{% endif %}
{% if product.subCategory is not null %}
{% if product.getOrgaCertification == true %}
<img style=\"padding-right: 5px;\" src=\"/images/biosymbol.png\" alt=\"produit biologique\" title=\"produit biologique\" class=\"pull-right\">
{% endif %}
{% if product.conservation and product.conservation.id == 6 %}
<img style=\"padding-right: 5px;\" src=\"/images/froozen.png\" alt=\"Congelé\" title=\"Congelé\" class=\"pull-right\">
{% elseif product.conservation and product.conservation.id == 5 %}
<img style=\"padding-right: 5px;\" src=\"/images/snow.png\" alt=\"Réfrigéré\" title=\"Réfrigéré\" class=\"pull-right\">
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% for product in masonryProducts %}
<!-- Product Modal -->
<div class=\"modal\" id=\"previewProduct_{{product.Id}}\" tabindex=\"-1\" role=\"dialog\"
aria-labelledby=\"previewModalTitle\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-dialog-centered modal-lg\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-body\">
<div class=\"row\">
<div class=\"col-6\">
{% if product.mainImage %}
<img class=\"modal-product-image lazyload\" src=\"/images/none.png\" data-src=\"{{path('getImageAsFixedWidth', {'id': product.mainImage.Id, 'width': '270'})}}\">
{% else %}
<img class=\"modal-product-image\" src=\"/assets/frontend/images/noProductPicture.jpg\">
{% endif %}
</div>
<div class=\"col-6\">
<div class=\"modal-product-title\" {% if product.isDisplayedInAssociationOnly and global.associationUserIsBrowsing == false %} style=\"color: red !important;\" {% endif %} >{{product.Name}}</div>
<div class=\"modal-product-subtitle\">
<a {% if product.isDisplayedInAssociationOnly and global.associationUserIsBrowsing == false %} style=\"color: red !important;\" {% endif %} href=\"{{path('companyStore', {'urlname': product.company.urlname, 'id':product.company.id })}}\">{{product.company.name}}</a>
</div>
<br><p>{{product.description | striptags | split(' ') | slice(0, 30) | join(' ')| raw }}...</p>
<div class=\"product-price\">
{% if product.hasDiscount %}
<strike>{{product.displayPrice}}</strike> {{product.displayPrice(true)}}
{% else %}
{{product.displayPrice}}
{% endif %}
{% if product.pricings | length > 1 %}
<h5 class=\"font-weight-bold\">
Format économique
</h5>
<ul style=\"color: darkgray; font-size: small;\">
{% for price in product.pricings %}
<li>{{price.displayPrice}}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% if product.isShippedByMaturin %}
{% if product.qtyReadyToShip > 0 %}
<div class=\"modal-product-in-stock\">En inventaire</div>
{% else %}
<div class=\"modal-product-in-stock\">Inventaire épuisé</div>
{% endif %}
{% else %}
<div class=\"modal-product-in-stock\">Livraison indépendante</div>
{% endif %}
{% if product.isSalable %}
<div class=\"modal-product-amount\">
{% if not product.isSubscribable %}
<div class=\"modal-product-amount-title\">Quantité</div>
{% endif %}
<div class=\"row\">
{% if not product.isSubscribable %}
<div class=\"col-12 pb-3\">
<input class=\"form-control modal-product-btn-amount\" id=\"qty-for-product-{{product.id}}\" type=\"number\" name=\"points\" step=\"1\" value=\"1\" min=\"1\">
</div>
{% endif %}
<div class=\"col-12\">
{% if product.isSubscribable %}
<button style=\"background-color: #f0632f;color: white;white-space: nowrap;\" class=\"button button-200 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">AJOUTER AU PANIER
</button>
<div class=\"dropdown-menu\" style=\"width: 300px;text-transform: uppercase;\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"p-qty-s-{{product.id}}\">Une seul fois</a>
<input type=\"hidden\" value=\"1\" id=\"p-qty-s-{{product.id}}\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"p-qty-1-{{product.id}}\">Abonnement hebdomadaire</a>
<input type=\"hidden\" value=\"2\" id=\"p-qty-1-{{product.id}}\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"p-qty-2-{{product.id}}\">Abonnement bi-mensuel</a>
<input type=\"hidden\" value=\"3\" id=\"p-qty-2-{{product.id}}\">
<a class=\"dropdown-item add-to-cart\" href=\"#\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"p-qty-3-{{product.id}}\">Abonnement mensuel</a>
<input type=\"hidden\" value=\"4\" id=\"p-qty-3-{{product.id}}\">
</div>
{% else %}
<button class=\"modal-product-btn-add-to-cart button button-200 button-orange add-to-cart\" data-type=\"product\" data-id=\"{{product.id}}\" data-quantity=\"qty-for-product-{{product.id}}\">
AJOUTER AU PANIER
</button>
{% endif %}
</div>
</div>
</div>
{% endif %}
<br>
<div class=\"modal-product-complete-list\">
<a href=\"{{path('viewProduct', {'producerUrl': product.company.UrlName, 'productName': product.UrlName, 'id': product.id})}}\">VOIR LA FICHE DU PRODUIT
<span class=\"modal-product-complete-list-arrow\"> </span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Product Modal -->
{% endfor %}
{% endblock %}
{% if products is defined and noPagination is defined %}
{% if noPagination %}
<script>
function updateLoader() {
if (document.getElementsByClassName('masonry-product').length ==
parseInt(document.getElementById('amountProducts').innerText)
&&
document.getElementById('product-loader')
) {
document.getElementById('product-loader').style.display = 'none';
}
}
updateLoader();
document.addEventListener(\"DOMContentLoaded\", updateLoader);
</script>
{% endif %}
{% endif %}
{% if products is defined and noPagination is not defined %}
<script>
if( typeof lazyload !== 'undefined')
lazyload();
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
if(supportsTouch){
var elems = document.querySelectorAll(\".button-touch\");
[].forEach.call(elems, function(el) {
el.classList.remove(\"d-none\");
});
}
//console.log('Binding add to cart');
function updateLoader() {
if (document.getElementsByClassName('masonry-product').length ==
parseInt(document.getElementById('amountProducts').innerText)
&&
document.getElementById('product-loader')
) {
document.getElementById('product-loader').style.display = 'none';
}
}
updateLoader();
document.addEventListener(\"DOMContentLoaded\", updateLoader);
function addToCart()
{
console.log('Masonry add to cart called');
event.preventDefault();
var type= this.getAttribute(\"data-type\");
var id= this.getAttribute(\"data-id\");
var quantityWidget = this.getAttribute('data-quantity');
if(quantityWidget && document.getElementById(quantityWidget)){
var quantity = document.getElementById(quantityWidget).value;
}else
var quantity = 1;
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
var total = parseInt(document.getElementById('menu-cart-count').innerHTML);
document.getElementById('menu-cart-count').innerHTML = total+1;
document.getElementById('menu-cart-count').style.display = 'block';;
window.addToCartNotification++;
var json = JSON.parse(xmlHttp.responseText);
console.log(json);
if(document.getElementById('menu_subtotal_cart'))
document.getElementById('menu_subtotal_cart').innerHTML = json.totalCart;
if(document.getElementById('mobile_menu_subtotal_cart'))
document.getElementById('mobile_menu_subtotal_cart').innerHTML = json.totalCart;
}
}
//xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity);
var subscribe = this.getAttribute('data-subscribe');
if( subscribe )
xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity+'/'+subscribe);
else
xmlHttp.open(\"post\", '/API/cart/add/'+id+'/'+quantity);
xmlHttp.send();
/*
\$.ajax({
url: Routing.generate('addToCart', {id: id, quantity: quantity}),
method: 'POST',
dataType: 'json',
complete: _this.addedToCart
});
*/
}
var classname = document.getElementsByClassName(\"add-to-cart\");
for (var i = 0; i < classname.length; i++) {
if(!classname[i].classList.contains(\"binded\")){
var classString = classname[i].className;
var newClass = classString.concat(\" binded\");
classname[i].className = newClass;
classname[i].addEventListener('click', addToCart, false);
}
}
</script>
{# <div class=\"row d-none\">
<div class=\"col-sm-12 text-center\">
{% if ajax is defined %}
{{ knp_pagination_render(products, 'bundles/knp-paginator-bundle/ajaxPagination.html.twig', {}, {
'searchToken': searchToken
}) }}
{% else %}
{{ knp_pagination_render(products) }}
{% endif %}
</div>
</div> #}
<div id=\"paginatorDefaultPage\" class=\"d-none\">{{ knp_pagination_render(products) }}</div>
{% endif %}
", "frontend/productMasonry.html.twig", "/var/www/html/Markego/templates/frontend/productMasonry.html.twig");
}
}