Skip to content

Commit

Permalink
lesson 15: make payment summary interactive - mvc practical example
Browse files Browse the repository at this point in the history
  • Loading branch information
a10n-jsd committed Jan 29, 2025
1 parent 97a1398 commit d37c313
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import {
updateDeliveryOption,
updateQuantity
} from '../../data/cart.js';
import { deliveryOptions, getDeliveryOption } from '../../data/deliveryOptions.js';
import {
deliveryOptions,
getDeliveryOption
} from '../../data/deliveryOptions.js';
import { getProduct } from '../../data/products.js';
import { formatCurrency } from '../../utils/money.js';
import dayjs from 'https://unpkg.com/dayjs@1.11.10/esm/index.js';
import { renderPaymentSummary } from './paymentSummary.js';

export function renderOrderSummary() {
// We make this function because:
Expand Down Expand Up @@ -135,6 +139,7 @@ export function renderOrderSummary() {
const {productId, deliveryOptionId} = element.dataset;
updateDeliveryOption(productId, deliveryOptionId);
renderOrderSummary();
renderPaymentSummary();
})
});

Expand All @@ -156,6 +161,8 @@ export function renderOrderSummary() {
container.remove();

updateCartQuantity();

renderPaymentSummary();
})
});

Expand Down

0 comments on commit d37c313

Please sign in to comment.