Skip to content

Commit

Permalink
Update merch-card.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelcureno committed Aug 9, 2024
1 parent 485dd6d commit e7de2e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,13 @@ const addStartingAt = async (styles, merchCard) => {
await replaceKey('starting-at', getConfig()).then((key) => {
const startingAt = createTag('p', { slot: 'starting-at' }, key);
const firstPrice = merchCard.querySelectorAll('span[is="inline-price"]');
if (firstPrice[0]) {
if (firstPrice.length > 0) {
firstPrice[0].prepend(startingAt);
} else {
const unresolvedPrice = merchCard.querySelectorAll('[id*="price"]');
if (unresolvedPrice.length > 0) {
unresolvedPrice[0].prepend(startingAt);
}
}
});
}
Expand Down

0 comments on commit e7de2e2

Please sign in to comment.