Fix modifiers not showing in app - CategoryID filter excluded them

Modifiers are saved with CategoryID=0 and ParentItemID pointing to their
parent item. The query was filtering by CategoryID IN (visible categories)
which excluded all modifiers.

Changed to: (CategoryID IN (visible) OR (CategoryID=0 AND ParentItemID>0))

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-08 11:57:05 -08:00
parent 3d59a2e5cd
commit 9ea3ec87f7

View file

@ -203,7 +203,7 @@
LEFT JOIN Stations s ON s.ID = i.StationID
WHERE i.BusinessID = :bizId
AND i.IsActive = 1
AND i.CategoryID IN (#visibleCategoryIds#)
AND (i.CategoryID IN (#visibleCategoryIds#) OR (i.CategoryID = 0 AND i.ParentItemID > 0))
AND NOT EXISTS (SELECT 1 FROM lt_ItemID_TemplateItemID tl WHERE tl.TemplateItemID = i.ID)
AND NOT EXISTS (SELECT 1 FROM lt_ItemID_TemplateItemID tl2 WHERE tl2.TemplateItemID = i.ParentItemID)
AND NOT (i.ParentItemID = 0 AND i.CategoryID = 0 AND i.Price = 0)
@ -529,13 +529,14 @@
</cfloop>
</cfif>
<!--- Get brand color, tax rate, and header image for this business --->
<!--- Get brand color, tax rate, payfrit fee, and header image for this business --->
<cfset brandColor = "">
<cfset businessTaxRate = 0>
<cfset businessPayfritFee = 0.065>
<cfset headerImageUrl = "">
<cftry>
<cfset qBrand = queryTimed(
"SELECT BrandColor AS BusinessBrandColor, TaxRate, HeaderImageExtension FROM Businesses WHERE ID = ?",
"SELECT BrandColor AS BusinessBrandColor, TaxRate, PayfritFee, HeaderImageExtension FROM Businesses WHERE ID = ?",
[ { value = BusinessID, cfsqltype = "cf_sql_integer" } ],
{ datasource = "payfrit" }
)>
@ -546,6 +547,9 @@
<cfif isNumeric(qBrand.TaxRate)>
<cfset businessTaxRate = qBrand.TaxRate>
</cfif>
<cfif isNumeric(qBrand.PayfritFee)>
<cfset businessPayfritFee = qBrand.PayfritFee>
</cfif>
<cfif len(trim(qBrand.HeaderImageExtension))>
<cfset headerImageUrl = "/uploads/headers/#BusinessID#.#qBrand.HeaderImageExtension#">
</cfif>
@ -564,6 +568,7 @@
"BRANDCOLOR": brandColor,
"HEADERIMAGEURL": headerImageUrl,
"TAXRATE": val(businessTaxRate),
"PAYFRITFEE": val(businessPayfritFee),
"Menus": menuList,
"SelectedMenuID": requestedMenuID
})>