Skip to content

Commit

Permalink
USF-1510: Cart Summary has a Footer Slot
Browse files Browse the repository at this point in the history
- add Footer slot to the Cart Summary
  • Loading branch information
anthoula committed Nov 11, 2024
1 parent b774f87 commit b94f6ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/commerce-cart/commerce-cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ export default async function decorate(block) {
slots: {
Footer: (ctx) => {
// Runs on mount
const wrapper = document.createElement("div");
const wrapper = document.createElement('div');
ctx.appendChild(wrapper);

// Append Product Promotions on every update
ctx.onChange((next) => {
wrapper.innerHTML = "";
wrapper.innerHTML = '';

next.item?.discount?.label?.forEach((label) => {
const discount = document.createElement("div");
discount.style.color = "#3d3d3d";
const discount = document.createElement('div');
discount.style.color = '#3d3d3d';
discount.innerText = label;
wrapper.appendChild(discount);
});
Expand Down

0 comments on commit b94f6ab

Please sign in to comment.