0

I have created a plugin to set bundle product renderer in custom module but i am getting blank array why ?

public function aroundGetOptionHtml(
        \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle $subject,
        \Closure $proceed,
        \Magento\Bundle\Model\Option $option
    ) {
        $renderersMap = (array)$subject->getData('renderers');
        if (isset($renderersMap[$option->getType()])) {
            $rendererBlockName = $renderersMap[$option->getType()];
            $renderer = $this->getChildBlock($rendererBlockName);
            if ($renderer) {
                return $renderer->setOption($option)->toHtml();
            }
        return $proceed($option);
        }
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.