Closed Eddcapone closed 3 years ago
Hi @Eddcapone. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Add mixin for Amasty_Checkout/js/view/checkout/summary/item/details
and place you custom js in module
YourBrand_CustomAmastyCheckout/js/view/checkout/summary/item/details-mixin
. In side your custom component create previously then you need re-define you template
When checkout custom wrap all customize in module will make you easier to maintain later
This problem may suitable for magento stackexchange than git for purpose report bug. In my opinion this may not a bug
@mrtuvn ok thanks, but are you sure that this is not a bug? You can override templates by placing them in your own theme. I also managed to do this with .phtml and .html but in this case it just does not work. Maybe because the template is hardcoded into the .js view model file? You can't even override it from a layout file. This looks like a bug to me. It should get programmed properly, so that you can override it from a layout file at least.
I'm not sure maybe template process by jsLayout will different than normal template block (phtml) with fallback mechanism. Need to recheck
Second approach you can try override html by requirejs-config.js in custom theme to replacehtml
use map directive 'Amasty_Checkout/checkout/summary/item/details': 'Amasty_Checkout/checkout/summary/item/details-custom'
Amasty_Checkout/checkout/summary/item/details-custom create your own html file in theme folder app/design/frontend/Youbrand/yourtheme/Amasty_Checkout/web/template/checkout/summary/item/details-custom.html
after that run deploy static for re-deploy
Let's me know results if you try this
I already found a way to override the template via uiRegistry, but in this bug report I try to point out that it does not work the normal way. But thank you very much for your help attempt.
Good to know! Glad you find the way when we got many ways to get a job done. But imo i don't like XML way with crazy XML tree xmas. Hard to track. Hope it's should be improved someday
Tested replace html of component app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js store in module app/code/Magento/Checkout Place my html in theme luma app/design/frontend/Magento/luma/Magento_Checkout/web/template/summary/item/details.html
This one demo override html via layout like your second attempt in description
@mrtuvn yes I guess the bug is only caused if the template was already overriden by another module. like described in my question. There is a module called "Amasty_Checkout" which overrides the template. And I try to override the overriden template again.
--> this is the original template
vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details.js
--> original template from `magento/module-checkout` ↑ is overriden from `amasty\module-single-step-checkout` third party module (works)
vendor\amasty\module-single-step-checkout\view\frontend\web\template\checkout\summary\item\details.html
--> I try to override the template from `amasty\module-single-step-checkout` by placing the file into my theme (does not work)
app/design/frontend/company/base/Amasty_Checkout/web/template/checkout/summary/item/details.html
Do you understand?
still work at my local with luma vanilla setup + only amasty checkout (no Other 3rd-party extensions). Override origin template by amasty inside theme
@mrtuvn ok I see you have a module called Amasty/CustomCheckout. Did you made any additional changes there to make it work?
No in last reply that module not included/enable only module default of amasty and small additional html in theme
@mrtuvn Ok thx for testing. I have no explanation for this then. I will close the issue and if I know how I can reproduce it everytime then I will open another issue. Thx!
cc @Eddcapone If you need any further discuss please ping me or DMs to me on slack (https://magentocommeng.slack.com) or skype (see my profile).
@mrtuvn ok thank you very much for your offer :) very nice from you
I have the same problem right now, tried to override vendor/magento/module-tax/view/frontend/web/template/checkout/summary/shipping.html
via theme and it does not work.
@cartok Disable this config in dev env will solve the problem
In case this helps anyone, I just found out that Amasty's own template file in view/frontend/web/template/checkout/summary/item/details.html
is only loaded when "Allow to Edit Products in the Order Summary" is set to YES. If it is set to no then Magento's own file is loaded.
Im running Magento 2.3.3 and Amasty Checkout 3.0.13
Preconditions (*)
Steps to reproduce (*)
I try to override the knockoutjs template
vendor\amasty\module-single-step-checkout\view\frontend\web\template\checkout\summary\item\details.html
from my own Theme. The moduleamasty\module-single-step-checkout
is registered asAmasty_Checkout
Attempt 1:
I copied the file into my theme at
THEME\Amasty_Checkout\web\template\checkout\summary\item\details.html
and made my changes, then I flushed the cache and the browser cache, but it still loads the old template. I also executedgrunt clean
to clear static files. But it does not help either.Attempt 2:
THEME\Company_Base\web\template\details.html (Copied from
THEME\Amasty_Checkout\web\template\checkout\summary\item\details.html
)THEME\Amasty_Checkout\layout\checkout_index_index.xml:
Additional Information:
The template is set in the file
vendor\amasty\module-single-step-checkout\view\frontend\web\js\view\checkout\summary\item\details.js
:Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.