templates/ecom/productdetail.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3.   <div class="container-fluid main-holder px-5 bg-light">
  4.     <div class="row">
  5.       <div class="col-lg-3">
  6.         <select class="form-select rounded-pill py-3 px-3 shadow-none border-0 fs-5 bg-transparent fw-bold mb-3" id="">
  7.           <option selected>Select a City</option>
  8.           {% for c in ecomvariables.cities() %}
  9.           <option value="{{ c.id }}">{{ c.name }}</option>
  10.           {% endfor %}
  11.         </select>
  12.       </div>
  13.     </div>
  14.   </div>
  15.   <div class="container-fluid px-5 mt-5">
  16.     <div class="row">
  17.       <div class="col-lg-12">
  18.         <h1 class="fw-bolder">{{ style_city }} <span class="small">/ {{ style.name }}</span></h1>
  19.         <h6>{{ brand.title }}</h6>
  20.       </div>
  21.     </div>
  22.       <div class="row mt-4 ">
  23.       <div class="col-lg-7">
  24.         <div class="product-slider">
  25.           <div class="slider-wrapper">
  26.             <div class="slides">
  27.               {% for k, pim in productimages %}
  28.               <img src="{{ asset(pim.image) }}" alt="Product Image 1">
  29.               {% endfor %}
  30.             </div>
  31.           </div>
  32.           <div class="controls">
  33.             <button class="prev ms-3"><i data-feather="chevron-left" class="iconsize"></i></button>
  34.             <button class="next me-3"><i data-feather="chevron-right" class="iconsize"></i></button>
  35.           </div>
  36.           <div class="thumbnails">
  37.             {% for k, pim in productimages %}
  38.               <img src="{{ asset(pim.image) }}" alt="Thumbnail 1">
  39.             {% endfor %}
  40.           </div>
  41.         </div>
  42.           </div>
  43.           <div class="col-lg-5 pdt-detail">
  44.         <form class="" action="{{ path('sajong_ecom_add_cart') }}" method="post" id="sajong_ecom_add_cart_form" accept-charset="UTF-8">
  45.           <h2 class="fw-bolder mb-3">{{ product.title }}</h2>
  46.           <h4 class="fw-semibold border-bottom pb-5 mb-5" id="product_variation_price">${{ (variations[0].price/100)|number_format(2) }}</h4>
  47.           <h6>Select Size:</h6>
  48.           <select class="form-select rounded-pill py-3 px-4 shadow-none border mb-3" id="" onchange="getprice(this, '{{ path('sajong_ecom_prodcut_price') }}' )">
  49.             <option selected>Choose a size</option> 
  50.             {% for key, psz in prod_sizes %}
  51.             <option value="{{ psz.id }}-{{ psz.vid }}" {% if psz.id == variations[0].size %}selected{% endif %}>{{ psz.name }}</option>
  52.             {% endfor %}
  53.           </select>
  54.           <div class="auto2" style="position:relative; "><div id="ecom-addtocart-overlay" class="btn bg-secondary text-white px-4 py-3 w-100 rounded-pill mb-4" style="position: absolute; display:none;">Adding to Cart....Please wait...</div> <span style="color:red;font-size:10px;display:none" id="carterror">Please select a size</span></div>
  55.           <button type="button" class="btn bg-secondary text-white px-4 py-3 w-100 rounded-pill mb-4" {% if app.user %}onclick="return validateCart();"{% else %}data-bs-toggle="offcanvas" href="#login" role="button" aria-controls="login"{% endif %}>Add to bag</button>
  56.           <h6 class="mt-3">Product Information:</h6>
  57.           {{ product.styledescription|raw }}
  58.           <p class="mt-4">{{ product.description|raw }}</p>
  59.           <input type="hidden" id="productid" name="productid" value="{{ product.id }}" />
  60.           <input type="hidden" id="product_id" name="product_id" value="{{ variations[0].id }}" />
  61.           <input type="hidden" id="product_color" name="field_color" value="{{ variations[0].color }}" />
  62.           <input type="hidden" id="product_size" name="field_size" value="{{ variations[0].size }}" />
  63.           <input type="hidden" id="quantity" name="quantity" value="1" />
  64.           <input type="hidden" name="form_token" value="{{ csrf_token('sajong_ecom_cart_form') }}" />
  65.         </form>
  66.       </div>      
  67.       </div>
  68.       <div class="row mt-5">
  69.       <div class="modal fade" id="allcomments" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  70.         <div class="modal-dialog">
  71.           <div class="modal-content p-3">
  72.             <div class="modal-header border-bottom-0">
  73.               <h5 class="modal-title fs-5" id="exampleModalLabel">Comments</h5>
  74.               <button type="button" class="btn-close shadow-none" data-bs-dismiss="modal" aria-label="Close"></button>
  75.             </div>
  76.             {% for ck, cmt in comments %}
  77.             <div class="modal-body">
  78.               <div class="mb-3 border-bottom">
  79.                 <p class="mb-0 fw-bold">{{ cmt.name }}</p>
  80.                 <small>{{ cmt.updated|date("d M Y") }}</small>
  81.                 <p class="mt-2">{{ cmt.subject }}</p>
  82.               </div>
  83.             </div>
  84.             {% endfor %}
  85.           </div>
  86.         </div>
  87.       </div>
  88.       <div class="col-lg-6">
  89.         <form class="comment-form" action="" method="POST" id="ecom-comment-form" accept-charset="UTF-8" onsubmit="return ecom_post_comment('{{ path('sajong_ecom_save_prodcut_comment') }}');">
  90.           <h4 class="fw-semibold mb-3">Comments</h4>
  91.           <textarea class="form-control shadow-none rounded-pill mb-3" id="comment_body" name="comment_body" rows="4"></textarea>
  92.           <button type="button" class="btn bg-secondary text-white px-4 py-3 w-100 rounded-pill mb-4">Comment</button>
  93.           <input type="hidden" name="pid" value="{{ product.id }}">
  94.           <input type="hidden" name="form_token" value="{{ csrf_token('comment_form') }}">
  95.         </form>
  96.         {% if comments is not empty%}
  97.         <div class="text-end"><a href="#0" class="border-bottom border-secondary" data-bs-toggle="modal" data-bs-target="#allcomments">View All Comments</a></div>
  98.         {% endif %}
  99.           </div>
  100.       </div>
  101.       <div class="row mt-5 mb-5">
  102.       <div class="col-lg-12"><h4 class="fw-bold">Others you might like in your city</h4></div>
  103.       {% for key, rprd in related_products %}
  104.       <div class="col-lg-3 mt-4"> <a href="{{ path('sajong_ecom_product_details', {path: rprd.path}) }}">
  105.         <div class="card border-0 rounded-5 p-0 overflow-hidden shadow-sm"> <img src="{{ asset( rprd.image ) }}" alt="" class="img-fluid"> </div>
  106.         <h6 class="fw-bold mb-3 mt-3">{{ rprd.title }}</h6>
  107.         <h6 class="fw-bold mb-4">{{ (rprd.price/100)|number_format(2) }}</h6>
  108.         </a> 
  109.       </div>
  110.       {% endfor %}
  111.       </div>
  112.   </div>
  113. {% endblock %}