@@ -80,15 +80,13 @@ <h4 class="item-name">{{ item.product.name }}</h4>
8080 item.product.price | appCurrency
8181 }}</ span >
8282 </ div >
83+ < div class ="item-subtotal ">
84+ < span class ="subtotal-amount "> {{
85+ getItemSubtotal(item) | appCurrency
86+ }}</ span >
87+ </ div >
8388 </ div >
8489 </ div >
85- < button
86- class ="remove-btn "
87- (click) ="onRemoveItem(item.product._id!) "
88- title ="{{ 'CART.REMOVE_ITEM' | translate }} "
89- >
90- < i class ="fas fa-times "> </ i >
91- </ button >
9290 < div class ="item-details ">
9391 < div class ="item-quantity-controls ">
9492 < button
@@ -107,6 +105,22 @@ <h4 class="item-name">{{ item.product.name }}</h4>
107105 < i class ="fas fa-plus "> </ i >
108106 </ button >
109107 </ div >
108+ < div class ="item-actions ">
109+ < button
110+ class ="action-btn edit-btn "
111+ (click) ="openPriceEditor(item) "
112+ title ="{{ 'CART.EDIT_PRICE' | translate }} "
113+ >
114+ < i class ="fas fa-edit "> </ i >
115+ </ button >
116+ < button
117+ class ="action-btn remove-btn "
118+ (click) ="onRemoveItem(item.product._id!) "
119+ title ="{{ 'CART.REMOVE_ITEM' | translate }} "
120+ >
121+ < i class ="fas fa-times "> </ i >
122+ </ button >
123+ </ div >
110124 </ div >
111125 </ div >
112126 }
@@ -116,13 +130,36 @@ <h4 class="item-name">{{ item.product.name }}</h4>
116130
117131 < div class ="cart-footer ">
118132 < div class ="cart-summary ">
119- < div class ="summary-row ">
120- < span > {{ "CART.SUMMARY.ITEMS" | translate }}</ span >
121- < span > {{ getTotalItems() }}x</ span >
133+ < div class ="summary-row discount-row ">
134+ < span > {{ "CART.SUMMARY.DISCOUNT" | translate }}</ span >
135+ < div class ="discount-controls ">
136+ < input
137+ type ="number "
138+ [ngModel] ="discountAmount() "
139+ (ngModelChange) ="discountAmount.set($event) "
140+ class ="discount-input "
141+ placeholder ="0.00 "
142+ min ="0 "
143+ step ="0.01 "
144+ />
145+ < button class ="discount-btn " (click) ="applyDiscount() ">
146+ < i class ="fas fa-check "> </ i >
147+ </ button >
148+ </ div >
122149 </ div >
150+ @if (discountAmount() > 0) {
151+ < div class ="summary-row ">
152+ < span > {{ "CART.SUMMARY.DISCOUNT_AMOUNT" | translate }}</ span >
153+ < span class ="discount-amount "
154+ > -{{ discountAmount() | appCurrency }}</ span
155+ >
156+ </ div >
157+ }
123158 < div class ="summary-row total ">
124159 < span > {{ "CART.SUMMARY.TOTAL" | translate }}</ span >
125- < span class ="total-amount "> {{ calculateTotal() | appCurrency }}</ span >
160+ < span class ="total-amount "> {{
161+ calculateSubtotal() | appCurrency
162+ }}</ span >
126163 </ div >
127164 </ div >
128165 < div class ="quick-pay ">
@@ -161,6 +198,40 @@ <h4 class="item-name">{{ item.product.name }}</h4>
161198 </ div >
162199</ aside >
163200
201+ <!-- Price Editor Modal -->
202+ @if (showPriceEditor()) {
203+ < div class ="modal-overlay " (click) ="closePriceEditor() ">
204+ < div
205+ class ="modal-content price-editor-modal "
206+ (click) ="$event.stopPropagation() "
207+ >
208+ < div class ="modal-header ">
209+ < h3 >
210+ < i class ="fas fa-tag "> </ i >
211+ {{ "CART.EDIT_PRICE_TITLE" | translate }}
212+ </ h3 >
213+ < button class ="close-modal-btn " (click) ="closePriceEditor() ">
214+ < i class ="fas fa-times "> </ i >
215+ </ button >
216+ </ div >
217+ < div class ="modal-body price-editor-body ">
218+ @if (editingItem()) {
219+ < div class ="item-being-edited ">
220+ < p class ="current-price ">
221+ {{ "CART.CURRENT_PRICE" | translate }}:
222+ < strong > {{ editingItem()!.product.price | appCurrency }}</ strong >
223+ </ p >
224+ </ div >
225+ }
226+ < app-calculator
227+ (addItem) ="onPriceChanged($event) "
228+ [lastItemPrice] ="editingItem()!.product.price ?? null "
229+ > </ app-calculator >
230+ </ div >
231+ </ div >
232+ </ div >
233+ }
234+
164235<!-- Close Tab Confirmation Modal -->
165236@if (showCloseConfirmation()) {
166237 < div class ="modal-overlay " (click) ="cancelCloseTab() ">
0 commit comments