-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable option renderer template override is not possible #4400
Comments
Override Magento\Swatches\Block\Product\Renderer\Configurable via plugin. Use method beforeSetTemplate. http://magento.stackexchange.com/questions/98636/update-const-template-at-magento-2-class |
Thank you for the updates, Yes, i already did that. Look at the below code written in xml, Below code is of no use. It should allow to override template using xml as template path is defined in xml. don't you think so ?
|
Correct, since the template filename is harcoded as a class property, it seems to override any xml update. I do think hardcoding that into core files is not the best practice, however, plugins certainly give the ability to modify that behavior with no major issues. This should be either well documented or removed because what if a front-end developer comes up with this issue ? his gonna have a hard time on this one. Overriding templates should be always possible via XML I agree with you. Good luck ! |
Thanks, Can we expect these changes in upcoming release ? |
Hello @mkastaneda I've got a similar problem in vendor\magento\module-catalog\view\adminhtml\layout\CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml where someone forgot to add the name for the block:- Can someone please add a name. |
Same issue can't override: catalog\view\adminhtml\layout\CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml Please fix this issue, it's super quick to fix and causes big problems. Now as a work around I have to write ugly overrides to have my changes. |
@YaguPatel, thank you for your report. |
@magento-engcom-team I reproduced the issue using CE edition version 2.1.10 you can't override the Why does this Magento module use hard coded template paths? |
Confirmed this is still an issue on Magento 2 CE 2.2.3 |
[Magento Community Engineering] Community Contributions - GraphQL
@magento-engcom-team How can I reopen this issue? The problem is still there in Magento Open Source 2.3.3. |
Still not fixed in 2.4.2. |
Still not fixed in 2.4.7-p1 |
Steps to reproduce
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
Above constant doesn't allow me to override template how should i do that ?
The text was updated successfully, but these errors were encountered: