We are trying to implement code using BISAC code
https://gist.github.com/natebeaty/c581c1f9bfb9eb2c9852101a2ecc1c54
A user is attempting to implement BISAC (Book Industry Standards and Communications) codes in their Shopify store to categorize products based on metafield values. They plan to handle approximately 4,000 categories using conditional logic that maps BISAC codes to human-readable category names.
Technical Approach:
{% assign %} and {% if/elsif %} statementsKey Challenge:
Shopify has file size limitations (256kb for templates, 64kb for snippets), which may be problematic given the large number of categories.
Implementation Steps Discussed:
{% render 'BISAC-value' %}Current Status:
The user successfully created the snippet but needed clarification on how to properly render and display it on product pages. The helper advised adding the render tag directly rather than assigning it to a variable.
We are trying to implement code using BISAC code
https://gist.github.com/natebeaty/c581c1f9bfb9eb2c9852101a2ecc1c54
You can’t. 256kb for templates, 64kb for snippets. Break up your template in to multiple snippets for instance.
{% assign BISAC_value = product.metafields.Neato.BISAC %}
{% if BISAC_value == "BIO000000" %}
{% assign category = "Biography & Autobiography / General" %}
{% elsif BISAC_value == "BIO023000" %}
{% assign category = "Biography & Autobiography / Adventurers & Explorers" %}
{% elsif BISAC_value == "BIO002010" %}
{% assign category = "Biography & Autobiography / African American & Black" %}
{% elsif BISAC_value == "BIO002040" %}
{% assign category = "Biography & Autobiography / Arab & Middle Eastern" %}
{% elsif BISAC_value == "BIO001000" %}
{% assign category = "Biography & Autobiography / Artists, Architects, Photographers" %}
{% elsif BISAC_value == "BIO002020" %}
{% assign category = "Biography & Autobiography / Asian & Asian American" %}
{% elsif BISAC_value == "BIO034000" %}
{% else %}
{% assign category = "Other" %}
{% endif %}
How we can createsnippets for this using in main product liquid. @Raj-webdesigner
Help you add snippets to this site
https://www.shopify.com/in/partners/blog/88186566-tips-for-using-snippets-in-your-shopify-theme
This site helps to add and show snippets in your destination
And if you don’t understand in this site or not I will help you for guidance
Hi, I added this code to snippet
so how can I show this again using a snippet in the product page {% render ‘BISAC-value’ %}
website: https://060ef5-5.myshopify.com/
Okay, add this code below your snippet.
{% render 'BISAC-value' %}
hey @Raj-webdesigner just one question
how to assign variable to {% render ‘error-value’ %}
example
a = {% render ‘error-value’ %}
a= Category: Other
then show { % render ‘error2-value’ %}
Since this code is not a variable,
don’t write it like a={%render ‘…’ %},
add it directly.
You wrote your previous code. Write this code like this