Skip to content

Commit bd26740

Browse files
committed
[FIX] website_attribute_set: some improvements
1 parent 0c557ca commit bd26740

6 files changed

Lines changed: 5 additions & 23 deletions

File tree

website_attribute_set/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Usage
4545
Steps to Enable Attributes in E-Commerce
4646
----------------------------------------
4747

48-
1. Open the attribute view for a target record.
48+
1. Go to PIM → Attributes → Product Attribute and select one
4949
2. Check the field **``E-Commerce Visibility``**.
5050
3. Assign values to the attribute in the product view, and make sure
5151
that the product is linked with an **``attribute_set``**.

website_attribute_set/controllers/main.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,7 @@
1717

1818

1919
class WebsiteSale(main.WebsiteSale):
20-
@route(
21-
[
22-
"/shop",
23-
"/shop/page/<int:page>",
24-
'/shop/category/<model("product.public.category"):category>',
25-
'/shop/category/<model("product.public.category"):category>/page/<int:page>',
26-
],
27-
type="http",
28-
auth="public",
29-
website=True,
30-
sitemap=main.WebsiteSale.sitemap_shop,
31-
)
20+
@route()
3221
def shop(
3322
self,
3423
page=0,
@@ -351,12 +340,6 @@ def _get_search_options(
351340
values["additional_attrib_values"] = post.get("additional_attrib_values")
352341
return values
353342

354-
def _shop_lookup_products(self, attrib_set, options, post, search, website):
355-
fuzzy_search_term, product_count, search_result = super()._shop_lookup_products(
356-
attrib_set, options, post, search, website
357-
)
358-
return fuzzy_search_term, product_count, search_result
359-
360343
def _get_additional_shop_values(self, values):
361344
# Can be used to search & filter products depending on their custom attributes
362345
"""Hook to update values used for rendering website_sale.products template"""

website_attribute_set/models/mixins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,5 @@ def _search_fetch(self, search_detail, search, limit, order):
6767
domain, limit=limit, order=search_detail.get("order", order)
6868
)
6969
count = model.search_count(domain)
70-
return results, count
7170

7271
return results, count
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Steps to Enable Attributes in E-Commerce
22

3-
1. Open the attribute view for a target record.
3+
1. Go to PIM → Attributes → Product Attribute and select one
44
2. Check the field **`E-Commerce Visibility`**.
55
3. Assign values to the attribute in the product view, and make sure that the product is linked with an **`attribute_set`**.
66
4. Open the E-Commerce app and navigate to the product page. You should see the additional attributes displayed there.

website_attribute_set/static/description/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
396396
<div class="section" id="steps-to-enable-attributes-in-e-commerce">
397397
<h2><a class="toc-backref" href="#toc-entry-2">Steps to Enable Attributes in E-Commerce</a></h2>
398398
<ol class="arabic simple">
399-
<li>Open the attribute view for a target record.</li>
399+
<li>Go to PIM → Attributes → Product Attribute and select one</li>
400400
<li>Check the field <strong>``E-Commerce Visibility``</strong>.</li>
401401
<li>Assign values to the attribute in the product view, and make sure
402402
that the product is linked with an <strong>``attribute_set``</strong>.</li>

website_attribute_set/views/templates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<t t-foreach="all_attribute_values" t-as="value">
122122
<option
123123
t-att-value="'%s-%s' % (attribute.id,value)"
124-
t-esc="value"
124+
t-out="value"
125125
t-att-selected="(attribute.id, str(value or '')) in additional_attrib_set"
126126
/>
127127
</t>

0 commit comments

Comments
 (0)