public/themes/karen/cart.html.twig line 1

Open in your IDE?
  1. {% extends getThemeDir('base.html.twig') %}
  2. {% block body %}
  3.    <div class="container">
  4.        {% if order %}
  5.            <section class="flex flex-col lg:flex-row justify-between items-start gap-4 child:rounded-lg child:bg-white child:dark:bg-gray-800 child:shadow child:p-4 mt-5">
  6.                <div class="w-full lg:w-3/4 flex flex-col gap-y-8 ">
  7.                    <div class="flex items-center justify-between">
  8.                     <span class="flex items-center gap-x-2">
  9.                         <h2 class="font-DanaMedium text-xl">سبد خرید</h2>
  10.                         <p class="text-gray-400">(2 کالا)</p>
  11.                     </span>
  12.                    </div>
  13.                    <div class="w-full flex flex-col gap-y-4 child:p-2 lg:child:p-4 ">
  14.                        {% for item in order.orderItems %}
  15.                        <div class="w-full flex justify-between relative border-b-2 border-gray-200 dark:border-white/20 ">
  16.                            <div class="flex flex-col sm:flex-row items-center gap-6">
  17.                                <div class="flex w-fit flex-col">
  18.                                    {% if item.product.productImages|length > 0 %}
  19.                                        <img src="{{ item.product.productImages[0].imageUrl }}" class="w-36" alt="">
  20.                                    {% else %}
  21.                                        <img src="/default.jpg" alt="">
  22.                                    {% endif %}
  23.                                </div>
  24.                                <div class="flex flex-col gap-y-4">
  25.                                    <h2 class="font-DanaMedium line-clamp-1">
  26.                                        {{ item.product.name }}
  27.                                    </h2>
  28.                                    <ul class="space-y-3 child:text-sm text-gray-400 child:flex child:items-center child:gap-x-1.5">
  29.                                        {% for attr in item.orderItemAttributes %}
  30.                                            <li>
  31.                                                <svg class="w-5 h-5">
  32.                                                    <use href="#shield"></use>
  33.                                                </svg>
  34.                                                <p class="mt-1">
  35.                                                    {{ attr.attributeName }}: {{ attr.attributeValue }}
  36.                                                </p>
  37.                                            </li>
  38.                                        {% endfor %}
  39.                                    </ul>
  40.                                    <span class="flex items-center gap-x-1 text-gray-700 dark:text-gray-300 font-DanaMedium mt-4">
  41.                                     <p class="font-DanaMedium text-xl">{{ (item.calculatePrice() * item.quantity)|number_format }}</p>
  42.                                     <p class="text-lg">تومان</p>
  43.                                 </span>
  44.                                    <span
  45.                                            class="absolute bottom-3 left-0 text-blue-500 flex sm:hidden items-center gap-x-1 text-sm cursor-pointer">
  46.                                     <a href="{{ path('cart_remove_item' , {'id' : item.id}) }}" class="flex sm:hidden">حذف</a>
  47.                                     <svg class="w-4 h-4">
  48.                                         <use href="#chevron-left"></use>
  49.                                     </svg>
  50.                                 </span>
  51.                                    <svg class=" flex sm:hidden absolute top-0 left-0 w-5 h-5">
  52.                                        <use href="#close"></use>
  53.                                    </svg>
  54.                                </div>
  55.                            </div>
  56.                            <a href="{{ path('cart_remove_item' , {'id' : item.id}) }}" class="hidden sm:flex items-end justify-between flex-col">
  57.                                <svg class="w-5 h-5 cursor-pointer">
  58.                                    <use href="#x-mark"></use>
  59.                                </svg>
  60.                            </a>
  61.                        </div>
  62.                         {% endfor %}
  63.                    </div>
  64.                </div>
  65.                <!-- PRICE BOX -->
  66.                <div class="w-full lg:w-1/4 lg:sticky top-5 flex flex-col gap-y-4">
  67.                    <!-- PRICE -->
  68.                    <ul class="child:flex child:items-center child:justify-between space-y-8">
  69.                        <li>
  70.                            <p>قیمت کالاها({{ order.orderItems|length }})</p>
  71.                            <p class="flex gap-x-1 text-gray-600 dark:text-gray-300 ">{{  total|number_format}} <span class="hidden xl:flex">تومان</span></p>
  72.                        </li>
  73.                        {% if getSettings('accounting_tax_enabled') %}
  74.                            <li>
  75.                                <p>مالیات </p>
  76.                                <p class="font-DanaMedium text-gray-700 dark:text-gray-200">   {{ getSettings('accounting_tax_amount') }}
  77.                                    درصد</p>
  78.                            </li>
  79.                        {% endif %}
  80.                        <li class="border-t-2 border-dashed border-gray-400 pt-8">
  81.                            <p> مبلغ نهایی  :</p>
  82.                            <p>{{ total|number_format}} تومان</p>
  83.                        </li>
  84.                    </ul>
  85.                    <a href="{{ path('cart_checkout') }}"
  86.                       class="w-full mt-4 flex items-center gap-x-1 justify-center bg-blue-500 text-white hover:bg-blue-600 transition-all rounded-lg shadow py-2">
  87.                        تایید و تکمیل سفارش
  88.                        <svg class="w-5 h-5">
  89.                            <use href="#shopping-bag"></use>
  90.                        </svg>
  91.                    </a>
  92.                </div>
  93.            </section>
  94.        {% else %}
  95.            <section class="flex flex-col items-center justify-center gap-y-3 mt-5">
  96.                <img class="max-w-60" src="{{  url('app_cdn_path' , {'path' : 'base-assets/themes/karen/images/svg/empty-cart.svg'})|replaceUrl('http://', 'https://') }}" alt="">
  97.                <h1 class="font-DanaDemiBold text-gray-700 dark:text-gray-300 text-2xl mt-2">
  98.                    سبد خرید شما خالی است!
  99.                </h1>
  100.                <a class="flex items-center justify-center w-fit text-sky-500" href="{{ path('app_shop_site_products') }}">
  101.                    مشاهده فروشگاه
  102.                    <svg class="size-4 mb-0.5">
  103.                        <use href="#chevron-left"></use>
  104.                    </svg>
  105.                </a>
  106.            </section>
  107.        {% endif %}
  108.    </div>
  109. {% endblock %}