A developer is building a motorcycle parts store with dynamic product filtering based on motorcycle ID. They’re fetching compatible products from a custom backend and attempting to display them using Shopify’s existing product card snippet.
Initial Problem:
Tried using Section Rendering API but received 404 errors
Attempted to pass product IDs as parameters to a custom section
Solution Provided:
Section Rendering API doesn’t accept custom parameters
Instead, create an alternate product template (product.card.liquid) with {% layout none %} tag
Fetch products using /products/{handle}?view=card endpoint
The layout tag prevents rendering headers, footers, and other sections
Resolution:
Issue was a filename typo: used product-card.liquid instead of product.card.liquid
The .card suffix (not hyphen) is required for Shopify to recognize the alternate template and respond to the ?view=card parameter
Solution is now working; developer plans to share the live URL when deployed
Summarized with AI on November 9.
AI used: claude-sonnet-4-5-20250929.
I created a custom page page.motorcycle.liquid that takes the motorId from the URL and sends a request to my own backend in order to find the products that are compatible with that motorId. Then I use the fetch API to get the shopify products based on the handles of the products and I want to render them using the already existent card-product.liquid snippet.
I tried to display the products using the Section Rendering API, but i failed:
The error I get is 404 when I try to fetch the section html.
I would appreciate some help regarding what I am doing wrong about that section. Or if I should approach rendering the products in another way?
Seems to be working. Can you also help me how to figure how to get the ?view=card parameter to work?
Now it just returns the whole product page with header, footer and other sections. The ?view=card does not seem to make a difference. I tried to edit the product.json file from templates, but no luck. I want the /product/handle URL to work normally, but when the parameter ?view=card is added it should render a minimal product template (card-product.liquid).
You’re getting the whole product page because your alternate template is not recognised.
In this case Shopify falls back to the default one.
I can’t really say what’s wrong in your setup, but to make ?view=card work you need to have an alternate product page template with suffix card, as I’ve suggested above. Here it’s just much simpler to have it as a .liquid template rather then create a json template, then create a section, etc…
And the layout tag should take care of headers, footers and other stuff we do not need here.
Thank you again for the response.
I had a typo in the template file name: I wrote product-card.liquid instead of product.card.liquid. I did not realize it actually parses the file name in order to get the card suffix.