summaryrefslogtreecommitdiff
path: root/addons/website_sale_wishlist/views
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_wishlist/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_sale_wishlist/views')
-rw-r--r--addons/website_sale_wishlist/views/snippets.xml17
-rw-r--r--addons/website_sale_wishlist/views/website_sale_wishlist_template.xml218
2 files changed, 235 insertions, 0 deletions
diff --git a/addons/website_sale_wishlist/views/snippets.xml b/addons/website_sale_wishlist/views/snippets.xml
new file mode 100644
index 00000000..5ad61615
--- /dev/null
+++ b/addons/website_sale_wishlist/views/snippets.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<template id="snippet_options" inherit_id="website.snippet_options" name="Wishlist Snippet Options">
+ <xpath expr="." position="inside">
+ <div data-selector="#wrapwrap > header"
+ data-no-check="true"
+ groups="website.group_website_designer">
+ <we-checkbox string="Show Empty Wishlist"
+ data-customize-website-views="website_sale_wishlist.header_hide_empty_wishlist_link|"
+ data-no-preview="true"
+ data-reload="/"/>
+ </div>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml
new file mode 100644
index 00000000..8cbee02a
--- /dev/null
+++ b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <template id="assets_frontend" inherit_id="website.assets_frontend" name="Wishlist assets frontend">
+ <xpath expr="." position="inside">
+ <link rel="stylesheet" type="text/scss" href="/website_sale_wishlist/static/src/scss/website_sale_wishlist.scss"/>
+ <script type="text/javascript" src="/website_sale_wishlist/static/src/js/website_sale_wishlist.js"></script>
+ </xpath>
+ </template>
+
+ <template id="assets_tests" name="Website Sale Wishlist Assets Tests" inherit_id="web.assets_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/website_sale_wishlist/static/tests/tours/website_sale_wishlist.js"></script>
+ </xpath>
+ </template>
+
+ <template id="add_to_wishlist" inherit_id="website_sale.products_item" customize_show="True" name="Wishlist Button" priority="20">
+ <xpath expr="//div[hasclass('o_wsale_product_btn')]" position="inside">
+ <t t-set="in_wish" t-value="product._is_in_wishlist()"/>
+ <t t-set="product_variant_id" t-value="product._get_first_possible_variant_id()"/>
+ <button t-if="product_variant_id" type="button" role="button" class="btn btn-secondary o_add_wishlist" t-att-disabled='in_wish or None' title="Add to Wishlist" t-att-data-product-template-id="product.id" t-att-data-product-product-id="product_variant_id" data-action="o_wishlist"><span class="fa fa-heart" role="img" aria-label="Add to wishlist"></span></button>
+ </xpath>
+ </template>
+
+ <template id="product_add_to_wishlist" inherit_id="website_sale.product" customize_show="True" name="Wishlist Button" priority="20">
+ <xpath expr="//div[@id='product_option_block']" position="inside">
+ <t t-set="product_variant" t-value="product_variant or product._create_first_product_variant()"/>
+ <t t-set="in_wish" t-value="product_variant and product_variant._is_in_wishlist()"/>
+ <button t-if="product_variant" type="button" role="button" class="btn btn-link mt16 o_add_wishlist_dyn" t-att-disabled='in_wish or None' t-att-data-product-template-id="product.id" t-att-data-product-product-id="product_variant.id" data-action="o_wishlist"><span class="fa fa-heart" role="img" aria-label="Add to wishlist"></span> Add to wishlist</button>
+ </xpath>
+ </template>
+
+ <template id="header_wishlist_link" name="Header Wishlist Link">
+ <t t-set="wishcount" t-value="len(request.env['product.wishlist'].current())"/>
+ <t t-set="show_wishes" t-value="True"/>
+ <li t-attf-class="o_wsale_my_wish #{not show_wishes and 'd-none'} #{_item_class}">
+ <a href="/shop/wishlist" t-attf-class="#{_link_class}">
+ <i t-if="_icon" class="fa fa-1x fa-heart"/>
+ <span t-if="_text">Wishlist</span>
+ <sup t-esc="wishcount" t-attf-class="my_wish_quantity o_animate_blink badge badge-primary"/>
+ </a>
+ </li>
+ </template>
+
+ <template id="header_hide_empty_wishlist_link" inherit_id="website_sale_wishlist.header_wishlist_link">
+ <xpath expr="//t[@t-set='show_wishes']" position="after">
+ <t t-set="show_wishes" t-value="show_wishes and wishcount > 0"/>
+ </xpath>
+ <xpath expr="//li[contains(@t-attf-class, 'o_wsale_my_wish')]" position="attributes">
+ <attribute name="t-attf-class" add="o_wsale_my_wish_hide_empty" separator=" "/>
+ </xpath>
+ </template>
+
+ <template id="template_header_default" inherit_id="website_sale.template_header_default">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item mr-lg-3'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_hamburger" inherit_id="website_sale.template_header_hamburger">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_text" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_vertical" inherit_id="website_sale.template_header_vertical">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-lg-3'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_sidebar" inherit_id="website_sale.template_header_sidebar">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_text" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_slogan" inherit_id="website_sale.template_header_slogan">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-3'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_contact" inherit_id="website_sale.template_header_contact">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-lg-3'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_minimalist" inherit_id="website_sale.template_header_minimalist">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item'"/>
+ <t t-set="_link_class" t-value="'nav-link ml-3'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_boxed" inherit_id="website_sale.template_header_boxed">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_text" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-lg-3'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_centered_logo" inherit_id="website_sale.template_header_centered_logo">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-1'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_image" inherit_id="website_sale.template_header_image">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-lg-2'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_hamburger_full" inherit_id="website_sale.template_header_hamburger_full">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_icon" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item ml-lg-2'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="template_header_magazine" inherit_id="website_sale.template_header_magazine">
+ <xpath expr="//t[@t-call='website_sale.header_cart_link']" position="after">
+ <t t-call="website_sale_wishlist.header_wishlist_link">
+ <t t-set="_text" t-value="True"/>
+ <t t-set="_item_class" t-value="'nav-item'"/>
+ <t t-set="_link_class" t-value="'nav-link'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="product_wishlist" name="Wishlist Page">
+ <t t-call="website.layout">
+ <t t-set="additional_title">Shop Wishlist</t>
+ <div id="wrap" class="js_sale">
+ <div class="oe_structure" id="oe_structure_website_sale_wishlist_product_wishlist_1"/>
+ <div class="container oe_website_sale">
+ <section class="container wishlist-section">
+ <h3>My Wishlist</h3>
+ <div class="checkbox">
+ <label class='text-muted'><input type="checkbox" id='b2b_wish' value="1" class="mr8"/>Add product to my cart but keep it in my wishlist</label>
+ </div>
+ <table class="table table-bordered table-striped table-hover text-center mt16 table-comparator " style="table-layout:auto" id="o_comparelist_table">
+ <body>
+ <t t-foreach="wishes" t-as="wish">
+ <tr t-att-data-wish-id='wish.id' t-att-data-product-id='wish.product_id.id'>
+ <td class='td-img'>
+ <a t-att-href="wish.product_id.website_url">
+ <img t-attf-src="/web/image/product.product/#{wish.product_id.id}/image_128" class="img img-fluid" style="margin:auto;" alt="Product image"/>
+ </a>
+ </td>
+ <td class='text-left'>
+ <strong><a t-att-href="wish.product_id.website_url"><t t-esc="wish.product_id.display_name" /></a></strong>
+ <small class='d-none d-md-block'><p t-field="wish.product_id.description_sale" class="text-muted"/></small>
+ <button type="button" class="btn btn-link o_wish_rm no-decoration"><small><i class='fa fa-trash-o'></i> Remove</small></button>
+ </td>
+ <td>
+ <t t-set="combination_info" t-value="wish.product_id._get_combination_info_variant()"/>
+ <t t-esc="combination_info['price']" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}"/>
+ </td>
+ <td class='text-center td-wish-btn'>
+ <input name="product_id" t-att-value="wish.product_id.id" type="hidden"/>
+ <button type="button" role="button" class="btn btn-secondary btn-block o_wish_add mb4" >Add <span class='d-none d-md-inline'>to Cart</span></button>
+ </td>
+ </tr>
+ </t>
+ </body>
+ </table>
+ </section>
+ </div>
+ </div>
+ </t>
+ </template>
+
+</odoo>