<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Webshop-10-Feature-Gap-Cart-Discounts</id>
	<title>Webshop-10-Feature-Gap-Cart-Discounts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Webshop-10-Feature-Gap-Cart-Discounts"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Webshop-10-Feature-Gap-Cart-Discounts&amp;action=history"/>
	<updated>2026-06-05T11:03:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mediawiki.comfac.net/index.php?title=Webshop-10-Feature-Gap-Cart-Discounts&amp;diff=168&amp;oldid=prev</id>
		<title>Justinaquino: &quot;Add all 14 Frappe ERPNext Webshop chapter pages from wikitext-upload&quot;</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Webshop-10-Feature-Gap-Cart-Discounts&amp;diff=168&amp;oldid=prev"/>
		<updated>2026-03-06T13:00:42Z</updated>

		<summary type="html">&lt;p&gt;&amp;quot;Add all 14 Frappe ERPNext Webshop chapter pages from wikitext-upload&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= 10 - Feature Gap: Cart Discounts =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parent:&amp;#039;&amp;#039;&amp;#039; [Webshop-Index Webshop Index]  &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Previous:&amp;#039;&amp;#039;&amp;#039; [Webshop-09-Hooks-and-Events 09 - Hooks &amp;amp; Events]  &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Next:&amp;#039;&amp;#039;&amp;#039; [Webshop-11-Feature-Plan-System-Builder 11 - Feature Plan: System Builder]  &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source:&amp;#039;&amp;#039;&amp;#039; [https://github.com/Comfac-Global-Group/comfac-webshop/wiki/10-Feature-Gap-Cart-Discounts Comfac Webshop Wiki - Chapter 10]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Status:&amp;#039;&amp;#039;&amp;#039; 🔴 Not Implemented | &amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039; High&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
