Trying to create custom block type in orocommerce but I am getting: Could not load a block type "product_variants".
I have created block_types yml file in Resources/config/block_types.yml
services:
xngage_product.layout.block_type.product_variants:
parent: oro_layout.block_type.abstract_configurable_container
calls:
- [setOptionsConfig, [{variants: {required: true}}]]
- [setName, ['product_variants']]
tags:
- { name: layout.block_type, alias: product_variants }
xngage_product.layout.block_type_extension.product_variants:
class: Xngage\ProductBundle\Layout\Extension\ProductVariantsExtension
tags:
- { name: layout.block_type_extension, alias: product_variants }
and created layout for configure product in Resources/layouts/xngage_theme/oro_product_frontend_product_view/configure_product.yml
layout:
imports:
- oro_product_view
actions:
- '@setBlockTheme':
themes: 'configurable_product.html.twig'
- '@add':
id: product_variants
blockType: product_variants
parentId: product_specification_container
siblingId: product_specification
options:
variants: '=data["product_variants"].getVariants(data["product"])'
conditions: 'context["product_type"] == "simple"'
any missing steps please?
Make sure you registered
Resources/config/block_types.yml
at the container. example of registration can be found here https://github.com/orocommerce/orocommerce/blob/master/src/Oro/Bundle/CMSBundle/DependencyInjection/OroCMSExtension.php#L25