2015-02-24 12:20:44 +00:00
|
|
|
{% macro product_image_square(website_image, css_class="") %}
|
2022-10-04 04:27:07 +00:00
|
|
|
<div class="product-image product-image-square h-100 rounded
|
2016-11-14 07:43:53 +00:00
|
|
|
{% if not website_image -%} missing-image {%- endif %} {{ css_class }}"
|
|
|
|
{% if website_image -%}
|
|
|
|
style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');"
|
|
|
|
{%- endif %}>
|
2015-02-24 12:20:44 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
{% macro product_image(website_image, css_class="product-image", alt="", no_border=False) %}
|
|
|
|
<div class="{{ 'border' if not no_border else ''}} text-center rounded {{ css_class }}" style="overflow: hidden;">
|
2021-06-08 18:41:48 +00:00
|
|
|
{% if website_image %}
|
|
|
|
<img itemprop="image" class="website-image h-100 w-100" alt="{{ alt }}" src="{{ frappe.utils.quoted(website_image) | abs_url }}">
|
|
|
|
{% else %}
|
|
|
|
<div class="card-img-top no-image-item">
|
|
|
|
{{ frappe.utils.get_abbr(alt) or "NA" }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-12-24 06:10:33 +00:00
|
|
|
</div>
|
2015-09-11 13:19:59 +00:00
|
|
|
{% endmacro %}
|
2017-02-13 16:22:43 +00:00
|
|
|
|
|
|
|
{% macro media_image(website_image, name, css_class="") %}
|
2017-02-14 11:02:48 +00:00
|
|
|
<div class="product-image sidebar-image-wrapper {{ css_class }}">
|
|
|
|
{% if not website_image -%}
|
|
|
|
<div class="sidebar-standard-image"> <div class="standard-image" style="background-color: rgb(250, 251, 252);">{{name}}</div> </div>
|
|
|
|
{%- endif %}
|
2020-12-24 06:10:33 +00:00
|
|
|
{% if website_image -%}
|
2017-02-13 16:22:43 +00:00
|
|
|
<a href="{{ frappe.utils.quoted(website_image) }}">
|
2017-02-14 11:02:48 +00:00
|
|
|
<img itemprop="image" src="{{ frappe.utils.quoted(website_image) | abs_url }}"
|
|
|
|
class="img-responsive img-thumbnail sidebar-image" style="min-height:100%; min-width:100%;">
|
2017-02-13 16:22:43 +00:00
|
|
|
</a>
|
2020-12-24 06:10:33 +00:00
|
|
|
{%- endif %}
|
|
|
|
</div>
|
2017-02-13 16:22:43 +00:00
|
|
|
{% endmacro %}
|
2019-03-19 06:18:32 +00:00
|
|
|
|
|
|
|
{% macro render_homepage_section(section) %}
|
|
|
|
|
|
|
|
{% if section.section_based_on == 'Custom HTML' and section.section_html %}
|
|
|
|
{{ section.section_html }}
|
|
|
|
{% elif section.section_based_on == 'Cards' %}
|
|
|
|
<section class="container my-5">
|
|
|
|
<h3>{{ section.name }}</h3>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
{% for card in section.section_cards %}
|
|
|
|
<div class="col-md-{{ section.column_value }} mb-4">
|
|
|
|
<div class="card h-100 justify-content-between">
|
|
|
|
{% if card.image %}
|
2022-08-09 13:19:14 +00:00
|
|
|
<img class="card-img-top h-75" src="{{ card.image }}" loading="lazy" alt="{{ card.title }}"></img>
|
2019-03-19 06:18:32 +00:00
|
|
|
{% endif %}
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">{{ card.title }}</h5>
|
|
|
|
<p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p>
|
2019-06-01 15:26:37 +00:00
|
|
|
<p class="card-text">{{ card.content or '' | truncate(140, True) }}</p>
|
2019-03-19 06:18:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="card-body flex-grow-0">
|
|
|
|
<a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-12-24 06:10:33 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
2021-05-17 15:14:41 +00:00
|
|
|
{%- macro item_card(item, is_featured=False, is_full_width=False, align="Left") -%}
|
2020-12-24 06:10:33 +00:00
|
|
|
{%- set align_items_class = resolve_class({
|
|
|
|
'align-items-end': align == 'Right',
|
|
|
|
'align-items-center': align == 'Center',
|
|
|
|
'align-items-start': align == 'Left',
|
|
|
|
}) -%}
|
|
|
|
{%- set col_size = 3 if is_full_width else 4 -%}
|
2021-05-12 19:52:05 +00:00
|
|
|
{%- set title = item.web_item_name or item.item_name or item.item_code -%}
|
|
|
|
{%- set title = title[:50] + "..." if title|len > 50 else title -%}
|
2022-06-27 07:30:00 +00:00
|
|
|
{%- set image = item.website_image -%}
|
2021-03-11 15:54:47 +00:00
|
|
|
{%- set description = item.website_description or item.description-%}
|
|
|
|
|
2020-12-24 06:10:33 +00:00
|
|
|
{% if is_featured %}
|
|
|
|
<div class="col-sm-{{ col_size*2 }} item-card">
|
2021-05-24 20:05:22 +00:00
|
|
|
<div class="card featured-item {{ align_items_class }}" style="height: 360px;">
|
2020-12-24 06:10:33 +00:00
|
|
|
{% if image %}
|
|
|
|
<div class="row no-gutters">
|
2021-05-24 20:05:22 +00:00
|
|
|
<div class="col-md-5 ml-4">
|
2020-12-24 06:10:33 +00:00
|
|
|
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
2021-05-17 15:14:41 +00:00
|
|
|
{{ item_card_body(title, description, item, is_featured, align) }}
|
2020-12-24 06:10:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="col-md-12">
|
2021-05-17 15:14:41 +00:00
|
|
|
{{ item_card_body(title, description, item, is_featured, align) }}
|
2020-12-24 06:10:33 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="col-sm-{{ col_size }} item-card">
|
2021-05-24 20:05:22 +00:00
|
|
|
<div class="card {{ align_items_class }}" style="height: 360px;">
|
2020-12-24 06:10:33 +00:00
|
|
|
{% if image %}
|
2021-03-11 05:26:00 +00:00
|
|
|
<div class="card-img-container">
|
2021-03-11 15:54:47 +00:00
|
|
|
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
|
2021-03-11 05:26:00 +00:00
|
|
|
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-01-20 12:22:54 +00:00
|
|
|
{% else %}
|
2021-03-11 15:54:47 +00:00
|
|
|
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
|
2021-03-11 05:26:00 +00:00
|
|
|
<div class="card-img-top no-image">
|
|
|
|
{{ frappe.utils.get_abbr(title) }}
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-12-24 06:10:33 +00:00
|
|
|
{% endif %}
|
2021-05-17 15:14:41 +00:00
|
|
|
{{ item_card_body(title, description, item, is_featured, align) }}
|
2020-12-24 06:10:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
2021-05-17 15:14:41 +00:00
|
|
|
{%- macro item_card_body(title, description, item, is_featured, align) -%}
|
2020-12-24 06:10:33 +00:00
|
|
|
{%- set align_class = resolve_class({
|
|
|
|
'text-right': align == 'Right',
|
|
|
|
'text-center': align == 'Center' and not is_featured,
|
|
|
|
'text-left': align == 'Left' or is_featured,
|
|
|
|
}) -%}
|
2021-03-11 05:26:00 +00:00
|
|
|
<div class="card-body {{ align_class }}" style="width:100%">
|
2021-05-24 20:05:22 +00:00
|
|
|
<div class="mt-4">
|
2021-03-11 15:54:47 +00:00
|
|
|
<a href="/{{ item.route or '#' }}">
|
2021-05-12 19:52:05 +00:00
|
|
|
<div class="product-title">
|
|
|
|
{{ title or '' }}
|
|
|
|
</div>
|
2021-03-11 05:26:00 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2020-12-24 06:10:33 +00:00
|
|
|
{% if is_featured %}
|
2021-05-24 20:05:22 +00:00
|
|
|
<div class="product-description ellipsis text-muted" style="white-space: normal;">
|
|
|
|
{{ description or '' }}
|
|
|
|
</div>
|
2020-12-24 06:10:33 +00:00
|
|
|
{% else %}
|
2021-04-12 19:09:26 +00:00
|
|
|
<div class="product-category">{{ item.item_group or '' }}</div>
|
2020-12-24 06:10:33 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
2021-03-15 18:35:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
{%- macro wishlist_card(item, settings) %}
|
2021-07-08 08:28:00 +00:00
|
|
|
{%- set title = item.web_item_name or ''-%}
|
2021-07-13 20:06:50 +00:00
|
|
|
{%- set title = title[:90] + "..." if title|len > 90 else title -%}
|
2021-04-12 19:09:26 +00:00
|
|
|
<div class="col-sm-3 wishlist-card">
|
2021-07-13 20:06:50 +00:00
|
|
|
<div class="card text-center">
|
2021-06-08 14:10:26 +00:00
|
|
|
<div class="card-img-container">
|
|
|
|
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
|
|
|
|
{% if item.image %}
|
2021-03-15 18:35:53 +00:00
|
|
|
<img class="card-img" src="{{ item.image }}" alt="{{ title }}">
|
2021-06-08 14:10:26 +00:00
|
|
|
{% else %}
|
|
|
|
<div class="card-img-top no-image">
|
|
|
|
{{ frappe.utils.get_abbr(title) }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</a>
|
|
|
|
<div class="remove-wish" data-item-code="{{ item.item_code }}">
|
2021-07-13 20:06:50 +00:00
|
|
|
<svg class="icon icon-md remove-wish-icon">
|
|
|
|
<use class="close" href="#icon-delete"></use>
|
|
|
|
</svg>
|
2021-03-15 18:35:53 +00:00
|
|
|
</div>
|
2021-06-08 14:10:26 +00:00
|
|
|
</div>
|
2021-03-15 18:35:53 +00:00
|
|
|
|
2021-07-08 08:28:00 +00:00
|
|
|
{{ wishlist_card_body(item, title, settings) }}
|
2021-03-15 18:35:53 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
2021-07-08 08:28:00 +00:00
|
|
|
{%- macro wishlist_card_body(item, title, settings) %}
|
2021-07-13 20:06:50 +00:00
|
|
|
<div class="card-body card-body-flex text-left" style="width: 100%;">
|
|
|
|
<div class="mt-4">
|
2021-07-08 08:28:00 +00:00
|
|
|
<div class="product-title">{{ title or ''}}</div>
|
2021-07-13 20:06:50 +00:00
|
|
|
<div class="product-category">{{ item.item_group or '' }}</div>
|
2021-03-15 18:35:53 +00:00
|
|
|
</div>
|
2021-04-12 19:09:26 +00:00
|
|
|
<div class="product-price">
|
2021-07-13 20:06:50 +00:00
|
|
|
{{ item.get("formatted_price") or '' }}
|
2021-04-12 19:09:26 +00:00
|
|
|
|
|
|
|
{% if item.get("formatted_mrp") %}
|
2021-07-13 20:06:50 +00:00
|
|
|
<small class="ml-1 striked-price">
|
2021-04-12 19:09:26 +00:00
|
|
|
<s>{{ item.formatted_mrp }}</s>
|
|
|
|
</small>
|
2021-07-13 20:06:50 +00:00
|
|
|
<small class="ml-1 product-info-green" >
|
2021-04-12 19:09:26 +00:00
|
|
|
{{ item.discount }} OFF
|
|
|
|
</small>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-03-15 18:35:53 +00:00
|
|
|
|
|
|
|
{% if (item.available and settings.show_stock_availability) or (not settings.show_stock_availability) %}
|
2021-04-12 19:09:26 +00:00
|
|
|
<!-- Show move to cart button if in stock or if showing stock availability is disabled -->
|
2021-07-13 20:06:50 +00:00
|
|
|
<button data-item-code="{{ item.item_code}}"
|
|
|
|
class="btn btn-primary btn-add-to-cart-list btn-add-to-cart mt-2 w-100">
|
2021-04-12 19:09:26 +00:00
|
|
|
<span class="mr-2">
|
|
|
|
<svg class="icon icon-md">
|
|
|
|
<use href="#icon-assets"></use>
|
|
|
|
</svg>
|
|
|
|
</span>
|
|
|
|
{{ _("Move to Cart") }}
|
|
|
|
</button>
|
2021-03-15 18:35:53 +00:00
|
|
|
{% else %}
|
2021-07-13 20:06:50 +00:00
|
|
|
<div class="out-of-stock">
|
|
|
|
{{ _("Out of stock") }}
|
2021-04-12 19:09:26 +00:00
|
|
|
</div>
|
2021-03-15 18:35:53 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
2021-03-25 06:22:50 +00:00
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
{%- macro ratings_with_title(avg_rating, title, size, rating_header_class, for_summary=False) -%}
|
|
|
|
<div class="{{ 'd-flex' if not for_summary else '' }}">
|
|
|
|
<p class="mr-4 {{ rating_header_class }}">
|
|
|
|
<span>{{ title }}</span>
|
|
|
|
</p>
|
|
|
|
<div class="rating {{ 'ratings-pill' if for_summary else ''}}">
|
2021-03-25 06:22:50 +00:00
|
|
|
{% for i in range(1,6) %}
|
|
|
|
{% set fill_class = 'star-click' if i <= avg_rating else '' %}
|
|
|
|
<svg class="icon icon-{{ size }} {{ fill_class }}">
|
|
|
|
<use href="#icon-star"></use>
|
|
|
|
</svg>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
2021-04-07 18:19:04 +00:00
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
{%- macro ratings_summary(reviews, reviews_per_rating, average_rating, average_whole_rating, for_summary=False, total_reviews=None)-%}
|
|
|
|
<div class="rating-summary-section mt-4">
|
|
|
|
<div class="rating-summary-numbers col-3">
|
|
|
|
<h2 style="font-size: 2rem;">
|
|
|
|
{{ average_rating or 0 }}
|
|
|
|
</h2>
|
|
|
|
<div class="mb-2" style="margin-top: -.5rem;">
|
2021-08-09 15:30:31 +00:00
|
|
|
{{ frappe.utils.cstr(total_reviews or 0) + " " + _("ratings") }}
|
2021-07-13 18:16:24 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Ratings Summary -->
|
|
|
|
{% if reviews %}
|
|
|
|
{% set rating_title = frappe.utils.cstr(average_rating) + " " + _("out of 5") if not for_summary else ''%}
|
|
|
|
{{ ratings_with_title(average_whole_rating, rating_title, "md", "rating-summary-title", for_summary) }}
|
|
|
|
{% endif %}
|
2021-04-07 18:19:04 +00:00
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
<div class="mt-2">{{ frappe.utils.cstr(average_rating or 0) + " " + _("out of 5") }}</div>
|
|
|
|
</div>
|
2021-04-07 18:19:04 +00:00
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
<!-- Rating Progress Bars -->
|
|
|
|
<div class="rating-progress-bar-section col-4 ml-4">
|
|
|
|
{% for percent in reviews_per_rating %}
|
|
|
|
<div class="col-sm-4 small rating-bar-title">
|
|
|
|
{{ loop.index }} star
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-7">
|
|
|
|
<div class="progress rating-progress-bar" title="{{ percent }} % of reviews are {{ loop.index }} star">
|
|
|
|
<div class="progress-bar progress-bar-cosmetic" role="progressbar"
|
|
|
|
aria-valuenow="{{ percent }}"
|
|
|
|
aria-valuemin="0" aria-valuemax="100"
|
|
|
|
style="width: {{ percent }}%;">
|
|
|
|
</div>
|
2021-04-07 18:19:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-13 18:16:24 +00:00
|
|
|
<div class="col-sm-1 small">
|
|
|
|
{{ percent }}%
|
|
|
|
</div>
|
2021-04-07 18:19:04 +00:00
|
|
|
</div>
|
2021-07-13 18:16:24 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2021-04-07 18:19:04 +00:00
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
{%- macro user_review(reviews)-%}
|
|
|
|
<!-- User Reviews -->
|
|
|
|
<div class="user-reviews">
|
|
|
|
{% for review in reviews %}
|
|
|
|
<div class="mb-3 review">
|
2021-07-13 18:16:24 +00:00
|
|
|
{{ ratings_with_title(review.rating, _(review.review_title), "sm", "user-review-title") }}
|
2021-04-07 18:19:04 +00:00
|
|
|
|
2021-07-13 18:16:24 +00:00
|
|
|
<div class="product-description mb-4">
|
2021-04-07 18:19:04 +00:00
|
|
|
<p>
|
|
|
|
{{ _(review.comment) }}
|
|
|
|
</p>
|
|
|
|
</div>
|
2021-07-13 18:16:24 +00:00
|
|
|
|
|
|
|
<div class="review-signature mb-2">
|
|
|
|
<span class="reviewer">{{ _(review.customer) }}</span>
|
|
|
|
<span class="indicator grey" style="--text-on-gray: var(--gray-300);"></span>
|
|
|
|
<span class="reviewer">{{ review.published_on }}</span>
|
|
|
|
</div>
|
2021-04-07 18:19:04 +00:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|
2021-04-20 16:24:52 +00:00
|
|
|
|
|
|
|
{%- macro field_filter_section(filters)-%}
|
|
|
|
{% for field_filter in filters %}
|
|
|
|
{%- set item_field = field_filter[0] %}
|
|
|
|
{%- set values = field_filter[1] %}
|
|
|
|
<div class="mb-4 filter-block pb-5">
|
|
|
|
<div class="filter-label mb-3">{{ item_field.label }}</div>
|
|
|
|
|
|
|
|
{% if values | len > 20 %}
|
|
|
|
<!-- show inline filter if values more than 20 -->
|
2022-03-21 12:23:18 +00:00
|
|
|
<input type="text" class="form-control form-control-sm mb-2 filter-lookup-input" placeholder="Search {{ item_field.label + 's' }}"/>
|
2021-04-20 16:24:52 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if values %}
|
|
|
|
<div class="filter-options">
|
|
|
|
{% for value in values %}
|
2022-03-21 12:23:18 +00:00
|
|
|
<div class="filter-lookup-wrapper checkbox" data-value="{{ value }}">
|
2021-04-20 16:24:52 +00:00
|
|
|
<label for="{{value}}">
|
|
|
|
<input type="checkbox"
|
|
|
|
class="product-filter field-filter"
|
|
|
|
id="{{value}}"
|
|
|
|
data-filter-name="{{ item_field.fieldname }}"
|
2021-06-08 16:44:20 +00:00
|
|
|
data-filter-value="{{ value }}"
|
|
|
|
style="width: 14px !important">
|
2021-04-20 16:24:52 +00:00
|
|
|
<span class="label-area">{{ value }}</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<i class="text-muted">{{ _('No values') }}</i>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
{%- macro attribute_filter_section(filters)-%}
|
|
|
|
{% for attribute in filters %}
|
|
|
|
<div class="mb-4 filter-block pb-5">
|
2022-03-21 12:23:18 +00:00
|
|
|
<div class="filter-label mb-3">{{ attribute.name }}</div>
|
|
|
|
{% if attribute.item_attribute_values | len > 20 %}
|
2021-04-20 16:24:52 +00:00
|
|
|
<!-- show inline filter if values more than 20 -->
|
2022-03-21 12:23:18 +00:00
|
|
|
<input type="text" class="form-control form-control-sm mb-2 filter-lookup-input" placeholder="Search {{ attribute.name + 's' }}"/>
|
2021-04-20 16:24:52 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if attribute.item_attribute_values %}
|
|
|
|
<div class="filter-options">
|
|
|
|
{% for attr_value in attribute.item_attribute_values %}
|
2022-03-21 12:23:18 +00:00
|
|
|
<div class="filter-lookup-wrapper checkbox" data-value="{{ attr_value }}">
|
2021-05-12 19:52:05 +00:00
|
|
|
<label data-value="{{ attr_value }}">
|
2021-04-20 16:24:52 +00:00
|
|
|
<input type="checkbox"
|
|
|
|
class="product-filter attribute-filter"
|
2022-02-01 06:45:48 +00:00
|
|
|
id="{{ attr_value }}"
|
2021-04-20 16:24:52 +00:00
|
|
|
data-attribute-name="{{ attribute.name }}"
|
2022-02-01 06:45:48 +00:00
|
|
|
data-attribute-value="{{ attr_value }}"
|
2021-06-08 16:44:20 +00:00
|
|
|
style="width: 14px !important"
|
2021-04-20 16:24:52 +00:00
|
|
|
{% if attr_value.checked %} checked {% endif %}>
|
2022-02-01 06:45:48 +00:00
|
|
|
<span class="label-area">{{ attr_value }}</span>
|
2021-04-20 16:24:52 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<i class="text-muted">{{ _('No values') }}</i>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{%- endmacro -%}
|
2021-07-13 18:16:24 +00:00
|
|
|
|
|
|
|
{%- macro recommended_item_row(item)-%}
|
|
|
|
<div class="recommended-item mb-6 d-flex">
|
|
|
|
<div class="r-item-image">
|
|
|
|
{% if item.website_item_thumbnail %}
|
2021-09-01 09:27:50 +00:00
|
|
|
{{ product_image(item.website_item_thumbnail, css_class="r-product-image", alt="item.website_item_name", no_border=True) }}
|
2021-07-13 18:16:24 +00:00
|
|
|
{% else %}
|
2021-09-01 09:27:50 +00:00
|
|
|
<div class="no-image-r-item">
|
2021-07-13 18:16:24 +00:00
|
|
|
{{ frappe.utils.get_abbr(item.website_item_name) or "NA" }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="r-item-info">
|
|
|
|
<a href="/{{ item.route or '#'}}" target="_blank">
|
|
|
|
{% set title = item.website_item_name %}
|
|
|
|
{{ title[:70] + "..." if title|len > 70 else title }}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{% if item.get('price_info') %}
|
|
|
|
{% set price = item.get('price_info') %}
|
|
|
|
<div class="mt-2">
|
|
|
|
<span class="item-price">
|
|
|
|
{{ price.get('formatted_price') or '' }}
|
|
|
|
</span>
|
|
|
|
|
|
|
|
{% if price.get('formatted_mrp') %}
|
|
|
|
<br>
|
|
|
|
<span class="striked-item-price">
|
|
|
|
<s>MRP {{ price.formatted_mrp }}</s>
|
|
|
|
</span>
|
|
|
|
<span class="in-green">
|
|
|
|
- {{ price.get('formatted_discount_percent') or price.get('formatted_discount_rate')}}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endmacro -%}
|