0

I have tried below way to override configurable.phtml file

  1. /app/code/Vendor/Extension/view/frontend/layout/catalog_product_view_type_configurable.xml

https://i.imgur.com/gpII3Ct.png

But it did not override if I change constant value on below file path it's work for me.

/vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php

On this file apply changes const CONFIGURABLE_RENDERER_TEMPLATE = 'Magento_ConfigurableProduct::product/view/type/options/configurable.phtml'; to const CONFIGURABLE_RENDERER_TEMPLATE = 'Vendor_Extension::product/view/type/options/configurable.phtml';

So, override phtml file I also create preferences this file for change constant value but it also not work for me.

So How to override this ?

1 Answer 1

0

Try to override SetTemplate or toHtml function using plugin or alternative is to override getRendererTemplate function using preferences. From below file

/vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.