first commit
This commit is contained in:
98
catalog/view/template/product/category.twig
Normal file
98
catalog/view/template/product/category.twig
Normal file
@ -0,0 +1,98 @@
|
||||
{{ header }}
|
||||
<div id="product-category" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h2>{{ heading_title }}</h2>
|
||||
{% if thumb or description %}
|
||||
<div class="row">
|
||||
{% if thumb %}
|
||||
<div class="col-sm-2"><img src="{{ thumb }}" alt="{{ heading_title }}" title="{{ heading_title }}" class="img-thumbnail"/></div>
|
||||
{% endif %}
|
||||
{% if description %}
|
||||
<div class="col-sm-10">{{ description }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr/>
|
||||
{% endif %}
|
||||
{% if categories %}
|
||||
<h3>{{ text_refine }}</h3>
|
||||
{% if categories|length <= 5 %}
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<ul>
|
||||
{% for category in categories %}
|
||||
<li><a href="{{ category.href }}">{{ category.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row row-cols-sm-2 row-cols-lg-4">
|
||||
{% for category in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
|
||||
<div class="col">
|
||||
<ul>
|
||||
{% for child in category %}
|
||||
<li><a href="{{ child.href }}">{{ child.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if products %}
|
||||
<div id="display-control" class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="mb-3">
|
||||
<a href="{{ compare }}" id="compare-total" class="btn btn-primary d-block"><i class="fa-solid fa-arrow-right-arrow-left"></i> <span class="d-none d-xl-inline">{{ text_compare }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 d-none d-lg-block">
|
||||
<div class="btn-group">
|
||||
<button type="button" id="button-list" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_list }}"><i class="fa-solid fa-table-list"></i></button>
|
||||
<button type="button" id="button-grid" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_grid }}"><i class="fa-solid fa-table-cells"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 offset-lg-1 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-sort" class="input-group-text">{{ text_sort }}</label> <select id="input-sort" class="form-select" onchange="location = this.value;">
|
||||
{% for sorts in sorts %}
|
||||
<option value="{{ sorts.href }}"{% if sorts.value == '%s-%s'|format(sort, order) %} selected{% endif %}>{{ sorts.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-limit" class="input-group-text">{{ text_limit }}</label> <select id="input-limit" class="form-select" onchange="location = this.value;">
|
||||
{% for limits in limits %}
|
||||
<option value="{{ limits.href }}"{% if limits.value == limit %} selected{% endif %}>{{ limits.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="product-list" class="row row-cols-1 row-cols-sm-2 row-cols-md-2 row-cols-lg-4">
|
||||
{% for product in products %}
|
||||
<div class="col mb-3">{{ product }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not categories and not products %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
<div class="text-end"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
{{ footer }}
|
137
catalog/view/template/product/compare.twig
Normal file
137
catalog/view/template/product/compare.twig
Normal file
@ -0,0 +1,137 @@
|
||||
{{ header }}
|
||||
<div id="product-compare" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-circle-check"></i> {{ success }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h1>{{ heading_title }}</h1>
|
||||
{% if products %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="{{ products|length + 1 }}"><strong>{{ text_product }}</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ text_name }}</td>
|
||||
{% for product in products %}
|
||||
<td><a href="{{ product.href }}"><strong>{{ product.name }}</strong></a></td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_image }}</td>
|
||||
{% for product in products %}
|
||||
<td class="text-center">{% if product.thumb %} <img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-thumbnail"/> {% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_price }}</td>
|
||||
{% for product in products %}
|
||||
<td>{% if not product.special %}
|
||||
{{ product.price }}
|
||||
{% else %}
|
||||
<span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
|
||||
{% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_model }}</td>
|
||||
{% for product in products %}
|
||||
<td>{{ product.model }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_manufacturer }}</td>
|
||||
{% for product in products %}
|
||||
<td>{{ product.manufacturer }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_availability }}</td>
|
||||
{% for product in products %}
|
||||
<td>{{ product.availability }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% if review_status %}
|
||||
<tr>
|
||||
<td>{{ text_rating }}</td>
|
||||
{% for product in products %}
|
||||
<td class="rating">
|
||||
{% for i in 1..5 %}
|
||||
{% if product.rating < i %}
|
||||
<span class="fa-stack"><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% else %}
|
||||
<span class="fa-stack"><i class="fa-solid fa-star fa-stack-1x"></i><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<br/>
|
||||
{{ product.reviews }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>{{ text_summary }}</td>
|
||||
{% for product in products %}
|
||||
<td class="description">{{ product.description }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_weight }}</td>
|
||||
{% for product in products %}
|
||||
<td>{{ product.weight }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_dimension }}</td>
|
||||
{% for product in products %}
|
||||
<td>{{ product.length }} x {{ product.width }} x {{ product.height }}</td>
|
||||
{% endfor %} </tr>
|
||||
</tbody>
|
||||
{% for attribute_group in attribute_groups %}
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="{{ products|length + 1 }}"><strong>{{ attribute_group.name }}</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for key, attribute in attribute_group.attribute %}
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ attribute.name }}</td>
|
||||
{% for product in products %}
|
||||
<td>{% if product.attribute[key] %}{{ product.attribute[key] }}{% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td></td>
|
||||
{% for product in products %}
|
||||
<td class="text-center">
|
||||
<form action="{{ add_to_cart }}" method="post" data-oc-toggle="ajax" data-oc-load="{{ cart }}" data-oc-target="#header-cart">
|
||||
<button type="submit" id="button-confirm" class="btn btn-primary btn-block">{{ button_cart }}</button>
|
||||
<input type="hidden" name="product_id" value="{{ product.product_id }}"/> <input type="hidden" name="quantity" value="{{ product.minimum }}"/>
|
||||
<a href="{{ product.remove }}" class="btn btn-danger btn-block">{{ button_remove }}</a>
|
||||
</form>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
<div class="text-end"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
{{ footer }}
|
61
catalog/view/template/product/manufacturer_info.twig
Normal file
61
catalog/view/template/product/manufacturer_info.twig
Normal file
@ -0,0 +1,61 @@
|
||||
{{ header }}
|
||||
<div id="product-manufacturer" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h2>{{ heading_title }}</h2>
|
||||
{% if products %}
|
||||
<div id="display-control" class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<a href="{{ compare }}" id="compare-total" class="btn btn-primary d-block"><i class="fa-solid fa-arrow-right-arrow-left"></i> <span class="d-inline d-md-none d-lg-inline">{{ text_compare }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 d-none d-md-block">
|
||||
<div class="btn-group">
|
||||
<button type="button" id="button-list" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_list }}"><i class="fa-solid fa-table-list"></i></button>
|
||||
<button type="button" id="button-grid" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_grid }}"><i class="fa-solid fa-table-cells"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 offset-md-1 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-sort" class="input-group-text">{{ text_sort }}</label>
|
||||
<select id="input-sort" class="form-select" onchange="location = this.value;">
|
||||
{% for sorts in sorts %}
|
||||
<option value="{{ sorts.href }}"{% if sorts.value == '%s-%s'|format(sort, order) %} selected{% endif %}>{{ sorts.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-limit" class="input-group-text">{{ text_limit }}</label>
|
||||
<select id="input-limit" class="form-select" onchange="location = this.value;">
|
||||
{% for limits in limits %}
|
||||
<option value="{{ limits.href }}"{% if limits.value == limit %} selected{% endif %}>{{ limits.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="product-list" class="row row-cols-1 row-cols-sm-2 row-cols-md-2 row-cols-lg-4">
|
||||
{% for product in products %}
|
||||
<div class="col mb-3">{{ product }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
<div class="text-end"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
{{ footer }}
|
36
catalog/view/template/product/manufacturer_list.twig
Normal file
36
catalog/view/template/product/manufacturer_list.twig
Normal file
@ -0,0 +1,36 @@
|
||||
{{ header }}
|
||||
<div id="product-manufacturer" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h1>{{ heading_title }}</h1>
|
||||
{% if categories %}
|
||||
<p><strong>{{ text_index }}</strong>
|
||||
{% for category in categories %}
|
||||
<a href="{{ category.href }}#{{ category.name }}">{{ category.name }}</a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% for category in categories %}
|
||||
<h2 id="{{ category.name }}">{{ category.name }}</h2>
|
||||
{% if category.manufacturer %}
|
||||
{% for manufacturers in category.manufacturer|batch(4) %}
|
||||
<div class="row mb-3">
|
||||
{% for manufacturer in manufacturers %}
|
||||
<div class="col-sm-3"><a href="{{ manufacturer.href }}">{{ manufacturer.name }}</a></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
<div class="text-end"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
{{ footer }}
|
393
catalog/view/template/product/product.twig
Normal file
393
catalog/view/template/product/product.twig
Normal file
@ -0,0 +1,393 @@
|
||||
{{ header }}
|
||||
<div id="product-info" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">
|
||||
{{ content_top }}
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
{% if thumb or images %}
|
||||
<div class="col-sm">
|
||||
<div class="image magnific-popup">
|
||||
|
||||
{% if thumb %}
|
||||
<a href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="img-thumbnail mb-3"/></a>
|
||||
{% endif %}
|
||||
|
||||
{% if images %}
|
||||
<div>
|
||||
{% for image in images %}
|
||||
<a href="{{ image.popup }}" title="{{ heading_title }}"><img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="img-thumbnail"/></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="col-sm">
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="list-unstyled">
|
||||
|
||||
{% if manufacturer %}
|
||||
<li>{{ text_manufacturer }} <a href="{{ manufacturers }}">{{ manufacturer }}</a></li>
|
||||
{% endif %}
|
||||
|
||||
<li>{{ text_model }} {{ model }}</li>
|
||||
|
||||
{% if reward %}
|
||||
<li>{{ text_reward }} {{ reward }}</li>
|
||||
{% endif %}
|
||||
|
||||
<li>{{ text_stock }} {{ stock }}</li>
|
||||
</ul>
|
||||
|
||||
{% if price %}
|
||||
<ul class="list-unstyled">
|
||||
{% if not special %}
|
||||
<li>
|
||||
<h2><span class="price-new">{{ price }}</span></h2>
|
||||
</li>
|
||||
{% else %}
|
||||
<li><span class="price-old">{{ price }}</span></li>
|
||||
<li><h2><span class="price-new">{{ special }}</span></h2></li>
|
||||
{% endif %}
|
||||
|
||||
{% if tax %}
|
||||
<li>{{ text_tax }} {{ tax }}</li>
|
||||
{% endif %}
|
||||
|
||||
{% if points %}
|
||||
<li>{{ text_points }} {{ points }}</li>
|
||||
{% endif %}
|
||||
|
||||
{% if discounts %}
|
||||
<li>
|
||||
<hr>
|
||||
</li>
|
||||
{% for discount in discounts %}
|
||||
<li>{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" data-oc-toggle="ajax">
|
||||
<div class="btn-group">
|
||||
<button type="submit" formaction="{{ add_to_wishlist }}" data-bs-toggle="tooltip" class="btn btn-light" title="{{ button_wishlist }}"><i class="fa-solid fa-heart"></i></button>
|
||||
<button type="submit" formaction="{{ add_to_compare }}" data-bs-toggle="tooltip" class="btn btn-light" title="{{ button_compare }}"><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
|
||||
</div>
|
||||
<input type="hidden" name="product_id" value="{{ product_id }}"/>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="product">
|
||||
<form id="form-product">
|
||||
{% if options %}
|
||||
<hr>
|
||||
<h3>{{ text_option }}</h3>
|
||||
<div>
|
||||
{% for option in options %}
|
||||
|
||||
{% if option.type == 'select' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<select name="option[{{ option.product_option_id }}]" id="input-option-{{ option.product_option_id }}" class="form-select">
|
||||
<option value="">{{ text_select }}</option>
|
||||
{% for option_value in option.product_option_value %}
|
||||
<option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
|
||||
{% if option_value.price %}
|
||||
({{ option_value.price_prefix }}{{ option_value.price }})
|
||||
{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'radio' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label class="form-label">{{ option.name }}</label>
|
||||
<div id="input-option-{{ option.product_option_id }}">
|
||||
{% for option_value in option.product_option_value %}
|
||||
<div class="form-check">
|
||||
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" id="input-option-value-{{ option_value.product_option_value_id }}" class="form-check-input"/>
|
||||
<label for="input-option-value-{{ option_value.product_option_value_id }}" class="form-check-label">{% if option_value.image %}<img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %}{{ option_value.price_prefix }} {{ option_value.price }}{% endif %}" class="img-thumbnail"/>{% endif %}
|
||||
{{ option_value.name }}
|
||||
{% if option_value.price %}
|
||||
({{ option_value.price_prefix }}{{ option_value.price }})
|
||||
{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'checkbox' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label class="form-label">{{ option.name }}</label>
|
||||
<div id="input-option-{{ option.product_option_id }}">
|
||||
{% for option_value in option.product_option_value %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" id="input-option-value-{{ option_value.product_option_value_id }}" class="form-check-input"/>
|
||||
<label for="input-option-value-{{ option_value.product_option_value_id }}" class="form-check-label">
|
||||
{% if option_value.image %}
|
||||
<img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %}{{ option_value.price_prefix }} {{ option_value.price }}{% endif %}" class="img-thumbnail"/>{% endif %}
|
||||
{{ option_value.name }}
|
||||
{% if option_value.price %}
|
||||
({{ option_value.price_prefix }}{{ option_value.price }})
|
||||
{% endif %}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'text' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="input-option-{{ option.product_option_id }}" class="form-control"/>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'textarea' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<textarea name="option[{{ option.product_option_id }}]" rows="5" placeholder="{{ option.name }}" id="input-option-{{ option.product_option_id }}" class="form-control">{{ option.value }}</textarea>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'file' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="button-upload-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<div>
|
||||
<button type="button" id="button-upload-{{ option.product_option_id }}" data-oc-toggle="upload" data-oc-url="{{ upload }}" data-oc-target="#input-option-{{ option.product_option_id }}" data-oc-size-max="{{ config_file_max_size }}" data-oc-size-error="{{ error_upload_size }}" class="btn btn-light btn-block"><i class="fa-solid fa-upload"></i> {{ button_upload }}</button>
|
||||
<input type="hidden" name="option[{{ option.product_option_id }}]" value="" id="input-option-{{ option.product_option_id }}"/>
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'date' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" id="input-option-{{ option.product_option_id }}" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'datetime' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" id="input-option-{{ option.product_option_id }}" class="form-control datetime"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if option.type == 'time' %}
|
||||
<div class="mb-3{% if option.required %} required{% endif %}">
|
||||
<label for="input-option-{{ option.product_option_id }}" class="form-label">{{ option.name }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" id="input-option-{{ option.product_option_id }}" class="form-control time"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-option-{{ option.product_option_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if subscription_plans %}
|
||||
<hr/>
|
||||
<h3>{{ text_subscription }}</h3>
|
||||
<div class="mb-3 required">
|
||||
|
||||
<select name="subscription_plan_id" id="input-subscription" class="form-select">
|
||||
<option value="">{{ text_select }}</option>
|
||||
{% for subscription_plan in subscription_plans %}
|
||||
<option value="{{ subscription_plan.subscription_plan_id }}">{{ subscription_plan.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% for subscription_plan in subscription_plans %}
|
||||
<div id="subscription-description-{{ subscription_plan.subscription_plan_id }}" class="form-text subscription d-none">{{ subscription_plan.description }}</div>
|
||||
{% endfor %}
|
||||
<div id="error-subscription" class="invalid-feedback"></div>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="input-quantity" class="form-label">{{ entry_qty }}</label>
|
||||
<input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control"/>
|
||||
<input type="hidden" name="product_id" value="{{ product_id }}" id="input-product-id"/>
|
||||
<div id="error-quantity" class="form-text"></div>
|
||||
<br/>
|
||||
<button type="submit" id="button-cart" class="btn btn-primary btn-lg btn-block">{{ button_cart }}</button>
|
||||
</div>
|
||||
|
||||
{% if minimum > 1 %}
|
||||
<div class="alert alert-info"><i class="fa-solid fa-circle-info"></i> {{ text_minimum }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if review_status %}
|
||||
<div class="rating">
|
||||
<p>{% for i in 1..5 %}
|
||||
{% if rating < i %}
|
||||
<span class="fa-stack"><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% else %}
|
||||
<span class="fa-stack"><i class="fa-solid fa-star fa-stack-1x"></i><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<a href="" onclick="$('a[href=\'#tab-review\']').tab('show'); return false;">{{ text_reviews }}</a> / <a href="" onclick="$('a[href=\'#tab-review\']').tab('show'); return false;">{{ text_write }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-description" data-bs-toggle="tab" class="nav-link active">{{ tab_description }}</a></li>
|
||||
|
||||
{% if attribute_groups %}
|
||||
<li class="nav-item"><a href="#tab-specification" data-bs-toggle="tab" class="nav-link">{{ tab_attribute }}</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if review_status %}
|
||||
<li class="nav-item"><a href="#tab-review" data-bs-toggle="tab" class="nav-link">{{ tab_review }}</a></li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
||||
<div id="tab-description" class="tab-pane fade show active mb-4">{{ description }}</div>
|
||||
|
||||
{% if attribute_groups %}
|
||||
<div id="tab-specification" class="tab-pane fade">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
{% for attribute_group in attribute_groups %}
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2"><strong>{{ attribute_group.name }}</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for attribute in attribute_group.attribute %}
|
||||
<tr>
|
||||
<td>{{ attribute.name }}</td>
|
||||
<td>{{ attribute.text }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if review_status %}
|
||||
<div id="tab-review" class="tab-pane fade mb-4">{{ review }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if products %}
|
||||
<h3>{{ text_related }}</h3>
|
||||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4">
|
||||
{% for product in products %}
|
||||
<div class="col mb-3">{{ product }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tags %}
|
||||
<p>{{ text_tags }}
|
||||
{% for i in 0..(tags|length - 1) %}
|
||||
<a href="{{ tags[i].href }}">{{ tags[i].tag }}</a>{% if not loop.end %},{% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-subscription').on('change', function(e) {
|
||||
var element = this;
|
||||
|
||||
$('.subscription').addClass('d-none');
|
||||
|
||||
$('#subscription-description-' + $(element).val()).removeClass('d-none');
|
||||
});
|
||||
|
||||
$('#form-product').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=checkout/cart.add&language={{ language }}',
|
||||
type: 'post',
|
||||
data: $('#form-product').serialize(),
|
||||
dataType: 'json',
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
cache: false,
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#button-cart').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-cart').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
console.log(json);
|
||||
|
||||
$('#form-product').find('.is-invalid').removeClass('is-invalid');
|
||||
$('#form-product').find('.invalid-feedback').removeClass('d-block');
|
||||
|
||||
if (json['error']) {
|
||||
for (key in json['error']) {
|
||||
$('#input-' + key.replaceAll('_', '-')).addClass('is-invalid').find('.form-control, .form-select, .form-check-input, .form-check-label').addClass('is-invalid');
|
||||
$('#error-' + key.replaceAll('_', '-')).html(json['error'][key]).addClass('d-block');
|
||||
}
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-circle-check"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#header-cart').load('index.php?route=common/cart.info');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.magnific-popup').magnificPopup({
|
||||
type: 'image',
|
||||
delegate: 'a',
|
||||
gallery: {
|
||||
enabled: true
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
99
catalog/view/template/product/review.twig
Normal file
99
catalog/view/template/product/review.twig
Normal file
@ -0,0 +1,99 @@
|
||||
<form id="form-review">
|
||||
<div id="review">{{ list }}</div>
|
||||
<h2>{{ text_write }}</h2>
|
||||
{% if review_guest %}
|
||||
<div class="mb-3 required">
|
||||
<label for="input-name" class="form-label">{{ entry_name }}</label> <input type="text" name="name" value="{{ customer_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3 required">
|
||||
<label for="input-text" class="form-label">{{ entry_review }}</label> <textarea name="text" rows="5" id="input-text" class="form-control"></textarea>
|
||||
<div id="error-text" class="invalid-feedback"></div>
|
||||
<div class="invalid-feedback">{{ text_note }}</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label class="form-label">{{ entry_rating }}</label>
|
||||
<div id="input-rating">
|
||||
{{ entry_bad }}
|
||||
<input type="radio" name="rating" value="1" class="form-check-input"/>
|
||||
|
||||
<input type="radio" name="rating" value="2" class="form-check-input"/>
|
||||
|
||||
<input type="radio" name="rating" value="3" class="form-check-input"/>
|
||||
|
||||
<input type="radio" name="rating" value="4" class="form-check-input"/>
|
||||
|
||||
<input type="radio" name="rating" value="5" class="form-check-input"/>
|
||||
{{ entry_good }}
|
||||
</div>
|
||||
<div id="error-rating" class="invalid-feedback"></div>
|
||||
</div>
|
||||
{{ captcha }}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="{{ back }}" class="btn btn-light">{{ button_back }}</a>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button type="submit" id="button-review" class="btn btn-primary">{{ button_continue }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ text_login }}
|
||||
{% endif %}
|
||||
</form>
|
||||
<script type="text/javascript"><!--
|
||||
$('#review').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#review').load(this.href);
|
||||
});
|
||||
|
||||
// Forms
|
||||
$('#form-review').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=product/review.write&language={{ language }}&review_token={{ review_token }}&product_id={{ product_id }}',
|
||||
type: 'post',
|
||||
data: $('#form-review').serialize(),
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
processData: false,
|
||||
beforeSend: function() {
|
||||
$('#button-review').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-review').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
$('#form-review').find('.is-invalid').removeClass('is-invalid');
|
||||
$('#form-review').find('.invalid-feedback').removeClass('d-block');
|
||||
|
||||
if (json['error']) {
|
||||
if (json['error']['warning']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error']['warning'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
for (key in json['error']) {
|
||||
$('#input-' + key.replaceAll('_', '-')).addClass('is-invalid').find('.form-control, .form-select, .form-check-input, .form-check-label').addClass('is-invalid');
|
||||
$('#error-' + key.replaceAll('_', '-')).html(json['error'][key]).addClass('d-block');
|
||||
}
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#input-text').val('');
|
||||
$('#input-rating input[type=\'radio\']').prop('checked', false);
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
26
catalog/view/template/product/review_list.twig
Normal file
26
catalog/view/template/product/review_list.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% if reviews %}
|
||||
{% for review in reviews %}
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<td style="width: 50%;"><strong>{{ review.author }}</strong></td>
|
||||
<td class="text-end">{{ review.date_added }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><p>{{ review.text }}</p>
|
||||
<div class="rating">
|
||||
{% for i in 1..5 %}
|
||||
{% if review.rating < i %}
|
||||
<span class="fa-stack"><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% else %}
|
||||
<span class="fa-stack"><i class="fa-solid fa-star fa-stack-1x"></i><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endfor %}
|
||||
<div class="text-end">{{ pagination }}</div>
|
||||
{% else %}
|
||||
<p class="text-center">{{ text_no_results }}</p>
|
||||
{% endif %}
|
138
catalog/view/template/product/search.twig
Normal file
138
catalog/view/template/product/search.twig
Normal file
@ -0,0 +1,138 @@
|
||||
{{ header }}
|
||||
<div id="product-search" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<div class="row">
|
||||
<div class="col"><label for="input-search" class="col-form-label">{{ entry_search }}</label></div>
|
||||
</div>
|
||||
<div class="row row-cols-1 row-cols-md-2">
|
||||
<div class="col">
|
||||
<input type="text" name="search" value="{{ search }}" placeholder="{{ text_keyword }}" id="input-search" class="form-control mb-1"/>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="description" value="1" id="input-description" class="form-check-input"{% if description %} checked{% endif %}/> <label for="input-description" class="form-check-label">{{ entry_description }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<select name="category_id" id="input-category" class="form-select mb-1">
|
||||
<option value="0">{{ text_category }}</option>
|
||||
{% for category_1 in categories %}
|
||||
<option value="{{ category_1.category_id }}"{% if category_1.category_id == category_id %} selected{% endif %}>{{ category_1.name }}</option>
|
||||
{% for category_2 in category_1.children %}
|
||||
<option value="{{ category_2.category_id }}"{% if category_2.category_id == category_id %} selected{% endif %}> {{ category_2.name }}</option>
|
||||
{% for category_3 in category_2.children %}
|
||||
<option value="{{ category_3.category_id }}"{% if category_3.category_id == category_id %} selected{% endif %}> {{ category_3.name }}</option>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="sub_category" value="1" id="input-sub-category" class="form-check-input"{% if sub_category %} checked{% endif %}/> <label for="input-sub-category" class="form-check-label">{{ text_sub_category }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-end">
|
||||
<button type="button" id="button-search" class="btn btn-primary">{{ button_search }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<h2>{{ text_search }}</h2>
|
||||
{% if products %}
|
||||
<div id="display-control" class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<a href="{{ compare }}" id="compare-total" class="btn btn-primary d-block"><i class="fa-solid fa-arrow-right-arrow-left"></i> <span class="d-inline d-md-none d-lg-inline">{{ text_compare }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 d-none d-md-block">
|
||||
<div class="btn-group">
|
||||
<button type="button" id="button-list" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_list }}"><i class="fa-solid fa-table-list"></i></button>
|
||||
<button type="button" id="button-grid" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_grid }}"><i class="fa-solid fa-table-cells"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 offset-md-1 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-sort" class="input-group-text">{{ text_sort }}</label>
|
||||
<select id="input-sort" class="form-select" onchange="location = this.value;">
|
||||
{% for sorts in sorts %}
|
||||
<option value="{{ sorts.href }}"{% if sorts.value == '%s-%s'|format(sort, order) %} selected{% endif %}>{{ sorts.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-limit" class="input-group-text">{{ text_limit }}</label>
|
||||
<select id="input-limit" class="form-select" onchange="location = this.value;">
|
||||
{% for limits in limits %}
|
||||
<option value="{{ limits.href }}"{% if limits.value == limit %} selected{% endif %}>{{ limits.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="product-list" class="row row-cols-1 row-cols-sm-2 row-cols-md-2 row-cols-lg-4">
|
||||
{% for product in products %}
|
||||
<div class="col mb-3">{{ product }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-search').bind('click', function() {
|
||||
url = 'index.php?route=product/search&language={{ language }}';
|
||||
|
||||
var search = $('#input-search').val();
|
||||
|
||||
if (search) {
|
||||
url += '&search=' + encodeURIComponent(search);
|
||||
}
|
||||
|
||||
var category_id = $('#input-category').prop('value');
|
||||
|
||||
if (category_id > 0) {
|
||||
url += '&category_id=' + encodeURIComponent(category_id);
|
||||
}
|
||||
|
||||
var sub_category = $('#input-sub-category:checked').prop('value');
|
||||
|
||||
if (sub_category) {
|
||||
url += '&sub_category=1';
|
||||
}
|
||||
|
||||
var filter_description = $('#input-description:checked').prop('value');
|
||||
|
||||
if (filter_description) {
|
||||
url += '&description=1';
|
||||
}
|
||||
|
||||
location = url;
|
||||
});
|
||||
|
||||
$('#input-search').bind('keydown', function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#button-search').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-category').on('change', function() {
|
||||
$('#input-sub-category').prop('disabled', (this.value == '0' ? true : false));
|
||||
});
|
||||
|
||||
$('#input-category').trigger('change');
|
||||
//--></script>
|
||||
{{ footer }}
|
60
catalog/view/template/product/special.twig
Normal file
60
catalog/view/template/product/special.twig
Normal file
@ -0,0 +1,60 @@
|
||||
{{ header }}
|
||||
<div id="product-search" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="row">{{ column_left }}
|
||||
<div id="content" class="col">{{ content_top }}
|
||||
<h2>{{ heading_title }}</h2>
|
||||
{% if products %}
|
||||
<div id="display-control" class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<a href="{{ compare }}" id="compare-total" class="btn btn-primary d-block"><i class="fa-solid fa-arrow-right-arrow-left"></i> <span class="d-inline d-md-none d-lg-inline">{{ text_compare }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 d-none d-md-block">
|
||||
<div class="btn-group">
|
||||
<button type="button" id="button-list" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_list }}"><i class="fa-solid fa-table-list"></i></button>
|
||||
<button type="button" id="button-grid" class="btn btn-light" data-bs-toggle="tooltip" title="{{ button_grid }}"><i class="fa-solid fa-table-cells"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 offset-md-1 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-sort" class="input-group-text">{{ text_sort }}</label> <select id="input-sort" class="form-select" onchange="location = this.value;">
|
||||
{% for sorts in sorts %}
|
||||
<option value="{{ sorts.href }}"{% if sorts.value == '%s-%s'|format(sort, order) %} selected{% endif %}>{{ sorts.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-6">
|
||||
<div class="input-group mb-3">
|
||||
<label for="input-limit" class="input-group-text">{{ text_limit }}</label>
|
||||
<select id="input-limit" class="form-select" onchange="location = this.value;">
|
||||
{% for limits in limits %}
|
||||
<option value="{{ limits.href }}"{% if limits.value == limit %} selected{% endif %}>{{ limits.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="product-list" class="row row-cols-1 row-cols-sm-2 row-cols-md-2 row-cols-lg-4">
|
||||
{% for product in products %}
|
||||
<div class="col mb-3">{{ product }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{{ text_no_results }}</p>
|
||||
<div class="text-end"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
|
||||
{% endif %}
|
||||
{{ content_bottom }}</div>
|
||||
{{ column_right }}</div>
|
||||
</div>
|
||||
{{ footer }}
|
40
catalog/view/template/product/thumb.twig
Normal file
40
catalog/view/template/product/thumb.twig
Normal file
@ -0,0 +1,40 @@
|
||||
<div class="product-thumb">
|
||||
<div class="image"><a href="{{ href }}"><img src="{{ thumb }}" alt="{{ name }}" title="{{ name }}" class="img-fluid"/></a></div>
|
||||
<div class="content">
|
||||
<div class="description">
|
||||
<h4><a href="{{ href }}">{{ name }}</a></h4>
|
||||
<p>{{ description }}</p>
|
||||
{% if price %}
|
||||
<div class="price">
|
||||
{% if not special %}
|
||||
<span class="price-new">{{ price }}</span>
|
||||
{% else %}
|
||||
<span class="price-new">{{ special }}</span> <span class="price-old">{{ price }}</span>
|
||||
{% endif %}
|
||||
{% if tax %}
|
||||
<span class="price-tax">{{ text_tax }} {{ tax }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if review_status and rating %}
|
||||
<div class="rating">
|
||||
{% for i in 1..5 %}
|
||||
{% if rating < i %}
|
||||
<span class="fa-stack"><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% else %}
|
||||
<span class="fa-stack"><i class="fa-solid fa-star fa-stack-1x"></i><i class="fa-regular fa-star fa-stack-1x"></i></span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<form method="post" data-oc-toggle="ajax" data-oc-load="{{ cart }}" data-oc-target="#header-cart">
|
||||
<div class="button-group">
|
||||
<button type="submit" formaction="{{ add_to_cart }}" data-bs-toggle="tooltip" title="{{ button_cart }}"><i class="fa-solid fa-shopping-cart"></i></button>
|
||||
<button type="submit" formaction="{{ add_to_wishlist }}" data-bs-toggle="tooltip" title="{{ button_wishlist }}"><i class="fa-solid fa-heart"></i></button>
|
||||
<button type="submit" formaction="{{ add_to_compare }}" data-bs-toggle="tooltip" title="{{ button_compare }}"><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
|
||||
</div>
|
||||
<input type="hidden" name="product_id" value="{{ product_id }}"/> <input type="hidden" name="quantity" value="{{ minimum }}"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user