A Shopify store uses custom code to group product variants by SKU prefix, displaying color swatches on product pages. The system works for some products (like the Bobarca Polo) but fails for others (like the Pelle Strik).
Root cause identified:
The code only loads 3 batches of products (750 total) despite the store having 2,092 products
window.allPageCount is incorrectly set to 3 instead of 9
Products like Pelle (SKU: 2502-04002) appear on page 7 of product data, beyond the loaded range
Technical details:
Code matches products by SKU prefix (e.g., “2502-03001” groups all Bobarca variants)
The issue likely exists in the theme’s Liquid code (layouts/theme.liquid)
Either the page count calculation is wrong, or it’s a hardcoded value from when fewer products existed
Additional challenges noted:
Inconsistent color naming across products
Multiple product page templates in use
The original developer is no longer available
The user needs to either fix the allPageCount variable or reduce active products below 750. One responder offered to examine the code directly via DM.
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
We have a customized code setup, where all products are created seperatly and then “coded” together through the SKU, so that the different colors for one product shows on the site.
But for some reason it won’t show on all products, even though the setup is the same. I haven’t made the code, so I’m not sure where to troubleshoot. Can someone help?
Hi @MichelleBerthou ,
First, compare SKUs, metafields, tags, and product options between a working product (like Bobarca Polo) and the failing Pelle Strik.
Look for the common identifier the code is supposed to use.
Once you find the mismatch (extra space in SKU, missing tag, inconsistent metafield), fix that in Shopify Admin.
Best
Anmol
Looks like there’s just a lot of different colors, it would take a very long time to sort all that out. Light brown, dark brown, beige, camel, sand, brown, cream, light blue, tan, kit, latte, light grey, dark grey, grey, navy, acru, black, brown/black, bordeaux, bordeaux/white, white, burgundy. There’s probably more I’m just tired of typing. Plus, same color is actually completely different shade, example: bs Lorena skirt grey VS bs isidora regular fit knitwear grey.
A lot of work ahead of you matching colors, tags, swatches, and metafields. And it looks like your product pages are in different templates altogether, where one product page has size buttons and another product page has drop-down. It’s really not necessary to have 4 pop-ups, though… I don’t even like 1, let alone several.
The code matches on SKU.
Say, Bobarca has SKU 2502-03001-700_S, so code looks for other products which has 2502-03001 in their SKU.
For Pelle, SKU is 2502-04002-408_S and code looks for products with sku starting with 2502-04002 and there seem to be no such products.
It’s also possible that code did not load all product data – it loads 750 products, does it seem right?
Ah, actually, looks like something is wrong with code.
I see
But code loads products in batches of 250 – and it only loads 3 batches, that’s why it loads only 750 products.
It’s necessary to understand why window.allPageCount is set to 3 while it should be 9…
This is in your Liquid code, which is not visible from outside, I believe somewhere in layouts/theme.liquid…
If that number is calculated, then calculation should be off, it it’s a constant, then it probably was set when you had less than 750 products.
Ah okay, I didn’t know that it was set to a certain number of products. Do you know if that is changeable? Or should I maybe deactivate products instead? Because all the Pelle products are set with 2502-04002 without any changes or spacing.
Actually, tried to fetch these product data pages manually and Pelle SKU was found on the 7th page – so this is the reason why it’s not working with only 3 first pages fetched…