Anand Doshi | da858cc | 2015-02-24 17:50:44 +0530 | [diff] [blame] | 1 | {% macro product_image_square(website_image, css_class="") %} |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 2 | <div class="product-image product-image-square |
| 3 | {% if not website_image -%} missing-image {%- endif %} {{ css_class }}" |
| 4 | {% if website_image -%} |
| 5 | style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');" |
| 6 | {%- endif %}> |
Anand Doshi | da858cc | 2015-02-24 17:50:44 +0530 | [diff] [blame] | 7 | </div> |
| 8 | {% endmacro %} |
| 9 | |
prssanna | 11eae6d | 2021-02-01 20:01:37 +0530 | [diff] [blame] | 10 | {% macro product_image(website_image, css_class="product-image", alt="") %} |
Shivam Mishra | 45a5628 | 2020-12-30 15:51:50 +0530 | [diff] [blame] | 11 | <div class="border text-center rounded {{ css_class }}" style="overflow: hidden;"> |
Shivam Mishra | a0954e6 | 2020-08-07 14:34:54 +0530 | [diff] [blame] | 12 | <img itemprop="image" class="website-image h-100 w-100" alt="{{ alt }}" src="{{ frappe.utils.quoted(website_image or 'no-image.jpg') | abs_url }}"> |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 13 | </div> |
Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 14 | {% endmacro %} |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 15 | |
| 16 | {% macro media_image(website_image, name, css_class="") %} |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 17 | <div class="product-image sidebar-image-wrapper {{ css_class }}"> |
| 18 | {% if not website_image -%} |
| 19 | <div class="sidebar-standard-image"> <div class="standard-image" style="background-color: rgb(250, 251, 252);">{{name}}</div> </div> |
| 20 | {%- endif %} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 21 | {% if website_image -%} |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 22 | <a href="{{ frappe.utils.quoted(website_image) }}"> |
pratu16x7 | 0e94b4b | 2017-02-14 16:32:48 +0530 | [diff] [blame] | 23 | <img itemprop="image" src="{{ frappe.utils.quoted(website_image) | abs_url }}" |
| 24 | class="img-responsive img-thumbnail sidebar-image" style="min-height:100%; min-width:100%;"> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 25 | </a> |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 26 | {%- endif %} |
| 27 | </div> |
pratu16x7 | 60fe77c | 2017-02-13 21:52:43 +0530 | [diff] [blame] | 28 | {% endmacro %} |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 29 | |
| 30 | {% macro render_homepage_section(section) %} |
| 31 | |
| 32 | {% if section.section_based_on == 'Custom HTML' and section.section_html %} |
| 33 | {{ section.section_html }} |
| 34 | {% elif section.section_based_on == 'Cards' %} |
| 35 | <section class="container my-5"> |
| 36 | <h3>{{ section.name }}</h3> |
| 37 | |
| 38 | <div class="row"> |
| 39 | {% for card in section.section_cards %} |
| 40 | <div class="col-md-{{ section.column_value }} mb-4"> |
| 41 | <div class="card h-100 justify-content-between"> |
| 42 | {% if card.image %} |
Mohamed Almubarak | f7ea340 | 2021-01-28 10:02:13 +0300 | [diff] [blame] | 43 | <div class="website-image-lazy" data-class="card-img-top h-75" data-src="{{ card.image }}" data-alt="{{ card.title }}"></div> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 44 | {% endif %} |
| 45 | <div class="card-body"> |
| 46 | <h5 class="card-title">{{ card.title }}</h5> |
| 47 | <p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p> |
Faris Ansari | b8eaa3d | 2019-06-01 20:56:37 +0530 | [diff] [blame] | 48 | <p class="card-text">{{ card.content or '' | truncate(140, True) }}</p> |
Faris Ansari | 5f8b358 | 2019-03-19 11:48:32 +0530 | [diff] [blame] | 49 | </div> |
| 50 | <div class="card-body flex-grow-0"> |
| 51 | <a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a> |
| 52 | </div> |
| 53 | </div> |
| 54 | </div> |
| 55 | {% endfor %} |
| 56 | </div> |
| 57 | </section> |
| 58 | {% endif %} |
| 59 | |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 60 | {% endmacro %} |
| 61 | |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 62 | {%- macro item_card(item, settings=None, is_featured=False, is_full_width=False, align="Left") -%} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 63 | {%- set align_items_class = resolve_class({ |
| 64 | 'align-items-end': align == 'Right', |
| 65 | 'align-items-center': align == 'Center', |
| 66 | 'align-items-start': align == 'Left', |
| 67 | }) -%} |
| 68 | {%- set col_size = 3 if is_full_width else 4 -%} |
marination | 48b3ce8 | 2021-05-13 01:22:05 +0530 | [diff] [blame^] | 69 | {%- set title = item.web_item_name or item.item_name or item.item_code -%} |
| 70 | {%- set title = title[:50] + "..." if title|len > 50 else title -%} |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 71 | {%- set image = item.website_image or item.image -%} |
| 72 | {%- set description = item.website_description or item.description-%} |
| 73 | |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 74 | {% if is_featured %} |
| 75 | <div class="col-sm-{{ col_size*2 }} item-card"> |
| 76 | <div class="card featured-item {{ align_items_class }}"> |
| 77 | {% if image %} |
| 78 | <div class="row no-gutters"> |
| 79 | <div class="col-md-6"> |
| 80 | <img class="card-img" src="{{ image }}" alt="{{ title }}"> |
| 81 | </div> |
| 82 | <div class="col-md-6"> |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 83 | {{ item_card_body(title, settings, description, item, is_featured, align) }} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 84 | </div> |
| 85 | </div> |
| 86 | {% else %} |
| 87 | <div class="col-md-12"> |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 88 | {{ item_card_body(title, settings, description, item, is_featured, align) }} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 89 | </div> |
| 90 | {% endif %} |
| 91 | </div> |
| 92 | </div> |
| 93 | {% else %} |
| 94 | <div class="col-sm-{{ col_size }} item-card"> |
| 95 | <div class="card {{ align_items_class }}"> |
| 96 | {% if image %} |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 97 | <div class="card-img-container"> |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 98 | <a href="/{{ item.route or '#' }}" style="text-decoration: none;"> |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 99 | <img class="card-img" src="{{ image }}" alt="{{ title }}"> |
| 100 | </a> |
| 101 | </div> |
prssanna | b00eb1b | 2021-01-20 17:52:54 +0530 | [diff] [blame] | 102 | {% else %} |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 103 | <a href="/{{ item.route or '#' }}" style="text-decoration: none;"> |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 104 | <div class="card-img-top no-image"> |
| 105 | {{ frappe.utils.get_abbr(title) }} |
| 106 | </div> |
| 107 | </a> |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 108 | {% endif %} |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 109 | {{ item_card_body(title, settings, description, item, is_featured, align) }} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 110 | </div> |
| 111 | </div> |
| 112 | {% endif %} |
| 113 | {%- endmacro -%} |
| 114 | |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 115 | {%- macro item_card_body(title, settings, description, item, is_featured, align) -%} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 116 | {%- set align_class = resolve_class({ |
| 117 | 'text-right': align == 'Right', |
| 118 | 'text-center': align == 'Center' and not is_featured, |
| 119 | 'text-left': align == 'Left' or is_featured, |
| 120 | }) -%} |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 121 | <div class="card-body {{ align_class }}" style="width:100%"> |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 122 | <div style="margin-top: 16px; display: flex;"> |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 123 | <a href="/{{ item.route or '#' }}"> |
marination | 48b3ce8 | 2021-05-13 01:22:05 +0530 | [diff] [blame^] | 124 | <div class="product-title"> |
| 125 | {{ title or '' }} |
| 126 | {% if item.in_stock %} |
| 127 | <span class="indicator {{ item.in_stock }} card-indicator"></span> |
| 128 | {% endif %} |
| 129 | </div> |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 130 | </a> |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 131 | {% if not item.has_variants and settings.enable_wishlist %} |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 132 | <div class="like-action" |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 133 | data-item-code="{{ item.item_code }}" |
| 134 | data-price="{{ item.price }}" |
| 135 | data-formatted-price="{{ item.get('formatted_price') }}"> |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 136 | <svg class="icon sm"> |
marination | 96cc506 | 2021-03-14 17:28:49 +0530 | [diff] [blame] | 137 | {%- set icon_class = "wished" if item.wished else "not-wished"-%} |
| 138 | <use class="{{ icon_class }} wish-icon" href="#icon-heart"></use> |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 139 | </svg> |
| 140 | </div> |
| 141 | {% endif %} |
marination | 16b9c8c | 2021-03-11 10:56:00 +0530 | [diff] [blame] | 142 | </div> |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 143 | {% if is_featured %} |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 144 | <div class="product-price">{{ item.formatted_price or '' }}</div> |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 145 | <div class="product-description ellipsis">{{ description or '' }}</div> |
| 146 | {% else %} |
| 147 | <div class="product-category">{{ item.item_group or '' }}</div> |
| 148 | |
| 149 | {% if item.formatted_price %} |
| 150 | <div class="product-price"> |
| 151 | {{ item.formatted_price or '' }} |
| 152 | |
| 153 | {% if item.get("formatted_mrp") %} |
| 154 | <small class="ml-1 text-muted"> |
| 155 | <s>{{ item.formatted_mrp }}</s> |
| 156 | </small> |
| 157 | <small class="ml-1" style="color: #F47A7A; font-weight: 500;"> |
| 158 | {{ item.discount }} OFF |
| 159 | </small> |
| 160 | {% endif %} |
| 161 | |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 162 | </div> |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 163 | {% endif %} |
| 164 | |
| 165 | {% if item.has_variants %} |
| 166 | <a href="/{{ item.route or '#' }}"> |
| 167 | <div class="btn btn-sm btn-explore-variants w-100 mt-4"> |
| 168 | {{ _('Explore') }} |
| 169 | </div> |
| 170 | </a> |
| 171 | {% elif settings.enabled and (settings.allow_items_not_in_stock or item.in_stock != "red")%} |
| 172 | <div id="{{ item.name }}" class="btn btn-sm btn-add-to-cart-list not-added w-100 mt-4" |
marination | 4f64d1c | 2021-03-11 21:24:47 +0530 | [diff] [blame] | 173 | data-item-code="{{ item.item_code }}"> |
| 174 | {{ _('Add to Cart') }} |
| 175 | </div> |
| 176 | {% endif %} |
prssanna | eb0e596 | 2020-12-24 11:40:33 +0530 | [diff] [blame] | 177 | {% endif %} |
| 178 | </div> |
Ankush Menat | 4551d7d | 2021-08-19 13:41:10 +0530 | [diff] [blame] | 179 | {%- endmacro -%} |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 180 | |
| 181 | |
| 182 | {%- macro wishlist_card(item, settings) %} |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 183 | <div class="col-sm-3 wishlist-card"> |
| 184 | <div class="card text-center" style="max-height: 390px;"> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 185 | {% if item.image %} |
| 186 | <div class="card-img-container"> |
| 187 | <a href="/{{ item.route or '#' }}" style="text-decoration: none;"> |
| 188 | <img class="card-img" src="{{ item.image }}" alt="{{ title }}"> |
| 189 | </a> |
marination | 25ffafa | 2021-03-22 16:17:59 +0530 | [diff] [blame] | 190 | <div class="remove-wish" data-item-code="{{ item.item_code }}"> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 191 | <span style="padding-bottom: 2px;"> |
| 192 | <svg class="icon sm remove-wish-icon" style="margin-bottom: 4px; margin-left: 0.5px;"> |
| 193 | <use class="close" href="#icon-close"></use> |
| 194 | </svg> |
| 195 | </span> |
| 196 | </div> |
| 197 | |
| 198 | </div> |
| 199 | {% else %} |
| 200 | <a href="/{{ item.route or '#' }}" style="text-decoration: none;"> |
| 201 | <div class="card-img-top no-image"> |
| 202 | {{ frappe.utils.get_abbr(title) }} |
| 203 | </div> |
| 204 | </a> |
| 205 | {% endif %} |
| 206 | |
| 207 | {{ wishlist_card_body(item, settings) }} |
| 208 | |
| 209 | |
| 210 | </div> |
| 211 | </div> |
| 212 | {%- endmacro -%} |
| 213 | |
| 214 | {%- macro wishlist_card_body(item, settings) %} |
marination | 25ffafa | 2021-03-22 16:17:59 +0530 | [diff] [blame] | 215 | <div class="card-body text-center" style="width: 100%;"> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 216 | <div style="margin-top: 16px;"> |
| 217 | <div class="product-title">{{ item.item_name or item.item_code or ''}}</div> |
| 218 | </div> |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 219 | <div class="product-price"> |
| 220 | {{ item.formatted_price or '' }} |
| 221 | |
| 222 | {% if item.get("formatted_mrp") %} |
| 223 | <small class="ml-1 text-muted"> |
| 224 | <s>{{ item.formatted_mrp }}</s> |
| 225 | </small> |
| 226 | <small class="ml-1" style="color: #F47A7A; font-weight: 500;"> |
| 227 | {{ item.discount }} OFF |
| 228 | </small> |
| 229 | {% endif %} |
| 230 | </div> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 231 | |
| 232 | {% if (item.available and settings.show_stock_availability) or (not settings.show_stock_availability) %} |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 233 | <!-- Show move to cart button if in stock or if showing stock availability is disabled --> |
| 234 | <button data-item-code="{{ item.item_code}}" class="btn btn-add-to-cart w-100 wishlist-cart-not-added mt-2"> |
| 235 | <span class="mr-2"> |
| 236 | <svg class="icon icon-md"> |
| 237 | <use href="#icon-assets"></use> |
| 238 | </svg> |
| 239 | </span> |
| 240 | {{ _("Move to Cart") }} |
| 241 | </button> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 242 | {% else %} |
marination | 6026185 | 2021-04-13 00:39:26 +0530 | [diff] [blame] | 243 | <div class="mt-4" style="color: #F47A7A; width: 100%;"> |
| 244 | {{ _("Not in Stock") }} |
| 245 | </div> |
marination | 5951440 | 2021-03-16 00:05:53 +0530 | [diff] [blame] | 246 | {% endif %} |
| 247 | </div> |
| 248 | {%- endmacro -%} |
marination | b15ff57 | 2021-03-25 11:52:50 +0530 | [diff] [blame] | 249 | |
| 250 | {%- macro ratings_with_title(avg_rating, title, size, rating_header_class) -%} |
| 251 | <div style="display: flex;"> |
| 252 | <div class="rating"> |
| 253 | {% for i in range(1,6) %} |
| 254 | {% set fill_class = 'star-click' if i <= avg_rating else '' %} |
| 255 | <svg class="icon icon-{{ size }} {{ fill_class }}"> |
| 256 | <use href="#icon-star"></use> |
| 257 | </svg> |
| 258 | {% endfor %} |
| 259 | </div> |
| 260 | <p class="ml-4 {{ rating_header_class }}"> |
| 261 | <span>{{ title }}</span> |
| 262 | </p> |
| 263 | </div> |
| 264 | {%- endmacro -%} |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 265 | |
| 266 | {%- macro ratings_summary(reviews, reviews_per_rating, average_rating, average_whole_rating)-%} |
| 267 | <!-- Ratings Summary --> |
| 268 | <h2 class="reviews-header"> |
| 269 | {{ _("Customer Ratings") }} |
| 270 | </h2> |
| 271 | |
| 272 | {% if reviews %} |
| 273 | {% set rating_title = frappe.utils.cstr(average_rating) + " " + _("out of 5") %} |
| 274 | {{ ratings_with_title(average_whole_rating, rating_title, "lg", "rating-summary-title") }} |
| 275 | {% endif %} |
| 276 | |
| 277 | <!-- Rating Progress Bars --> |
| 278 | <div class="rating-progress-bar-section"> |
| 279 | {% for percent in reviews_per_rating %} |
| 280 | <div class="mt-4 col-sm-4 small rating-bar-title"> |
| 281 | {{ loop.index }} star |
| 282 | </div> |
| 283 | <div class="row"> |
| 284 | <div class="col-md-7"> |
| 285 | <div class="progress rating-progress-bar" title="{{ percent }} % of reviews are {{ loop.index }} star"> |
| 286 | <div class="progress-bar" role="progressbar" |
| 287 | aria-valuenow="{{ percent }}" |
| 288 | aria-valuemin="0" aria-valuemax="100" |
| 289 | style="width: {{ percent }}%; background-color: var(--text-on-green);"> |
| 290 | </div> |
| 291 | </div> |
| 292 | </div> |
| 293 | <div class="col-sm-1 small"> |
| 294 | {{ percent }}% |
| 295 | </div> |
| 296 | </div> |
| 297 | {% endfor %} |
| 298 | </div> |
| 299 | {%- endmacro -%} |
| 300 | |
| 301 | {%- macro user_review(reviews)-%} |
| 302 | <!-- User Reviews --> |
| 303 | <div class="user-reviews"> |
| 304 | {% for review in reviews %} |
| 305 | <div class="mb-3 review"> |
| 306 | {{ ratings_with_title(review.rating, _(review.review_title), "md", "user-review-title") }} |
| 307 | |
| 308 | <div class="review-signature"> |
| 309 | <span class="reviewer">{{ _(review.customer) }}</span> |
| 310 | <span>{{ review.published_on }}</span> |
| 311 | </div> |
| 312 | <div class="product-description mb-4 mt-4"> |
| 313 | <p> |
| 314 | {{ _(review.comment) }} |
| 315 | </p> |
| 316 | </div> |
| 317 | </div> |
| 318 | {% endfor %} |
| 319 | </div> |
| 320 | {%- endmacro -%} |
marination | 1d94914 | 2021-04-20 21:54:52 +0530 | [diff] [blame] | 321 | |
| 322 | {%- macro field_filter_section(filters)-%} |
| 323 | {% for field_filter in filters %} |
| 324 | {%- set item_field = field_filter[0] %} |
| 325 | {%- set values = field_filter[1] %} |
| 326 | <div class="mb-4 filter-block pb-5"> |
| 327 | <div class="filter-label mb-3">{{ item_field.label }}</div> |
| 328 | |
| 329 | {% if values | len > 20 %} |
| 330 | <!-- show inline filter if values more than 20 --> |
| 331 | <input type="text" class="form-control form-control-sm mb-2 product-filter-filter"/> |
| 332 | {% endif %} |
| 333 | |
| 334 | {% if values %} |
| 335 | <div class="filter-options"> |
| 336 | {% for value in values %} |
| 337 | <div class="checkbox" data-value="{{ value }}"> |
| 338 | <label for="{{value}}"> |
| 339 | <input type="checkbox" |
| 340 | class="product-filter field-filter" |
| 341 | id="{{value}}" |
| 342 | data-filter-name="{{ item_field.fieldname }}" |
marination | 71f4b98 | 2021-04-21 12:31:15 +0530 | [diff] [blame] | 343 | data-filter-value="{{ value }}"> |
marination | 1d94914 | 2021-04-20 21:54:52 +0530 | [diff] [blame] | 344 | <span class="label-area">{{ value }}</span> |
| 345 | </label> |
| 346 | </div> |
| 347 | {% endfor %} |
| 348 | </div> |
| 349 | {% else %} |
| 350 | <i class="text-muted">{{ _('No values') }}</i> |
| 351 | {% endif %} |
| 352 | </div> |
| 353 | {% endfor %} |
| 354 | {%- endmacro -%} |
| 355 | |
| 356 | {%- macro attribute_filter_section(filters)-%} |
| 357 | {% for attribute in filters %} |
| 358 | <div class="mb-4 filter-block pb-5"> |
| 359 | <div class="filter-label mb-3">{{ attribute.name}}</div> |
| 360 | {% if values | len > 20 %} |
| 361 | <!-- show inline filter if values more than 20 --> |
| 362 | <input type="text" class="form-control form-control-sm mb-2 product-filter-filter"/> |
| 363 | {% endif %} |
| 364 | |
| 365 | {% if attribute.item_attribute_values %} |
| 366 | <div class="filter-options"> |
| 367 | {% for attr_value in attribute.item_attribute_values %} |
| 368 | <div class="checkbox"> |
marination | 48b3ce8 | 2021-05-13 01:22:05 +0530 | [diff] [blame^] | 369 | <label data-value="{{ attr_value }}"> |
marination | 1d94914 | 2021-04-20 21:54:52 +0530 | [diff] [blame] | 370 | <input type="checkbox" |
| 371 | class="product-filter attribute-filter" |
| 372 | id="{{attr_value.name}}" |
| 373 | data-attribute-name="{{ attribute.name }}" |
| 374 | data-attribute-value="{{ attr_value.attribute_value }}" |
| 375 | {% if attr_value.checked %} checked {% endif %}> |
| 376 | <span class="label-area">{{ attr_value.attribute_value }}</span> |
| 377 | </label> |
| 378 | </div> |
| 379 | {% endfor %} |
| 380 | </div> |
| 381 | {% else %} |
| 382 | <i class="text-muted">{{ _('No values') }}</i> |
| 383 | {% endif %} |
| 384 | </div> |
| 385 | {% endfor %} |
| 386 | {%- endmacro -%} |