Closed
Description
Steps to reproduce
- Have Created custom module to override Magento_ConfigurableProduct::product/view/type/options/configurable.phtml using module.
2.Llayout code in catalog_product_view_type_configurable.xml
<referenceBlock name="product.info.options.configurable"> <action method="setTemplate"> <argument name='template' xsi:type="string">Namespace_ModuleName::product/view/type/options/configurable.phtml</argument> </action> </referenceBlock>
3 After lot of struggling i was not able to override template file because of below code in
Magento\Swatches\Block\Product\Renderer\Configurable
class Configurable extends \Magento\ConfigurableProduct\Block\Product\View\Type\Configurable
{
/**
* Path to template file with Swatch renderer.
*/
const SWATCH_RENDERER_TEMPLATE = "Magento_Swatches::product/view/renderer.phtml";
/**
* Path to default template file with standard Configurable renderer.
*/
const CONFIGURABLE_RENDERER_TEMPLATE = "Magento_ConfigurableProduct::product/view/type/options/configurable.phtml";
/**
* @codeCoverageIgnore
* @return string
*/
protected function getRendererTemplate()
{
return $this->isProductHasSwatchAttribute ?
self::SWATCH_RENDERER_TEMPLATE : self::CONFIGURABLE_RENDERER_TEMPLATE;
}
Above constant doesn't allow me to override template how should i do that ?