Skip to content

M2.1.2 Cannot rewrite Magento\ConfigurableProduct\Block\Product\View\Type\Configurable #7775

@kanduvisla

Description

@kanduvisla

This might have some similarities with #4400, but I cannot seem to rewrite Magento\ConfigurableProduct\Block\Product\View\Type\Configurable using di.xml

Preconditions

  1. Version 2.1.2

Steps to reproduce

  1. Create a di.xml with:
<preference for="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable"
            type="Vendor\Module\Rewrite\Magento\ConfigurableProduct\Block\Product\View\Type\Configurable"/>
  1. Create the class Vendor\Module\Rewrite\Magento\ConfigurableProduct\Block\Product\View\Type\Configurable:
class Configurable extends \Magento\ConfigurableProduct\Block\Product\View\Type\Configurable
{
    /**
     * Override the template.
     * @return string
     */
    protected function _toHtml()
    {
        die;
        return parent::_toHtml();
    }
}

Expected result

  1. It should die().

Actual result

  1. It does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions