Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 3 | {% block title %} {{ title }} {% endblock %} |
| 4 | |
Anand Doshi | 13bf123 | 2016-01-04 17:50:40 +0530 | [diff] [blame] | 5 | {% block breadcrumbs %} |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 6 | {% include "templates/includes/breadcrumbs.html" %} |
Anand Doshi | 13bf123 | 2016-01-04 17:50:40 +0530 | [diff] [blame] | 7 | {% endblock %} |
| 8 | |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 9 | {% block page_content %} |
Anand Doshi | da858cc | 2015-02-24 17:50:44 +0530 | [diff] [blame] | 10 | {% from "erpnext/templates/includes/macros.html" import product_image %} |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 11 | <div class="item-content"> |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 12 | <div class="product-page-content" itemscope itemtype="http://schema.org/Product"> |
| 13 | <div class="row"> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 14 | <div class="row"> |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 15 | {% if slideshow %} |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 16 | {% set slideshow_items = frappe.get_list(doctype="Website Slideshow Item", fields=["image"], filters={ "parent": doc.slideshow }) %} |
| 17 | <div class="col-md-1"> |
| 18 | {%- for slideshow_item in slideshow_items -%} |
| 19 | {% set image_src = slideshow_item['image'] %} |
| 20 | {% if image_src %} |
| 21 | <div class="item-alternative-image border"> |
| 22 | <img src="{{ image_src }}" height="50" weight="50" /> |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 23 | </div> |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 24 | {% endif %} |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 25 | {% endfor %} |
Anand Doshi | 25ef4ff | 2015-10-20 18:34:21 +0530 | [diff] [blame] | 26 | </div> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 27 | <div class="col-md-5"> |
| 28 | <div class="item-image"> |
| 29 | {% set first_image = slideshow_items[0]['image'] %} |
| 30 | {{ product_image(first_image, "product-full-image") }} |
Rushabh Mehta | 4b9238a | 2016-05-12 15:22:59 +0530 | [diff] [blame] | 31 | </div> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 32 | </div> |
| 33 | {% else %} |
| 34 | <div class="col-md-6"> |
| 35 | {{ product_image(website_image, "product-full-image") }} |
| 36 | </div> |
| 37 | {% endif %} |
| 38 | <div class="col-sm-6"> |
| 39 | <h2 itemprop="name">{{ item_name }}</h2> |
| 40 | <p class="text-muted"> |
| 41 | {{ _("Item Code") }}: <span itemprop="productID">{{ variant and variant.name or name }}</span> |
| 42 | </p> |
| 43 | <br> |
| 44 | <div class="item-attribute-selectors"> |
| 45 | {% if has_variants and attributes %} |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 46 | |
| 47 | {% for d in attributes %} |
| 48 | {% if attribute_values[d.attribute] -%} |
| 49 | <div class="item-view-attribute {% if (attribute_values[d.attribute] | len)==1 -%} hidden {%- endif %}" |
| 50 | style="margin-bottom: 10px;"> |
| 51 | <h6 class="text-muted">{{ _(d.attribute) }}</h6> |
| 52 | <select class="form-control" |
| 53 | style="max-width: 140px" |
| 54 | data-attribute="{{ d.attribute }}"> |
| 55 | {% for value in attribute_values[d.attribute] %} |
| 56 | <option value="{{ value }}" |
| 57 | {% if selected_attributes and selected_attributes[d.attribute]==value -%} |
| 58 | selected |
| 59 | {%- elif disabled_attributes and value in disabled_attributes.get(d.attribute, []) -%} |
| 60 | disabled |
| 61 | {%- endif %}> |
| 62 | {{ _(value) }} |
| 63 | </option> |
| 64 | {% endfor %} |
| 65 | </select> |
| 66 | </div> |
| 67 | {%- endif %} |
| 68 | {% endfor %} |
| 69 | |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 70 | {% endif %} |
| 71 | </div> |
| 72 | <br> |
| 73 | <div> |
| 74 | <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> |
| 75 | <h4 class="item-price hide" itemprop="price"></h4> |
| 76 | <div class="item-stock hide" itemprop="availability"></div> |
| 77 | </div> |
| 78 | <div class="item-cart hide"> |
| 79 | <div id="item-spinner"> |
| 80 | <span style="display: inline-block"> |
| 81 | <div class="input-group number-spinner"> |
| 82 | <span class="input-group-btn"> |
| 83 | <button class="btn btn-default cart-btn" data-dir="dwn"> |
| 84 | –</button> |
| 85 | </span> |
| 86 | <input class="form-control text-right cart-qty" value="1"> |
| 87 | <span class="input-group-btn"> |
| 88 | <button class="btn btn-default cart-btn" data-dir="up" style="margin-left:-2px;"> |
britlog | d13985d | 2018-01-19 18:31:25 +0100 | [diff] [blame] | 89 | +</button> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 90 | </span> |
| 91 | </div> |
| 92 | </span> |
| 93 | </div> |
| 94 | <div id="item-add-to-cart"> |
| 95 | <button class="btn btn-primary btn-sm"> |
| 96 | {{ _("Add to Cart") }}</button> |
| 97 | </div> |
| 98 | <div id="item-update-cart" style="display: none;"> |
| 99 | <a href="/cart" class='btn btn-sm btn-default'> |
| 100 | <i class='octicon octicon-check'></i> |
| 101 | {{ _("View in Cart") }}</a> |
| 102 | </div> |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 103 | </div> |
| 104 | </div> |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 105 | </div> |
| 106 | </div> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 107 | <div class="row item-website-description margin-top"> |
| 108 | <div class="col-md-12"> |
| 109 | <div class="h6 text-uppercase">{{ _("Description") }}</div> |
| 110 | <div itemprop="description" class="item-desc"> |
| 111 | {{ web_long_description or description or _("No description given") }} |
| 112 | </div> |
| 113 | </div> |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 114 | </div> |
Solufyin | 3be899c | 2018-08-07 18:28:39 +0530 | [diff] [blame] | 115 | {% if website_specifications -%} |
| 116 | <div class="row item-website-specification margin-top"> |
| 117 | <div class="col-md-12"> |
| 118 | <div class="h6 text-uppercase">{{ _("Specifications") }}</div> |
| 119 | |
| 120 | <table class="table"> |
| 121 | {% for d in website_specifications -%} |
| 122 | <tr> |
| 123 | <td class="text-muted" style="width: 30%;">{{ d.label }}</td> |
| 124 | <td>{{ d.description }}</td> |
| 125 | </tr> |
| 126 | {%- endfor %} |
| 127 | </table> |
| 128 | </div> |
| 129 | </div> |
| 130 | {%- endif %} |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 131 | </div> |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 132 | </div> |
| 133 | </div> |
| 134 | <script> |
| 135 | {% include "templates/includes/product_page.js" %} |
| 136 | |
Rushabh Mehta | 440650d | 2016-11-14 13:13:53 +0530 | [diff] [blame] | 137 | {% if variant_info %} |
| 138 | window.variant_info = {{ variant_info }}; |
| 139 | {% else %} |
| 140 | window.variant_info = null; |
| 141 | {% endif %} |
Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 142 | </script> |
| 143 | {% endblock %} |