@@ -78,10 +78,10 @@ document.addEventListener('DOMContentLoaded', () => {
7878 reviews . forEach ( ( el ) => observer . observe ( el ) ) ;
7979} ) ;
8080
81- // Function for the endless cycle in Home Page
82- function renderNewProducts ( ) {
81+ // -------------------------------------- Function for the endless cycle in Home Page ----------------------------------------------------------
82+ function renderNewProducts ( ) {
8383 const scrollContainer = document . querySelector ( '.bago_card_box' ) ;
84- if ( ! scrollContainer ) return ;
84+ if ( ! scrollContainer ) return ;
8585
8686 const newProducts = Object . entries ( productData ) . filter ( ( [ id , product ] ) => {
8787 return product . new === true ;
@@ -110,7 +110,7 @@ function renderNewProducts() {
110110// Run the function when the page loads
111111document . addEventListener ( 'DOMContentLoaded' , renderNewProducts ) ;
112112
113- // ─── Baked Goods Page Renderer ────────────────────────────────────────────────
113+ // ------------------------------------------ Baked Goods Page Renderer -------------------------------------------------------------
114114// Reads productData and builds all sections in bakedGoods.html automatically.
115115// To add/remove a product, just update products.js — no HTML changes needed.
116116
@@ -119,11 +119,10 @@ function renderBakedGoods(){
119119 if ( ! container ) return ; // Only runs on bakedGoods.html
120120
121121 // --- Section definitions: order on the page + display titles ---
122- // ongoingSubtitle: optional label shown above the active products in that section
123122 const sections = [
123+ { category : '_holiday-specials' , title : 'Holiday Specials' , ongoingSubtitle : null } ,
124124 { category : '_sourdough' , title : 'Sourdough Breads' , ongoingSubtitle : null } ,
125125 { category : '_other-treats' , title : 'Our Other Treats' , ongoingSubtitle : null } ,
126- { category : '_holiday-specials' , title : 'Holiday Specials' , ongoingSubtitle : null } ,
127126 { category : '_cookie' , title : 'Cookies' , ongoingSubtitle : "Cookies of the Month" } ,
128127 ] ;
129128
@@ -137,17 +136,17 @@ function renderBakedGoods(){
137136
138137 if ( sectionProducts . length === 0 ) return ; // Skip empty sections
139138
140- // Separate ongoing (purchasable) from archived (display-only)
139+ // Separate ongoing (purchasable) from seasoned (display-only)
141140 const ongoing = sectionProducts . filter ( ( [ , p ] ) => p . ongoing ) ;
142- const archived = sectionProducts . filter ( ( [ , p ] ) => ! p . ongoing ) ;
141+ const seasoned = sectionProducts . filter ( ( [ , p ] ) => ! p . ongoing ) ;
143142
144143 // For holiday specials, only show the section if there are active items
145144 if ( section . category === '_holiday-specials' && ongoing . length === 0 ) return ;
146145
147146 // Helper: build a single <li> card
148147 function buildCard ( id , product ) {
149148 const isOngoing = product . ongoing ;
150- const multipleChoices = ! ! ( product . sizes || product . toppings ) ;
149+ const multipleChoices = ! ! ( product . sizes || product . toppings ) ; // Checks to see if the product has either of the variables
151150
152151 let priceHTML = '' ;
153152 if ( isOngoing ) {
@@ -185,21 +184,21 @@ function renderBakedGoods(){
185184 </li>` ;
186185 }
187186
188- // Optional subtitle above the ongoing products
187+ // Subtitle above the ongoing products
189188 const ongoingSubtitleHTML = section . ongoingSubtitle
190189 ? `<h4 class="container_sub_title">${ section . ongoingSubtitle } </h4>`
191190 : '' ;
192191
193192 const ongoingCardsHTML = ongoing . map ( ( [ id , p ] ) => buildCard ( id , p ) ) . join ( '' ) ;
194193
195- // Archived / past flavors block
196- let archivedHTML = '' ;
197- if ( archived . length > 0 ) {
198- const archivedCards = archived . map ( ( [ id , p ] ) => buildCard ( id , p ) ) . join ( '' ) ;
199- archivedHTML = `
194+ // Past flavors block
195+ let seasonedHTML = '' ;
196+ if ( seasoned . length > 0 && ! ( section . category === '_holiday-specials' ) ) {
197+ const seasonedCards = seasoned . map ( ( [ id , p ] ) => buildCard ( id , p ) ) . join ( '' ) ;
198+ seasonedHTML = `
200199 <div class="section_divider"><hr></div>
201200 <h4 class="container_sub_title cookies_title_pf">Past Flavors</h4>
202- <ul class="card_content">${ archivedCards } </ul>` ;
201+ <ul class="card_content">${ seasonedCards } </ul>` ;
203202 }
204203
205204 // Divider between sections — only if something has already been rendered
@@ -213,7 +212,7 @@ function renderBakedGoods(){
213212 <h3 class="container_title">${ section . title } </h3>
214213 ${ ongoingSubtitleHTML }
215214 <ul class="card_content">${ ongoingCardsHTML } </ul>
216- ${ archivedHTML }
215+ ${ seasonedHTML }
217216 </div>` ;
218217 } ) ;
219218
0 commit comments