Skip to content

Commit

Permalink
[MIG] website_sale_ux: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jok-adhoc committed Jan 17, 2023
1 parent 6e14191 commit e618e52
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions website_sale_ux/README.rst
Expand Up @@ -14,11 +14,10 @@
Website Sale UX
===============

#. This module adds search by public_categ_ids on product website category.
#. Make the search products for all categories if you stay in one.
#. This module also changes the functionality of the "add to cart" button:
* If the product has variants configured, you'll be redirected to the product's view so you can choose which variant you want.
* Regardless the product has optional items, the button will open a pop up to choose the quantity.
#. This module adds the option to "Search Website Product Category for" (public_categ_ids) on Website app`s backend search bar (Website > Product).
#. This module also changes the functionality of the Catalog page`s "Add to cart" buttons (frontend):
* If the product has not variants, when user clicks Add to cart button then the product is added to the Cart (default behaviour).
* If the product has variants, when users click the Add to cart button then they are redirected to the Product page (new feature) so they could choice among all variants, instead of opening the pop-up to choice among all variants (default behaviour). This new feature is required because "variant pop-up" shows a malfunction when user tries to add to cart a bigger quantity of a variant product than stock available.

Installation
============
Expand Down
4 changes: 2 additions & 2 deletions website_sale_ux/__manifest__.py
Expand Up @@ -20,7 +20,7 @@
{
'name': 'Website Sale UX',
'category': 'base.module_category_knowledge_management',
'version': "15.0.1.0.0",
'version': "16.0.1.0.0",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand All @@ -33,5 +33,5 @@
'data': [
'views/product_template_views.xml',
],
'installable': False,
'installable': True,
}
8 changes: 4 additions & 4 deletions website_sale_ux/views/product_template_views.xml
Expand Up @@ -12,13 +12,13 @@
</record>

<template id="products_add_to_cart" inherit_id="website_sale.products_add_to_cart" active="True" name="Add to Cart">
<xpath expr="//t[@t-set='product_variant_id']" position="attributes">
<attribute name="t-if">len(product.product_variant_ids) == 1</attribute>
<xpath expr="//a[@t-if='product._website_show_quick_add()']" position="attributes">
<attribute name="t-if">product._website_show_quick_add() and len(product.product_variant_ids) == 1</attribute>
</xpath>
<xpath expr="//t[@t-if='product_variant_id']" position="after">
<t t-if="product_variant_id and template_price_vals['price_reduce'] or not website.prevent_zero_price_sale" position="after">
<a class="btn btn-secondary btn-m" title="Shopping cart (Select attributes)" t-if="len(product.product_variant_ids) &gt; 1" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']&gt;1 else None))">
<span class="fa fa-shopping-cart"/>
</a>
</xpath>
</t>
</template>
</odoo>

0 comments on commit e618e52

Please sign in to comment.