fix: Missing Image in Item Page and Variants in Cart

- Added fallback for missing image in item page
- Explore button font
- Incorrectly fetching route from Item master, use Website Item instead
This commit is contained in:
marination
2021-06-09 00:11:48 +05:30
parent 24c8967232
commit cb52c98f02
5 changed files with 28 additions and 4 deletions

View File

@@ -31,7 +31,10 @@
{%- set variant_of = frappe.db.get_value('Item', d.item_code, 'variant_of') %}
{% if variant_of %}
<span class="item-subtitle mr-2">
{{ _('Variant of') }} <a href="{{frappe.db.get_value('Item', variant_of, 'route')}}">{{ variant_of }}</a>
{{ _('Variant of') }}
<a href="{{frappe.db.get_value('Website Item', {'item_code': variant_of}, 'route') or '#'}}">
{{ variant_of }}
</a>
</span>
{% endif %}
<div class="mt-2 notes">

View File

@@ -9,7 +9,13 @@
{% macro product_image(website_image, css_class="product-image", alt="") %}
<div class="border text-center rounded {{ css_class }}" style="overflow: hidden;">
<img itemprop="image" class="website-image h-100 w-100" alt="{{ alt }}" src="{{ frappe.utils.quoted(website_image or 'no-image.jpg') | abs_url }}">
{% if website_image %}
<img itemprop="image" class="website-image h-100 w-100" alt="{{ alt }}" src="{{ frappe.utils.quoted(website_image) | abs_url }}">
{% else %}
<div class="card-img-top no-image-item">
{{ frappe.utils.get_abbr(alt) or "NA" }}
</div>
{% endif %}
</div>
{% endmacro %}