I an getting the “Invalid value for type in block ‘product_video’. Type must be defined in schema” error when I try to save my product.json file. Below I will first provide a the product.json code and the product-video.liquid file. Ihave been working with this for the last hour and I an at a total loss. Your help would be greatly appreciated.
product.json
{
"sections": {
"main": {
"type": "main-product",
"blocks": {
"product_meta": {
"type": "product_meta",
"settings": {}
},
"variant_selector": {
"type": "variant_selector",
"settings": {}
},
"buy_buttons": {
"type": "buy_buttons",
"settings": {}
},
"description": {
"type": "description",
"settings": {}
},
"product_video": {
"type": "product_video",
"settings": {}
}
},
"block_order": [
"product_meta",
"variant_selector",
"buy_buttons",
"description",
"product_video"
],
"settings": {}
},
"product-recommendations": {
"type": "product-recommendations",
"settings": {}
},
"recently-viewed-products": {
"type": "recently-viewed-products",
"settings": {}
}
},
"order": [
"main",
"product-recommendations",
"recently-viewed-products"
]
}
product_video.liquid file
{% if product.metafields.custom.videos %}
<div class="product-videos">
<h3>Product Videos</h3>
<div class="videos-container">
{% assign videos = product.metafields.custom.videos | split: ',' %}
{% for video in videos %}
<div class="video-wrapper">
<iframe width="560" height="315"
src="{{ video | remove: 'https://youtu.be/' | prepend: 'https://www.youtube.com/embed/' }}"
frameborder="0"
allowfullscreen>
</iframe>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% schema %}
{
"name": "Product Video",
"settings": [],
"presets": [
{
"name": "Default",
"category": "Custom"
}
]
}
{% endschema