diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/website_sale/views/snippets | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/website_sale/views/snippets')
3 files changed, 190 insertions, 0 deletions
diff --git a/addons/website_sale/views/snippets/s_dynamic_snippet_products.xml b/addons/website_sale/views/snippets/s_dynamic_snippet_products.xml new file mode 100644 index 00000000..2e871086 --- /dev/null +++ b/addons/website_sale/views/snippets/s_dynamic_snippet_products.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <template id="s_dynamic_snippet_products" name="Dynamic Products"> + <t t-call="website.s_dynamic_snippet_template"> + <t t-set="snippet_name" t-value="'s_dynamic_snippet_products'"/> + </t> + </template> + <template id="s_dynamic_snippet_products_options" inherit_id="website.snippet_options"> + <xpath expr="." position="inside"> + <t t-call="website.dynamic_snippet_carousel_options_template"> + <t t-set="snippet_name" t-value="'dynamic_snippet_products'"/> + <t t-set="snippet_selector" t-value="'.s_dynamic_snippet_products'"/> + <we-select string="Product Category" data-name="product_category_opt" data-attribute-name="productCategoryId" data-no-preview="true"> + <we-button data-select-data-attribute="-1">All Products</we-button> + </we-select> + </t> + </xpath> + </template> + <template id="assets_snippet_s_dynamic_snippet_products_js_000" inherit_id="website.assets_snippet_s_dynamic_snippet_carousel_js_000"> + <xpath expr="//script[last()]" position="after"> + <script type="text/javascript" src="/website_sale/static/src/snippets/s_dynamic_snippet_products/000.js"/> + </xpath> + </template> +</odoo> diff --git a/addons/website_sale/views/snippets/s_products_searchbar.xml b/addons/website_sale/views/snippets/s_products_searchbar.xml new file mode 100644 index 00000000..67ae6208 --- /dev/null +++ b/addons/website_sale/views/snippets/s_products_searchbar.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + +<template id="s_products_searchbar_input" name="Products Search"> + <t t-call="website_sale.website_sale_products_search_box"> + <t t-set="_classes" t-value="'s_wsale_products_searchbar_input'"/> + <t t-set="_snippet" t-value="'s_products_searchbar_input'"/> + </t> +</template> +<template id="s_products_searchbar" name="Products Search"> + <section class="s_wsale_products_searchbar bg-200 pt48 pb48" data-vxml="001"> + <div class="container"> + <div class="row"> + <div class="col-lg-8 offset-lg-2"> + <h2>Search for a product</h2> + <p>We have amazing products in our shop, check them now !</p> + <t t-snippet-call="website_sale.s_products_searchbar_input"/> + </div> + </div> + </div> + </section> +</template> + +<template id="searchbar_input_snippet_options" inherit_id="website_sale.snippet_options" name="search bar snippet options"> + <xpath expr="." position="inside"> + <div data-selector=".s_wsale_products_searchbar_input"> + <we-select string="Order by" id="order_by" data-attribute-name="value" data-apply-to=".o_wsale_search_order_by"> + <we-button data-select-attribute="">default</we-button> + <we-button data-select-attribute="name asc">name (A-Z)</we-button> + <we-button data-select-attribute="name desc">name (Z-A)</we-button> + <we-button data-select-attribute="list_price asc">price (low to high)</we-button> + <we-button data-select-attribute="list_price desc">price (high to low)</we-button> + </we-select> + <t t-set="unit">products</t> + <we-input string="Suggestions" data-name="product_limit_opt" data-attribute-name="limit" + data-apply-to=".search-query" data-select-data-attribute="" t-att-data-unit="unit"/> + <we-checkbox string="Description" data-dependencies="product_limit_opt" data-select-data-attribute="true" data-attribute-name="displayDescription" + data-apply-to=".search-query"/> + <we-checkbox string="Price" data-dependencies="product_limit_opt" data-select-data-attribute="true" data-attribute-name="displayPrice" + data-apply-to=".search-query"/> + <we-checkbox string="Image" data-dependencies="product_limit_opt" data-select-data-attribute="true" data-attribute-name="displayImage" + data-apply-to=".search-query"/> + </div> + </xpath> + <xpath expr="//*[@t-set='so_content_addition_selector']" position="inside">, .s_wsale_products_searchbar_input</xpath> +</template> + +<template id="assets_snippet_s_products_searchbar_js_000" inherit_id="website_sale.assets_frontend"> + <xpath expr="//script[last()]" position="after"> + <script type="text/javascript" src="/website_sale/static/src/snippets/s_products_searchbar/000.js"/> + </xpath> +</template> + +</odoo> diff --git a/addons/website_sale/views/snippets/snippets.xml b/addons/website_sale/views/snippets/snippets.xml new file mode 100644 index 00000000..6b0fb28a --- /dev/null +++ b/addons/website_sale/views/snippets/snippets.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + +<template id="s_products_recently_viewed" name="Viewed Products"> + <section class="s_wsale_products_recently_viewed d-none pt24 pb24" style="min-height: 400px;"> + <div class="container"> + <div class="alert alert-info alert-dismissible rounded-0 fade show d-print-none css_non_editable_mode_hidden o_not_editable"> + This is a preview of the recently viewed products by the user.<br/> + Once the user has seen at least one product this snippet will be visible. + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> × </button> + </div> + + <h3 class="text-center mb32">Recently viewed Products</h3> + <div class="slider o_not_editable"/> + </div> + </section> +</template> + +<template id="snippets" inherit_id="website.snippets" name="e-commerce snippets"> + <xpath expr="//t[@id='sale_products_hook']" position="replace"> + <t t-snippet="website_sale.s_dynamic_snippet_products" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_recently_viewed.svg"/> + </xpath> + <xpath expr="//t[@id='sale_recently_viewed_product_hook']" position="replace"> + <t t-snippet="website_sale.s_products_recently_viewed" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_recently_viewed.svg"/> + </xpath> + <xpath expr="//t[@id='sale_product_search_section_hook']" position="replace"> + <t t-snippet="website_sale.s_products_searchbar" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_searchbar.svg"/> + </xpath> + <xpath expr="//t[@id='sale_product_search_input_hook']" position="replace"> + <t t-snippet="website_sale.s_products_searchbar_input" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_searchbar_inline.svg"/> + </xpath> +</template> + +<template id="snippet_options" inherit_id="website.snippet_options" name="e-commerce snippet options"> + <xpath expr="." position="inside"> + <div data-js="WebsiteSaleGridLayout" + data-selector="#products_grid .o_wsale_products_grid_table_wrapper > table" + data-no-check="true"> + <we-input string="Number of products" data-set-ppg="" data-no-preview="true"/> + <we-select string="Number of Columns" class="o_wsale_ppr_submenu" data-no-preview="true"> + <we-button data-set-ppr="2">2</we-button> + <we-button data-set-ppr="3">3</we-button> + <we-button data-set-ppr="4">4</we-button> + </we-select> + </div> + + <div data-js="WebsiteSaleProductsItem" + data-selector="#products_grid .oe_product" + data-no-check="true"> + <div class="o_wsale_soptions_menu_sizes"> + <we-title>Size</we-title> + <table> + <tr> + <td/><td/><td/><td/> + </tr> + <tr> + <td/><td/><td/><td/> + </tr> + <tr> + <td/><td/><td/><td/> + </tr> + <tr> + <td/><td/><td/><td/> + </tr> + </table> + </div> + + <we-row data-name="ribbon_options"> + <we-select string="Ribbon" class="o_wsale_ribbon_select"> + <we-button data-set-ribbon="" data-name="no_ribbon_opt">None</we-button> + <!-- Ribbons are filled in JS --> + </we-select> + <we-button data-edit-ribbon="" class="fa fa-edit" data-no-preview="true" data-dependencies="!no_ribbon_opt"/> + <we-button data-create-ribbon="" class="fa fa-plus text-success" data-no-preview="true"/> + </we-row> + <div class="d-none" data-name="ribbon_customize_opt"> + <we-row string="Ribbon"> + <we-input data-set-ribbon-html="" class="o_we_large_input" data-apply-to=".o_wsale_ribbon_dummy"/> + <we-button class="fa fa-check" data-save-ribbon="" title="Validate" data-no-preview="true"/> + <we-button class="fa fa-trash" data-delete-ribbon="" title="Delete" data-no-preview="true"/> + </we-row> + <we-colorpicker string="⌙ Background" title="" data-select-style="" data-apply-to=".o_wsale_ribbon_dummy" data-css-property="background-color" data-color-prefix="bg-"/> + <we-colorpicker string="⌙ Text" title="" data-select-style="" data-apply-to=".o_wsale_ribbon_dummy" data-css-property="color"/> + <we-select string="⌙ Mode"> + <we-button data-set-ribbon-mode="ribbon">Slanted</we-button> + <we-button data-set-ribbon-mode="tag">Tag</we-button> + </we-select> + <we-select string="⌙ Position"> + <we-button data-set-ribbon-position="left">Left</we-button> + <we-button data-set-ribbon-position="right">Right (only on grid view)</we-button> + </we-select> + </div> + + <div name="reordering" data-no-preview="true"> + <we-button data-change-sequence="top">Push to top</we-button> + <we-button data-change-sequence="up">Push up</we-button> + <we-button data-change-sequence="down">Push down</we-button> + <we-button data-change-sequence="bottom">Push to bottom</we-button> + </div> + </div> + <div data-selector="#wrapwrap > header" + data-no-check="true" + groups="website.group_website_designer"> + <we-checkbox string="Show Empty Cart" + data-customize-website-views="website_sale.header_hide_empty_cart_link|" + data-no-preview="true" + data-reload="/"/> + </div> + </xpath> +</template> + +</odoo> |
