bep40 commited on
Commit
3e99441
·
verified ·
1 Parent(s): c33b012

Fix: Add Thêm giỏ button to fallback AI search results

Browse files
Files changed (1) hide show
  1. index.html +4 -1
index.html CHANGED
@@ -2628,7 +2628,10 @@ function _fallbackAISearch(query, container) {
2628
  }
2629
  if (!results.length) { container.innerHTML = '❌ Khong tim thay. Thử: "bep tu", "may hut mui"'; return; }
2630
  container.innerHTML = '<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px">' +
2631
- results.map(function(p) { var idx = window.D.indexOf(p); return '<div class="pc" onclick="showDetail(' + idx + ')" style="cursor:pointer"><div class="pi" style="height:150px"><img src="' + p.image + '" alt="' + p.name + '"></div><div class="pb"><div class="pn">' + p.name + '</div><div class="pp">' + (p.price || '') + '</div></div></div>'; }).join('') + '</div>';
 
 
 
2632
  }
2633
 
2634
  /**
 
2628
  }
2629
  if (!results.length) { container.innerHTML = '❌ Khong tim thay. Thử: "bep tu", "may hut mui"'; return; }
2630
  container.innerHTML = '<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px">' +
2631
+ results.map(function(p) { var idx = window.D.indexOf(p); return '<div style="position:relative" onclick="showDetail(' + idx + ')">' +
2632
+ '<div class="pc" style="cursor:pointer"><div class="pi" style="height:150px"><img src="' + p.image + '" alt="' + p.name + '"></div>' +
2633
+ '<div class="pb"><div class="pn">' + p.name + '</div><div class="pp">' + (p.price || '') + '</div></div></div>' +
2634
+ '<button onclick="event.stopPropagation();addToCart(' + idx + ');" style="position:absolute;top:8px;left:8px;background:var(--a);color:#fff;border:none;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.7rem;z-index:2"><i class="fas fa-cart-plus"></i></button></div>'; }).join('') + '</div>';
2635
  }
2636
 
2637
  /**