feat: Slashed Prices and Discount display

- Registered mrp and price after discounts
- slashed price with discount in listing, item page and wishlist
- removed redundant imports
- renamed method to `get_web_item_qty_in_stock` to get Website Item stock
- adjusted styles for resizing
- made add to cart button full width on cards
This commit is contained in:
marination
2021-04-13 00:39:26 +05:30
parent 3d5f029e51
commit 60261852b2
11 changed files with 138 additions and 73 deletions

View File

@@ -39,7 +39,7 @@
{{ doc.website_content or '' }}
<!-- Reviews and Comments -->
{% if shopping_cart.cart_settings.enable_reviews %}
{% if shopping_cart.cart_settings.enable_reviews and not doc.has_variants %}
{% include "templates/generators/item/item_reviews.html"%}
{% endif %}
</div>

View File

@@ -7,9 +7,21 @@
<div class="col-md-12">
<!-- Price and Availability -->
{% if cart_settings.show_price and product_info.price %}
{% set price_info = product_info.price %}
{% if price_info.formatted_mrp %}
<small class="formatted-price">
M.R.P.:
<s>{{ price_info.formatted_mrp }}</s>
</small>
<small class="ml-2 formatted-price" style="color: #F47A7A; font-weight: 500;">
{{ price_info.get("formatted_discount_percent") or price_info.get("formatted_discount_rate")}} OFF
</small>
{% endif %}
<div class="product-price">
{{ product_info.price.formatted_price_sales_uom }}
<small class="formatted-price">({{ product_info.price.formatted_price }} / {{ product_info.uom }})</small>
{{ price_info.formatted_price_sales_uom }}
<small class="formatted-price">({{ price_info.formatted_price }} / {{ product_info.uom }})</small>
</div>
{% else %}
{{ _("UOM") }} : {{ product_info.uom }}