• Resolved themugician

    (@themugician)


    It looks like the WooCommerce Cart Totals block or other WooCommerce blocks restrict the type of inner blocks you can place in them

    I tried using a block filter to allow specific blocks but it won’t let me place them

    Is there a way to override this?

    const ALLOWED_BLOCKS = ['core/paragraph', 'stl/image-box']

    addFilter(
    'blocks.registerBlockType',
    'my-plugin/extend-cart-totals-block',
    (settings, name) => {
    console.log(name)
    if (name === 'woocommerce/cart-totals-block') {
    settings.edit = (props) => {
    return (
    <Fragment>
    <InnerBlocks allowedBlocks={ALLOWED_BLOCKS} />
    </Fragment>
    )
    }
    }
    return settings
    }
    )
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.