Discounts (from Pricing Rules, Coupon Codes, etc.) are calculated on the Quotation backend but are NOT displayed to the customer in the shopping cart UI. Customers see only the final price without understanding what promotions are active or how much they&amp;#039;re saving.&lt;br /&gt;
&lt;br /&gt;
== Current State ==&lt;br /&gt;
&lt;br /&gt;
=== What the customer sees in the cart: ===&lt;br /&gt;
&lt;br /&gt;
- Item name, code, image&lt;br /&gt;
- Quantity (editable)&lt;br /&gt;
- Rate (final price per unit)&lt;br /&gt;
- Amount (total for that line)&lt;br /&gt;
- Net Total, Taxes, Grand Total&lt;br /&gt;
- Coupon code badge (if applied)&lt;br /&gt;
&lt;br /&gt;
=== What exists on the Quotation but is HIDDEN: ===&lt;br /&gt;
&lt;br /&gt;
- Original price (&amp;lt;code&amp;gt;price_list_rate&amp;lt;/code&amp;gt;) before discount&lt;br /&gt;
- Discount percentage (&amp;lt;code&amp;gt;discount_percentage&amp;lt;/code&amp;gt;)&lt;br /&gt;
- Per-item discount amount&lt;br /&gt;
- Total savings&lt;br /&gt;
- Which pricing rules are active&lt;br /&gt;
- Additional discount on total (&amp;lt;code&amp;gt;discount_amount&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;additional_discount_percentage&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
== Where the Fix Needs to Happen ==&lt;br /&gt;
&lt;br /&gt;
=== 1. &amp;lt;code&amp;gt;cart_items.html&amp;lt;/code&amp;gt; - Per-item discount display ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Current:&amp;#039;&amp;#039;&amp;#039; Shows only &amp;lt;code&amp;gt;rate&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Needed:&amp;#039;&amp;#039;&amp;#039; Show &amp;lt;code&amp;gt;price_list_rate&amp;lt;/code&amp;gt; struck through when it differs from &amp;lt;code&amp;gt;rate&amp;lt;/code&amp;gt;, plus discount badge&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jinja2&lt;br /&gt;
{% if item.price_list_rate and item.price_list_rate != item.rate %}&lt;br /&gt;
    &amp;lt;span class=&amp;quot;original-price text-muted&amp;quot; style=&amp;quot;text-decoration: line-through;&amp;quot;&amp;gt;&lt;br /&gt;
        {{ item.get_formatted(&amp;#039;price_list_rate&amp;#039;) }}&lt;br /&gt;
    &amp;lt;/span&amp;gt;&lt;br /&gt;
    &amp;lt;span class=&amp;quot;discount-badge text-success ml-1&amp;quot;&amp;gt;&lt;br /&gt;
        -{{ item.discount_percentage }}%&lt;br /&gt;
    &amp;lt;/span&amp;gt;&lt;br /&gt;
{% endif %}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2. &amp;lt;code&amp;gt;cart_payment_summary.html&amp;lt;/code&amp;gt; - Savings total ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Current:&amp;#039;&amp;#039;&amp;#039; Net Total, Taxes, Grand Total only&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Needed:&amp;#039;&amp;#039;&amp;#039; Add &amp;quot;You Save&amp;quot; row&lt;br /&gt;
&lt;br /&gt;
=== 3. &amp;lt;code&amp;gt;cart_items_total.html&amp;lt;/code&amp;gt; - Pre-discount subtotal ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Current:&amp;#039;&amp;#039;&amp;#039; Shows &amp;lt;code&amp;gt;doc.total&amp;lt;/code&amp;gt; only&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Needed:&amp;#039;&amp;#039;&amp;#039; Optionally show original total and savings&lt;br /&gt;
&lt;br /&gt;
=== 4. &amp;lt;code&amp;gt;cart_items_dropdown.html&amp;lt;/code&amp;gt; - Navbar mini-cart ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Current:&amp;#039;&amp;#039;&amp;#039; Shows &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; only&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Needed:&amp;#039;&amp;#039;&amp;#039; Strike-through price when discounted&lt;br /&gt;
&lt;br /&gt;
=== 5. Quotation DocType Modifications ===&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;better reflect discounts&amp;quot; per the requirements:&lt;br /&gt;
&lt;br /&gt;
- Consider adding a &amp;#039;&amp;#039;&amp;#039;child table or virtual field&amp;#039;&amp;#039;&amp;#039; that summarizes all active pricing rules per item&lt;br /&gt;
- Add a &amp;quot;Discount Summary&amp;quot; section to the Quotation print format&lt;br /&gt;
- Potentially add &amp;lt;code&amp;gt;total_savings&amp;lt;/code&amp;gt; as a computed field on Quotation&lt;br /&gt;
&lt;br /&gt;
== No Backend Changes Needed ==&lt;br /&gt;
&lt;br /&gt;
All discount data is already computed by ERPNext&amp;#039;s pricing engine during:&lt;br /&gt;
- &amp;lt;code&amp;gt;apply_cart_settings()&amp;lt;/code&amp;gt; &lt;br /&gt;
- &amp;lt;code&amp;gt;set_price_list_and_item_details()&amp;lt;/code&amp;gt; &lt;br /&gt;
- &amp;lt;code&amp;gt;calculate_taxes_and_totals()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is purely a &amp;#039;&amp;#039;&amp;#039;frontend/template display issue&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Files to Modify ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| File&lt;br /&gt;
| Change&lt;br /&gt;
|}&lt;br /&gt;
|--------|----------|&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;templates/includes/cart/cart_items.html&amp;lt;/code&amp;gt;&lt;br /&gt;
| Add original price, discount % display&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;templates/includes/cart/cart_payment_summary.html&amp;lt;/code&amp;gt;&lt;br /&gt;
| Add savings row, discount summary&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;templates/includes/cart/cart_items_total.html&amp;lt;/code&amp;gt;&lt;br /&gt;
| Add pre-discount total&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;templates/includes/cart/cart_items_dropdown.html&amp;lt;/code&amp;gt;&lt;br /&gt;
| Add strike-through price&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;public/scss/webshop_cart.scss&amp;lt;/code&amp;gt;&lt;br /&gt;
| Styles for discount badges, strike-through&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Edge Cases to Handle ==&lt;br /&gt;
&lt;br /&gt;
1. &amp;#039;&amp;#039;&amp;#039;Free items&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;is_free_item=True&amp;lt;/code&amp;gt;) - already handled with &amp;quot;FREE&amp;quot; badge&lt;br /&gt;
2. &amp;#039;&amp;#039;&amp;#039;Items with no discount&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;price_list_rate == rate&amp;lt;/code&amp;gt;) - no change needed&lt;br /&gt;
3. &amp;#039;&amp;#039;&amp;#039;Additional discount on total&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;doc.discount_amount&amp;lt;/code&amp;gt;) - show separately&lt;br /&gt;
4. &amp;#039;&amp;#039;&amp;#039;Multiple pricing rules per item&amp;#039;&amp;#039;&amp;#039; - show highest or combined&lt;br /&gt;
5. &amp;#039;&amp;#039;&amp;#039;Margin-based pricing&amp;#039;&amp;#039;&amp;#039; - &amp;lt;code&amp;gt;rate_with_margin&amp;lt;/code&amp;gt; field&lt;br /&gt;
&lt;br /&gt;
== Related Documentation ==&lt;br /&gt;
&lt;br /&gt;
- [Webshop-13-Discount-Visibility-and-Urgency Chapter 13: Discount Visibility &amp;amp; Urgency] - UI specifications&lt;br /&gt;
- [Webshop-14-Hypothesis-Discount-Deadline-Visibility Chapter 14: Hypothesis - Discount Deadline Visibility] - Exact implementation plan&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Navigation:&amp;#039;&amp;#039;&amp;#039; [Webshop-Index Webshop Index] | [Webshop-09-Hooks-and-Events Previous: 09 - Hooks &amp;amp; Events] | [Webshop-11-Feature-Plan-System-Builder Next: 11 - System Builder]&lt;/div&gt;</summary>
		<author><name>Justinaquino</name></author>
	</entry>
</feed>