Multiple products that use the identical Variant SKU

Wellsy
Visitor
3 0 0

I'm new to asking these sort of questions so I hope this all makes sense.

We have parts lists and sell parts on our Shopify Site some of which have up to 100 variants within a product, some of which these products have the same variants (example would be 2 different gearboxes but some parts a common), this leads to the same SKU being used multiple times even though they a stored as different SKU/Variants.

This becomes a problem for stock management amongst other things and only gets worse as my site grows.🙄😩

Is there a way holding of all SKU's (20,000 +) in Shopify then using metafields to call up specific SKU's as required to show within a Product as variants?

or is there another way of doing this entirely?

Thanks for your time 🙂

Replies 4 (4)

zaczee
Globetrotter
848 46 42

Hi,

 

Can you share your store URL ?

 

Brian_McKinley
Shopify Partner
15 0 6

Hi Wellsy,

There is a way.  Metafields would work, but it may be better to use a collection to hold the parts of the assembly. I suspect collections would be easier to maintain.


Steps:
-  Create a collection with the same name as the assembly product that contains the component products and the assembly product.  The assembly product should have 1 or no variants (see next step).

-  (Optional) Configure the component products option even though there is only one variant.  The option name should be the same for all products in the collection.  Adding the option will make the liquid code below simpler but it will impact how your theme displays the individual products, so there is a trade off.

 

- In your Theme code, locate where {product | json} is loaded to a script.

 

Output from your store to the page looks like this with the {{product | json}} output in bold:

<script
  type="application/json"
  data-section-type="static-product"
  data-section-id="template--16790864396531__main"
  data-section-data
