feat: 챗봇 관련 제품에 재고 표시 추가

This commit is contained in:
thug0bin
2026-02-28 12:04:44 +09:00
parent 21e07bcca9
commit 180393700b
2 changed files with 5 additions and 2 deletions

View File

@@ -989,7 +989,9 @@
// 텍스트
const textDiv = document.createElement('div');
textDiv.innerHTML = `<div style="font-size:13px;font-weight:500;color:#334155;">${p.name}</div><div style="font-size:12px;color:#10b981;">${formatPrice(p.price)}</div>`;
const stockColor = (p.stock > 0) ? '#10b981' : '#ef4444';
const stockText = (p.stock > 0) ? `재고 ${p.stock}` : '품절';
textDiv.innerHTML = `<div style="font-size:13px;font-weight:500;color:#334155;">${p.name}</div><div style="font-size:12px;"><span style="color:#10b981;">${formatPrice(p.price)}</span> <span style="color:${stockColor};margin-left:6px;">${stockText}</span></div>`;
card.appendChild(imgContainer);
card.appendChild(textDiv);