fix: broken image style
This commit is contained in:
parent
dfa78eb27d
commit
2aa1efb70e
@ -17,7 +17,7 @@ class ProductsSettings(Document):
|
||||
|
||||
self.validate_field_filters()
|
||||
self.validate_attribute_filters()
|
||||
frappe.clear_document_cache("Product Settings")
|
||||
frappe.clear_document_cache("Product Settings", "Product Settings")
|
||||
|
||||
def validate_field_filters(self):
|
||||
if not (self.enable_field_filters and self.filter_fields): return
|
||||
|
@ -83,6 +83,10 @@ body.product-page {
|
||||
// text-align: left;
|
||||
// }
|
||||
// }
|
||||
.card-img-container {
|
||||
height: 210px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
max-height: 210px;
|
||||
@ -308,10 +312,6 @@ body.product-page {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,8 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
context.field_filters = filter_engine.get_field_filters()
|
||||
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
||||
|
||||
print(context.field_filters, context.attribute_filters)
|
||||
|
||||
context.update({
|
||||
"parents": get_parent_item_groups(self.parent_item_group),
|
||||
"title": self.name
|
||||
|
@ -16,6 +16,7 @@ class ProductFiltersBuilder:
|
||||
|
||||
def get_field_filters(self):
|
||||
filter_fields = [row.fieldname for row in self.doc.filter_fields]
|
||||
print('FILTERS', self.doc.filter_fields)
|
||||
|
||||
meta = frappe.get_meta('Item')
|
||||
fields = [df for df in meta.fields if df.fieldname in filter_fields]
|
||||
@ -52,6 +53,7 @@ class ProductFiltersBuilder:
|
||||
|
||||
def get_attribute_fitlers(self):
|
||||
attributes = [row.attribute for row in self.doc.filter_attributes]
|
||||
print('ATTRIBUTES', attributes)
|
||||
attribute_docs = [
|
||||
frappe.get_doc('Item Attribute', attribute) for attribute in attributes
|
||||
]
|
||||
|
@ -89,7 +89,9 @@
|
||||
<div class="col-sm-{{ col_size }} item-card">
|
||||
<div class="card {{ align_items_class }}">
|
||||
{% if image %}
|
||||
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
||||
<div class="card-img-container">
|
||||
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card-img-top no-image">
|
||||
{{ frappe.utils.get_abbr(title) }}
|
||||
|
@ -12,6 +12,7 @@ def get_context(context):
|
||||
search = frappe.form_dict.search
|
||||
field_filters = frappe.parse_json(frappe.form_dict.field_filters)
|
||||
attribute_filters = frappe.parse_json(frappe.form_dict.attribute_filters)
|
||||
print(field_filters, attribute_filters)
|
||||
start = frappe.parse_json(frappe.form_dict.start)
|
||||
else:
|
||||
search = field_filters = attribute_filters = None
|
||||
@ -29,6 +30,8 @@ def get_context(context):
|
||||
context.field_filters = filter_engine.get_field_filters()
|
||||
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
||||
|
||||
print(context.field_filters, context.attribute_filters)
|
||||
|
||||
context.product_settings = product_settings
|
||||
context.body_class = "product-page"
|
||||
context.page_length = product_settings.products_per_page or 20
|
||||
|
Loading…
x
Reference in New Issue
Block a user