>  {
    "settings": {
      "cart_redirection": false,
      "gallery_thumbnail_position": "below",
      "gallery_video_autoplay": true,
      "gallery_video_looping": true,
      "gallery_hover_zoom": "disabled",
      "gallery_click_to_zoom": "always",
      "money_format": "${{amount}}",
      "swatches_enable": false,
      "sold_out_options": "hidden",
      "select_first_available_variant": null
    },
    "context": {
      "select_variant": "Please select a variant",
      "product_available": "Add to cart",
      "product_sold_out": "Sold out",
      "product_unavailable": "Unavailable",
      "product_preorder": "Pre-order"
    },
    "product": {"id":7013780881564,"title":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2)","handle":"2011900455","description":"\u003ch3\u003e\u003cspan style=\"text-decoration: underline;\"\u003e\u003cem\u003eSelect the item Reference number required in the drop down box to view price, availability and order\u003c\/em\u003e\u003c\/span\u003e\u003c\/h3\u003e","published_at":"2022-03-27T11:08:33+11:00","created_at":"2021-09-08T20:30:29+10:00","vendor":"Silvan","type":"Silvan Parts","tags":["location_A.FLOOR","location_B.1.5.1","location_CAB 4.3.1","location_CAB 7.1.3","location_CAB 7.4.3","location_CAB 7.7.4","location_CAB 7.8.1","location_CAB 8.1.3","location_CAB.1.2.2","location_CAB.3.3.2","location_CAB.4.1.4","location_CAB.4.3.2","location_CAB.7.2.2","location_CAB.7.4.2","location_CAB.7.5.2","location_CAB.9.2"],"price":200,"price_min":200,"price_max":7200,"available":true,"price_varies":true,"compare_at_price":0,"compare_at_price_min":0,"compare_at_price_max":2000,"compare_at_price_varies":true,"variants":[{"id":40897070170268,"title":"1 - LID \u0026 GASKET TO SUIT REDLINE 25 55 \u0026 100","option1":"1 - LID \u0026 GASKET TO SUIT REDLINE 25 55 \u0026 100","option2":null,"option3":null,"sku":"382-042","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 1 - LID \u0026 GASKET TO SUIT REDLINE 25 55 \u0026 100","public_title":"1 - LID \u0026 GASKET TO SUIT REDLINE 25 55 \u0026 100","options":["1 - LID \u0026 GASKET TO SUIT REDLINE 25 55 \u0026 100"],"price":1300,"weight":300,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341424","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070203036,"title":"2 - PAKPUMP 12V 2.5L SUIT 25 \u0026 55L REDLINE","option1":"2 - PAKPUMP 12V 2.5L SUIT 25 \u0026 55L REDLINE","option2":null,"option3":null,"sku":"381-35","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 2 - PAKPUMP 12V 2.5L SUIT 25 \u0026 55L REDLINE","public_title":"2 - PAKPUMP 12V 2.5L SUIT 25 \u0026 55L REDLINE","options":["2 - PAKPUMP 12V 2.5L SUIT 25 \u0026 55L REDLINE"],"price":7200,"weight":700,"compare_at_price":0,"inventory_management":"shopify","barcode":"9337027038817","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070235804,"title":"3 - Elbow Swivel (Pair)","option1":"3 - Elbow Swivel (Pair)","option2":null,"option3":null,"sku":"382-065","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 3 - Elbow Swivel (Pair)","public_title":"3 - Elbow Swivel (Pair)","options":["3 - Elbow Swivel (Pair)"],"price":900,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9337027048977","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070268572,"title":"4 - SUCTION FILTER TO SUIT REDLINE","option1":"4 - SUCTION FILTER TO SUIT REDLINE","option2":null,"option3":null,"sku":"382-044","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 4 - SUCTION FILTER TO SUIT REDLINE","public_title":"4 - SUCTION FILTER TO SUIT REDLINE","options":["4 - SUCTION FILTER TO SUIT REDLINE"],"price":1000,"weight":100,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341448","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42589171319027,"title":"5 - Clip Set-2 Clips + 2 Screws","option1":"5 - Clip Set-2 Clips + 2 Screws","option2":null,"option3":null,"sku":"382-060","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 5 - Clip Set-2 Clips + 2 Screws","public_title":"5 - Clip Set-2 Clips + 2 Screws","options":["5 - Clip Set-2 Clips + 2 Screws"],"price":500,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000344043","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070334108,"title":"6 - GROMMET SUIT 25L REDLINE","option1":"6 - GROMMET SUIT 25L REDLINE","option2":null,"option3":null,"sku":"382-066","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 6 - GROMMET SUIT 25L REDLINE","public_title":"6 - GROMMET SUIT 25L REDLINE","options":["6 - GROMMET SUIT 25L REDLINE"],"price":200,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310100","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070366876,"title":"7 - SPRAYGUN ASSY REDLINE SUIT 25L 55L","option1":"7 - SPRAYGUN ASSY REDLINE SUIT 25L 55L","option2":null,"option3":null,"sku":"382-052","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 7 - SPRAYGUN ASSY REDLINE SUIT 25L 55L","public_title":"7 - SPRAYGUN ASSY REDLINE SUIT 25L 55L","options":["7 - SPRAYGUN ASSY REDLINE SUIT 25L 55L"],"price":1800,"weight":350,"compare_at_price":2000,"inventory_management":"shopify","barcode":"9337027038800","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070399644,"title":"8 - Cap Drain Bung suit Redline","option1":"8 - Cap Drain Bung suit Redline","option2":null,"option3":null,"sku":"382-050","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 8 - Cap Drain Bung suit Redline","public_title":"8 - Cap Drain Bung suit Redline","options":["8 - Cap Drain Bung suit Redline"],"price":300,"weight":50,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341509","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070432412,"title":"8A - GASKET RUBBER","option1":"8A - GASKET RUBBER","option2":null,"option3":null,"sku":"G40002","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 8A - GASKET RUBBER","public_title":"8A - GASKET RUBBER","options":["8A - GASKET RUBBER"],"price":300,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000194303","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070465180,"title":"9 - NLA. Round plug charger (Silvan no longer supply) No alternative.","option1":"9 - NLA. Round plug charger (Silvan no longer supply) No alternative.","option2":null,"option3":null,"sku":"382-068","requires_shipping":true,"taxable":true,"featured_image":null,"available":false,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 9 - NLA. Round plug charger (Silvan no longer supply) No alternative.","public_title":"9 - NLA. Round plug charger (Silvan no longer supply) No alternative.","options":["9 - NLA. Round plug charger (Silvan no longer supply) No alternative."],"price":3800,"weight":0,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310117","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070497948,"title":"10 - Spraygun Trigger (without Lance)","option1":"10 - Spraygun Trigger (without Lance)","option2":null,"option3":null,"sku":"382-051","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 10 - Spraygun Trigger (without Lance)","public_title":"10 - Spraygun Trigger (without Lance)","options":["10 - Spraygun Trigger (without Lance)"],"price":1200,"weight":140,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341516","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070530716,"title":"11 - ROCKER SWITCH","option1":"11 - ROCKER SWITCH","option2":null,"option3":null,"sku":"118-149","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 11 - ROCKER SWITCH","public_title":"11 - ROCKER SWITCH","options":["11 - ROCKER SWITCH"],"price":800,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602029408","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070563484,"title":"12 - HOSE NUT SUIT 25L REDLINE SPRAYGUN","option1":"12 - HOSE NUT SUIT 25L REDLINE SPRAYGUN","option2":null,"option3":null,"sku":"382-069","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 12 - HOSE NUT SUIT 25L REDLINE SPRAYGUN","public_title":"12 - HOSE NUT SUIT 25L REDLINE SPRAYGUN","options":["12 - HOSE NUT SUIT 25L REDLINE SPRAYGUN"],"price":200,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310070","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070596252,"title":"13 - HOSE FLARE - OLIVE","option1":"13 - HOSE FLARE - OLIVE","option2":null,"option3":null,"sku":"382-070","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 13 - HOSE FLARE - OLIVE","public_title":"13 - HOSE FLARE - OLIVE","options":["13 - HOSE FLARE - OLIVE"],"price":200,"weight":0,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310087","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070629020,"title":"14 - GASKET SUIT 25L REDLINE SPRAYGUN TO HOSE","option1":"14 - GASKET SUIT 25L REDLINE SPRAYGUN TO HOSE","option2":null,"option3":null,"sku":"382-071","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 14 - GASKET SUIT 25L REDLINE SPRAYGUN TO HOSE","public_title":"14 - GASKET SUIT 25L REDLINE SPRAYGUN TO HOSE","options":["14 - GASKET SUIT 25L REDLINE SPRAYGUN TO HOSE"],"price":200,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310094","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070661788,"title":"15 - Standard Spray hose 6m X 8mm","option1":"15 - Standard Spray hose 6m X 8mm","option2":null,"option3":null,"sku":"382-056","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 15 - Standard Spray hose 6m X 8mm","public_title":"15 - Standard Spray hose 6m X 8mm","options":["15 - Standard Spray hose 6m X 8mm"],"price":1400,"weight":400,"compare_at_price":0,"inventory_management":"shopify","barcode":"9337027042548","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070694556,"title":"16 - MEASURING JUG SUIT REDLINE","option1":"16 - MEASURING JUG SUIT REDLINE","option2":null,"option3":null,"sku":"382-045","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 16 - MEASURING JUG SUIT REDLINE","public_title":"16 - MEASURING JUG SUIT REDLINE","options":["16 - MEASURING JUG SUIT REDLINE"],"price":800,"weight":100,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341455","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070727324,"title":"17 - FUSE HOLDER SUIT 25L REDLINE","option1":"17 - FUSE HOLDER SUIT 25L REDLINE","option2":null,"option3":null,"sku":"382-067","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 17 - FUSE HOLDER SUIT 25L REDLINE","public_title":"17 - FUSE HOLDER SUIT 25L REDLINE","options":["17 - FUSE HOLDER SUIT 25L REDLINE"],"price":900,"weight":1000,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602310117","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070792860,"title":"19 - BATTERY 12V 3.2Ah SUIT SP25-B","option1":"19 - BATTERY 12V 3.2Ah SUIT SP25-B","option2":null,"option3":null,"sku":"BAT5","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 19 - BATTERY 12V 3.2Ah SUIT SP25-B","public_title":"19 - BATTERY 12V 3.2Ah SUIT SP25-B","options":["19 - BATTERY 12V 3.2Ah SUIT SP25-B"],"price":3500,"weight":1350,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602312784","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070825628,"title":"20 - CHARGER SQUARE PLUG SP25TR2 SP25B 2016 ONWARDS","option1":"20 - CHARGER SQUARE PLUG SP25TR2 SP25B 2016 ONWARDS","option2":null,"option3":null,"sku":"382-068B","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 20 - CHARGER SQUARE PLUG SP25TR2 SP25B 2016 ONWARDS","public_title":"20 - CHARGER SQUARE PLUG SP25TR2 SP25B 2016 ONWARDS","options":["20 - CHARGER SQUARE PLUG SP25TR2 SP25B 2016 ONWARDS"],"price":3600,"weight":300,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602320819","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070858396,"title":"21 - Switch \u0026  Bracket assy","option1":"21 - Switch \u0026  Bracket assy","option2":null,"option3":null,"sku":"382-130","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 21 - Switch \u0026  Bracket assy","public_title":"21 - Switch \u0026  Bracket assy","options":["21 - Switch \u0026  Bracket assy"],"price":1400,"weight":400,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602346376","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070891164,"title":"22 - CAP SCRW M5x20 SKT HD ZP","option1":"22 - CAP SCRW M5x20 SKT HD ZP","option2":null,"option3":null,"sku":"SM5L20SHCS","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 22 - CAP SCRW M5x20 SKT HD ZP","public_title":"22 - CAP SCRW M5x20 SKT HD ZP","options":["22 - CAP SCRW M5x20 SKT HD ZP"],"price":200,"weight":10,"compare_at_price":0,"inventory_management":"shopify","barcode":"9327602194298","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070923932,"title":"23 - HOSE CLAMP SUIT 8MM HOSE","option1":"23 - HOSE CLAMP SUIT 8MM HOSE","option2":null,"option3":null,"sku":"187-MH04","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 23 - HOSE CLAMP SUIT 8MM HOSE","public_title":"23 - HOSE CLAMP SUIT 8MM HOSE","options":["23 - HOSE CLAMP SUIT 8MM HOSE"],"price":200,"weight":10,"compare_at_price":200,"inventory_management":"shopify","barcode":"9327602014862","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":40897070956700,"title":"24 - POWER LOOM 3M SUIT REDLINE","option1":"24 - POWER LOOM 3M SUIT REDLINE","option2":null,"option3":null,"sku":"382-049","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Silvan Selecta 25L REDLINE Spare Parts (SP25-R1 - SP25-B - SP25-TR2) - 24 - POWER LOOM 3M SUIT REDLINE","public_title":"24 - POWER LOOM 3M SUIT REDLINE","options":["24 - POWER LOOM 3M SUIT REDLINE"],"price":2200,"weight":300,"compare_at_price":0,"inventory_management":"shopify","barcode":"0000000341493","requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/www.theco-op.com.au\/cdn\/shop\/products\/silvan-silvan-parts-silvan-selecta-25l-redline-spare-parts-sp25-r1-sp25-b-sp25-tr2-31400603877532.jpg?v=1658708295"],"featured_image":"\/\/www.theco-op.com.au\/cdn\/shop\/products\/silvan-silvan-parts-silvan-selecta-25l-redline-spare-parts-sp25-r1-sp25-b-sp25-tr2-31400603877532.jpg?v=1658708295","options":["Ref #"],"media":[{"alt":"Silvan Redline part drawing","id":24307597967516,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/www.theco-op.com.au\/cdn\/shop\/products\/silvan-silvan-parts-silvan-selecta-25l-redline-spare-parts-sp25-r1-sp25-b-sp25-tr2-31400603877532.jpg?v=1658708295"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/www.theco-op.com.au\/cdn\/shop\/products\/silvan-silvan-parts-silvan-selecta-25l-redline-spare-parts-sp25-r1-sp25-b-sp25-tr2-31400603877532.jpg?v=1658708295","width":1000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003ch3\u003e\u003cspan style=\"text-decoration: underline;\"\u003e\u003cem\u003eSelect the item Reference number required in the drop down box to view price, availability and order\u003c\/em\u003e\u003c\/span\u003e\u003c\/h3\u003e"}
  }</script>

- Above where {{product | json}} is assigned, write code to loop through the collections for the product and find the one with matching name.

{% assign product_collections = product.collections %}
{% assign matched_collection = nil %}

{% for collection in product_collections %}
  {% if collection.title == 'Summer Collection' %}
    {% assign matched_collection = collection %}
    {% break %}
  {% endif %}
{% endfor %}

{% if matched_collection != nil %}
  <!-- Code to work with the matched collection -->
  {{ matched_collection.title }} - Found!
{% else %}
  <!-- Code when no matching collection is found -->
  No matching collection found.
{% endif %}

- If a matching collection is found, loop through the collecction products and add them to a  variable:

{% assign variants = product.variants %}
{% for p in matched_collection.products %} {% if p.id != product.id and p.available %} {% assign variants = variants | concat: p.variants %} {% endif %} {% endfor %}

 

- In this code path, replace {{product | json}} by build the product from its top level attributes and overriding the variants:

 

{"id":{{product.id | json}},"title":{{product.title | json}}, "handle":{{product.handle | json}}, 
  "description":{{product.description | json}}, "published_at":{{product.published_at | json}},
  "created_at":{{product.created_at | json }}, "vendor":{{product.vendor | json}}, "type":{{product.type | json}},
  "tags":{{product.tags | json}}, "price":{{product.price | json}},"price_min":{{product.price_min | json}}, 
  "price_max":{{product.price_max | json}}, "available":{{product.available | json}}, "price_varies":{{product.price_varies | json}},
  "compare_at_price":{{product.compare_at_price | json}},"compare_at_price_min":{{product.compare_at_price_min | json}}, 
  "compare_at_price_max":{{product.compare_at_price_max | json}}, "compare_at_price_varies":{{product.compare_at_price_varies | json}},
  "variants":[ 
          {% for variant in variants %}
{{variant | json}}{% unless forloop.last == true %},{%endunless%}
          {% endfor %}
  ], 
  "images": {{product.images | json}}
], "featured_image": {{product.featured_image | json}}, "options":{{product.options | json}},
  "content":{{product.comntent | json}}
}

Check the top level variants.  I believe more have been added since I wrote this that may be used in newer themes.

 

If you decide not to add an option to the products then you will need to figure out how to handle that.  To make it work in liquid, the options attribute on the product would need to be replaced.   It may also be necessary to update the variants which would mean building the variants from their top level attributes as we did for the product.

 

If you have assemblies with more than 100 parts (A long list without additional options to categorize), this will  get you past the 100 variant limit.

 

Hopefully no additional change is required in your Theme.

 

-Brian

 

Wellsy
Visitor
3 0 0

Hi Brian, Thanks for your reply and effort, from what I understand this will group the related products into the collection as needed to make p the whole product, if I am understanding what you're suggesting, I may still have the issue of linking these to a specific reference number on the exploded product image?