summaryrefslogtreecommitdiff
path: root/addons/website_sale/static/src/xml/website_sale_utils.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website_sale/static/src/xml/website_sale_utils.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_sale/static/src/xml/website_sale_utils.xml')
-rw-r--r--addons/website_sale/static/src/xml/website_sale_utils.xml49
1 files changed, 49 insertions, 0 deletions
diff --git a/addons/website_sale/static/src/xml/website_sale_utils.xml b/addons/website_sale/static/src/xml/website_sale_utils.xml
new file mode 100644
index 00000000..8a470613
--- /dev/null
+++ b/addons/website_sale/static/src/xml/website_sale_utils.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+
+<!-- Products Search Bar autocomplete item -->
+<div t-name="website_sale.productsSearchBar.autocomplete"
+ class="dropdown-menu show w-100">
+ <t t-if="!products.length">
+ <span class="dropdown-item-text text-muted">No results found. Please try another search.</span>
+ </t>
+ <a t-foreach="products" t-as="product"
+ t-att-href="product['website_url']" class="dropdown-item p-2 text-wrap">
+ <div class="media align-items-center o_search_product_item">
+ <t t-if="widget.displayImage">
+ <img t-attf-src="/web/image/product.template/#{product['id']}/image_128"
+ class="flex-shrink-0 o_image_64_contain"/>
+ </t>
+ <div class="media-body px-3">
+ <t t-set="description" t-value="widget.displayDescription and product['description_sale']"/>
+ <h6 t-attf-class="font-weight-bold #{description ? '' : 'mb-0'}" t-esc="product['name']"/>
+ <p t-if="description" class="mb-0" t-esc="description"/>
+ </div>
+ <div t-if="widget.displayPrice" class="flex-shrink-0">
+ <t t-if="product['has_discounted_price']">
+ <span class="text-danger text-nowrap" style="text-decoration: line-through;">
+ <t t-raw="product['list_price']"/>
+ </span>
+ <br/>
+ </t>
+ <b class="text-nowrap">
+ <t t-raw="product['price']"/>
+ </b>
+ </div>
+ </div>
+ </a>
+ <t t-if="hasMoreProducts">
+ <button type="submit" class="dropdown-item text-center text-primary">All results</button>
+ </t>
+</div>
+
+<!-- Products Search Bar autocomplete item -->
+<we-button t-name="website_sale.ribbonSelectItem" t-att-data-set-ribbon="ribbon.id">
+ <t t-raw="ribbon.html"/>
+ <span t-attf-class="fa fa-#{isTag ? 'tag' : 'bookmark'} ml-auto"></span>
+ <span t-attf-class="fa fa-arrow-#{isLeft ? 'left' : 'right'} ml-1"></span>
+ <span t-attf-class="o_wsale_color_preview #{colorClasses} ml-1" t-attf-style="background-color: #{ribbon.bg_color}"></span>
+ <span t-attf-class="o_wsale_color_preview #{colorClasses} ml-1" t-attf-style="background-color: #{textColor} !important;"></span>
+</we-button>
+
+</templates>