diff --git a/erpnext/public/build.json b/erpnext/public/build.json index d30bc8c144..b4a1cf81be 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -13,7 +13,8 @@ "public/js/shopping_cart.js" ], "css/erpnext-web.css": [ - "public/scss/website.scss" + "public/scss/website.scss", + "public/scss/shopping_cart.scss" ], "js/marketplace.min.js": [ "public/js/hub/marketplace.js" diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss new file mode 100644 index 0000000000..16a2bc585a --- /dev/null +++ b/erpnext/public/scss/shopping_cart.scss @@ -0,0 +1,206 @@ +@import "frappe/public/scss/desk/variables"; +@import "frappe/public/scss/mixins"; + +.carousel-control { + height: 42px; + width: 42px; + display: flex; + align-items: center; + justify-content: center; + background: white; + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.08), 0px 1px 2px 1px rgba(0, 0, 0, 0.06); + border-radius: 100px; +} + +.carousel-control-prev, +.carousel-control-next { + opacity: 1; +} + +.carousel-body { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.carousel-content { + max-width: 400px; +} + +.card { + border: none; +} + +.card-grid { + display: grid; + grid-gap: 15px; + grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));; +} + +.product-category-section { + .card:hover { + box-shadow: 0px 16px 45px 6px rgba(0, 0, 0, 0.08), 0px 8px 10px -10px rgba(0, 0, 0, 0.04); + } +} + +.item-card-group-section { + .card { + height: 360px; + align-items: center; + justify-content: center; + } + + // .card-body { + // text-align: center; + // } + + // .featured-item { + // .card-body { + // text-align: left; + // } + // } + + .card-img { + max-height: 210px; + object-fit: contain; + margin-top: 1.25rem; + } + + .product-title { + font-size: 14px; + color: var(--gray-800); + font-weight: 500; + } + + .product-description { + font-size: 12px; + color: var(--text-color); + margin: 20px 0; + display: -webkit-box; + -webkit-line-clamp: 6; + -webkit-box-orient: vertical; + } + + .product-category { + font-size: 13px; + color: var(--gray-600); + margin: var(--margin-sm) 0; + } + + .product-price { + font-size: 18px; + font-weight: 600; + color: var(--text-color); + margin: var(--margin-sm) 0; + } + + .item-card { + padding: var(--padding-sm); + } +} + +#page-all-products { + .page-header { + font-size: 20px; + font-weight: 700; + color: var(--text-color); + } + + .filters-section { + .title-section { + border-bottom: 1px solid var(--table-border-color); + } + + .filter-title { + font-weight: 500; + } + + .clear-filters { + font-size: 13px; + } + + .filter-label { + font-size: 11px; + font-weight: 600; + color: var(--gray-700); + text-transform: uppercase; + } + + .filter-block { + border-bottom: 1px solid var(--table-border-color); + } + + .checkbox { + .label-area { + font-size: 13px; + color: var(--gray-800); + } + } + } +} + +.product-page { + @include card($padding: var(--padding-md)); + min-height: 70vh; + + .product-title { + font-size: 16px; + font-weight: 500; + color: var(--text-color); + } + + .product-code { + color: var(--gray-600); + font-size: 13px; + } + + .product-description { + font-size: 13px; + color: var(--gray-800); + } + + + + .product-image { + border-color: var(--table-border-color) !important; + img { + min-height: 320px; + max-height: 30rem; + min-width: 320px; + } + } + + .item-slideshow-image { + height: 4rem; + width: 4rem; + object-fit: contain; + padding: 0.5rem; + border: 1px solid var(--table-border-color); + border-radius: 4px; + cursor: pointer; + + &:hover, &.active { + border-color: $primary; + } + } + + .item-cart { + .product-price { + font-size: 20px; + color: var(--text-color); + font-weight: 600; + + .formatted-price { + color: var(--gray-600); + font-size: 14px; + } + } + + .no-stock { + font-size: 14px; + } + } +} + diff --git a/erpnext/public/scss/website.scss b/erpnext/public/scss/website.scss index 24a1b3780c..56b717c424 100644 --- a/erpnext/public/scss/website.scss +++ b/erpnext/public/scss/website.scss @@ -1,29 +1,10 @@ @import "frappe/public/scss/website/variables"; -.product-image img { - min-height: 20rem; - max-height: 30rem; -} - .filter-options { max-height: 300px; overflow: auto; } -.item-slideshow-image { - height: 3rem; - width: 3rem; - object-fit: contain; - padding: 0.5rem; - border: 1px solid $border-color; - border-radius: 4px; - cursor: pointer; - - &:hover, &.active { - border-color: $primary; - } -} - .address-card { cursor: pointer; position: relative; @@ -43,10 +24,10 @@ .check { display: inline-flex; - padding: 0.25rem; - background: $primary; - color: white; - border-radius: 50%; + padding: 0.25rem; + background: $primary; + color: white; + border-radius: 50%; font-size: 12px; width: 24px; height: 24px; diff --git a/erpnext/shopping_cart/web_template/hero_slider/hero_slider.html b/erpnext/shopping_cart/web_template/hero_slider/hero_slider.html index 3f0419e564..ace23bfd56 100644 --- a/erpnext/shopping_cart/web_template/hero_slider/hero_slider.html +++ b/erpnext/shopping_cart/web_template/hero_slider/hero_slider.html @@ -46,11 +46,11 @@ {%- set primary_action_label = values['slide_' + index + '_primary_action_label'] -%} {%- set align = values['slide_' + index + '_content_align'] -%} {%- set theme = values['slide_' + index + '_theme'] -%} - + {%- if image -%} {{ slide(image, title, subtitle, primary_action, primary_action_label, index, align, theme) }} {%- endif -%} - + {%- endfor -%} {%- if show_controls -%} @@ -82,31 +82,4 @@ \ No newline at end of file diff --git a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html index e69de29bb2..d39d1b7b50 100644 --- a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html +++ b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html @@ -0,0 +1,38 @@ +{% from "erpnext/templates/includes/macros.html" import item_card, item_card_body %} + +
+
+
+ {%- if title -%} +

{{ title }}

+ {%- endif -%} + {%- if subtitle -%} +

{{ subtitle }}

+ {%- endif -%} +
+
+ {%- if primary_action -%} + + {{ primary_action_label }} + + {%- endif -%} +
+
+ +
+ {%- for index in ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] -%} + {%- set item = values['card_' + index + '_item'] -%} + {%- if item -%} + {%- set item = frappe.get_doc("Item", item) -%} + {{ item_card( + item.item_name, item.image, item.route, item.description, + item.standard_rate, item.item_group, values['card_' + index + '_featured'], + True, "Center" + ) }} + {%- endif -%} + {%- endfor -%} +
+
+ + \ No newline at end of file diff --git a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.json b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.json index f1a70a99ad..ad087b0470 100644 --- a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.json +++ b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.json @@ -16,6 +16,21 @@ "label": "Subtitle", "reqd": 0 }, + { + "__unsaved": 1, + "fieldname": "primary_action_label", + "fieldtype": "Data", + "label": "Primary Action Label", + "reqd": 0 + }, + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "primary_action", + "fieldtype": "Data", + "label": "Primary Action", + "reqd": 0 + }, { "fieldname": "card_1", "fieldtype": "Section Break", @@ -36,264 +51,210 @@ "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_2", "fieldtype": "Section Break", "label": "Card 2", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_2_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_2_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_3", "fieldtype": "Section Break", "label": "Card 3", + "options": "", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_3_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_3_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_4", "fieldtype": "Section Break", "label": "Card 4", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_4_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_4_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_5", "fieldtype": "Section Break", "label": "Card 5", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_5_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_5_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_6", "fieldtype": "Section Break", "label": "Card 6", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_6_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_6_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_7", "fieldtype": "Section Break", "label": "Card 7", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_7_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_7_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_8", "fieldtype": "Section Break", "label": "Card 8", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_8_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_8_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_9", "fieldtype": "Section Break", "label": "Card 9", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_9_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_9_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_10", "fieldtype": "Section Break", "label": "Card 10", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_10_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_10_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_11", "fieldtype": "Section Break", "label": "Card 11", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_11_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_11_featured", "fieldtype": "Check", "label": "Featured", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_12", "fieldtype": "Section Break", "label": "Card 12", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_12_item", "fieldtype": "Link", "label": "Item", + "options": "Item", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "card_12_featured", "fieldtype": "Check", "label": "Featured", @@ -301,7 +262,7 @@ } ], "idx": 0, - "modified": "2020-11-17 16:37:46.325181", + "modified": "2020-11-19 18:48:52.633045", "modified_by": "Administrator", "module": "Shopping Cart", "name": "Item Card Group", diff --git a/erpnext/shopping_cart/web_template/product_category_cards/product_category_cards.html b/erpnext/shopping_cart/web_template/product_category_cards/product_category_cards.html index 88ba7fd898..06b76af901 100644 --- a/erpnext/shopping_cart/web_template/product_category_cards/product_category_cards.html +++ b/erpnext/shopping_cart/web_template/product_category_cards/product_category_cards.html @@ -15,7 +15,7 @@ {%- endmacro -%} -
+
{%- if title -%}

