Fix sold-out detection: use stitekDoporucujeme HTML element, not db_neaktivita

db_neaktivita is always null; sold-out is indicated by a visible
'Vyprodáno' label rendered inside the product image wrapper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
František Musil
2026-05-12 14:20:27 +02:00
parent dad182fe12
commit 80c4f6111c
+2 -1
View File
@@ -52,13 +52,14 @@ export function parseMenu(html: string): ParsedMenu {
if (!raw) return if (!raw) return
const data = parseDataAttr(raw) const data = parseDataAttr(raw)
const soldOut = $(el).find(".stitekDoporucujeme").text().trim() === "Vyprodáno"
const item: MenuItem = { const item: MenuItem = {
id: data.db_id ?? "", id: data.db_id ?? "",
code: data.db_kod ?? "", code: data.db_kod ?? "",
name: data.db_nazev ?? "", name: data.db_nazev ?? "",
description: data.db_popisek ?? "", description: data.db_popisek ?? "",
price: parseInt(data.db_cena ?? "0", 10), price: parseInt(data.db_cena ?? "0", 10),
inactive: data.db_neaktivita !== null && (data.db_neaktivita ?? "").trim() !== "", inactive: soldOut,
} }
if ((data.db_kod ?? "").startsWith("POL")) { if ((data.db_kod ?? "").startsWith("POL")) {