bep40 commited on
Commit
dbc396f
·
verified ·
1 Parent(s): 71f4880

Fix 6: Add cart button to search result cards

Browse files
Files changed (1) hide show
  1. index.html +1 -0
index.html CHANGED
@@ -2812,6 +2812,7 @@ function doAISearch(){
2812
  h+='<div style="font-size:.88rem;font-weight:800;color:#003f62;margin-top:4px">'+(p.price||'Liên hệ')+'</div>';
2813
  const specs=p.specs||{};const sk=Object.entries(specs).slice(0,3);
2814
  if(sk.length){h+='<div style="margin-top:4px;padding-top:4px;border-top:1px solid #eee;font-size:.58rem;color:#555">';sk.forEach(([k,v])=>{h+='<div>'+k+': <b>'+v+'</b></div>'});h+='</div>'}
 
2815
  h+='</div>';
2816
  });
2817
  h+='</div>';
 
2812
  h+='<div style="font-size:.88rem;font-weight:800;color:#003f62;margin-top:4px">'+(p.price||'Liên hệ')+'</div>';
2813
  const specs=p.specs||{};const sk=Object.entries(specs).slice(0,3);
2814
  if(sk.length){h+='<div style="margin-top:4px;padding-top:4px;border-top:1px solid #eee;font-size:.58rem;color:#555">';sk.forEach(([k,v])=>{h+='<div>'+k+': <b>'+v+'</b></div>'});h+='</div>'}
2815
+ h+='<button onclick="event.stopPropagation();addToCart('+D.indexOf(p)+')" style="margin-top:5px;width:100%;padding:5px 0;background:#003f62;color:#fff;border:none;border-radius:5px;font-size:.68rem;cursor:pointer;font-weight:600">\u{1F6D2} Th\u00eam gi\u1ECF</button>';
2816
  h+='</div>';
2817
  });
2818
  h+='</div>';