{{ title }}

{%- endif -%} @@ -37,17 +37,4 @@
diff --git a/erpnext/templates/generators/item/item.html b/erpnext/templates/generators/item/item.html index d3691a6e99..55c45e256a 100644 --- a/erpnext/templates/generators/item/item.html +++ b/erpnext/templates/generators/item/item.html @@ -7,17 +7,19 @@ {% endblock %} {% block page_content %} -{% from "erpnext/templates/includes/macros.html" import product_image %} -
-
-
- {% include "templates/generators/item/item_image.html" %} - {% include "templates/generators/item/item_details.html" %} +
+ {% from "erpnext/templates/includes/macros.html" import product_image %} +
+
+
+ {% include "templates/generators/item/item_image.html" %} + {% include "templates/generators/item/item_details.html" %} +
+ + {% include "templates/generators/item/item_specifications.html" %} + + {{ doc.website_content or '' }}
- - {% include "templates/generators/item/item_specifications.html" %} - - {{ doc.website_content or '' }}
{% endblock %} diff --git a/erpnext/templates/generators/item/item_add_to_cart.html b/erpnext/templates/generators/item/item_add_to_cart.html index dbf15de1e4..3210e2497f 100644 --- a/erpnext/templates/generators/item/item_add_to_cart.html +++ b/erpnext/templates/generators/item/item_add_to_cart.html @@ -6,10 +6,10 @@
{% if cart_settings.show_price and product_info.price %} -

