blob: b258bde2ebd23897ee7e5d91017975cfc3ad5c6d [file] [log] [blame]
Rushabh Mehta51008f22016-01-01 17:23:12 +05301{% extends "templates/web.html" %}
2
Anand Doshi5d591eb2014-04-18 16:15:31 +05303{% block title %} {{ title }} {% endblock %}
4
Anand Doshi13bf1232016-01-04 17:50:40 +05305{% block breadcrumbs %}
Rushabh Mehta440650d2016-11-14 13:13:53 +05306 {% include "templates/includes/breadcrumbs.html" %}
Anand Doshi13bf1232016-01-04 17:50:40 +05307{% endblock %}
8
Rushabh Mehta51008f22016-01-01 17:23:12 +05309{% block page_content %}
Anand Doshida858cc2015-02-24 17:50:44 +053010{% from "erpnext/templates/includes/macros.html" import product_image %}
Solufyin3be899c2018-08-07 18:28:39 +053011<div class="item-content">
Anand Doshi5d591eb2014-04-18 16:15:31 +053012 <div class="product-page-content" itemscope itemtype="http://schema.org/Product">
13 <div class="row">
Solufyin3be899c2018-08-07 18:28:39 +053014 <div class="row">
Anand Doshi5d591eb2014-04-18 16:15:31 +053015 {% if slideshow %}
Solufyin3be899c2018-08-07 18:28:39 +053016 {% 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 Mehta440650d2016-11-14 13:13:53 +053023 </div>
Rushabh Mehta440650d2016-11-14 13:13:53 +053024 {% endif %}
Solufyin3be899c2018-08-07 18:28:39 +053025 {% endfor %}
Anand Doshi25ef4ff2015-10-20 18:34:21 +053026 </div>
Solufyin3be899c2018-08-07 18:28:39 +053027 <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 Mehta4b9238a2016-05-12 15:22:59 +053031 </div>
Solufyin3be899c2018-08-07 18:28:39 +053032 </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 %}
Solufyin3be899c2018-08-07 18:28:39 +053046
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
Solufyin3be899c2018-08-07 18:28:39 +053070 {% 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;">
britlogd13985d2018-01-19 18:31:25 +010089 +</button>
Solufyin3be899c2018-08-07 18:28:39 +053090 </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 Mehta440650d2016-11-14 13:13:53 +0530103 </div>
104 </div>
Anand Doshi5d591eb2014-04-18 16:15:31 +0530105 </div>
106 </div>
Solufyin3be899c2018-08-07 18:28:39 +0530107 <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 Doshi5d591eb2014-04-18 16:15:31 +0530114 </div>
Solufyin3be899c2018-08-07 18:28:39 +0530115 {% 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 Doshi5d591eb2014-04-18 16:15:31 +0530131 </div>
Anand Doshi5d591eb2014-04-18 16:15:31 +0530132 </div>
133</div>
134<script>
135 {% include "templates/includes/product_page.js" %}
136
Rushabh Mehta440650d2016-11-14 13:13:53 +0530137 {% if variant_info %}
138 window.variant_info = {{ variant_info }};
139 {% else %}
140 window.variant_info = null;
141 {% endif %}
Anand Doshi5d591eb2014-04-18 16:15:31 +0530142</script>
143{% endblock %}