+
{{ product_info.price.formatted_price_sales_uom }} - ({{ product_info.price.formatted_price }} / {{ product_info.uom }}) -

+ ({{ product_info.price.formatted_price }} / {{ product_info.uom }}) +
{% else %} {{ _("Unit of Measurement") }} : {{ product_info.uom }} {% endif %} @@ -17,11 +17,11 @@ {% if cart_settings.show_stock_availability %}
{% if product_info.in_stock == 0 %} - + {{ _('Not in stock') }} {% elif product_info.in_stock == 1 %} - + {{ _('In stock') }} {% if product_info.show_stock_qty and product_info.stock_qty %} ({{ product_info.stock_qty[0][0] }}) diff --git a/erpnext/templates/generators/item/item_details.html b/erpnext/templates/generators/item/item_details.html index 4cbecb0215..9a0bb5cfc3 100644 --- a/erpnext/templates/generators/item/item_details.html +++ b/erpnext/templates/generators/item/item_details.html @@ -1,14 +1,21 @@
-

+
{{ item_name }} -

-

+

+

{{ _("Item Code") }}: {{ doc.name }}

+{% if has_variants %} + + {% include "templates/generators/item/item_configure.html" %} +{% else %} + + {% include "templates/generators/item/item_add_to_cart.html" %} +{% endif %} -
+
{% if frappe.utils.strip_html(doc.web_long_description or '') %} {{ doc.web_long_description | safe }} {% elif frappe.utils.strip_html(doc.description or '') %} @@ -17,12 +24,4 @@ {{ _("No description given") }} {% endif %}
- -{% if has_variants %} - - {% include "templates/generators/item/item_configure.html" %} -{% else %} - - {% include "templates/generators/item/item_add_to_cart.html" %} -{% endif %}
diff --git a/erpnext/templates/generators/item/item_image.html b/erpnext/templates/generators/item/item_image.html index 5d46a45053..fa70ebe998 100644 --- a/erpnext/templates/generators/item/item_image.html +++ b/erpnext/templates/generators/item/item_image.html @@ -1,42 +1,42 @@ -
-{% if slides %} -{{ product_image(slides[0].image, 'product-image') }} -
- {% for item in slides %} - {{ item.heading }} - {% endfor %} -
- - -{% else %} -{{ product_image(website_image or image or 'no-image.jpg', alt=website_image_alt or item_name) }} -{% endif %} + $('.item-slideshow-image').removeClass('active'); + $img.addClass('active'); + }); + }) + + {% else %} + {{ product_image(website_image or image or 'no-image.jpg', alt=website_image_alt or item_name) }} + {% endif %} - + - +