Closed ghost closed 3 years ago
Hi @dholidev. 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
@felipeSoulmkt, pode acompanhar.
perfeito @dholidev, obrigado pela ajuda
Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @dholidev,
Unfortunately can't reproduce, Can you please provide me more reproducible steps e.g. which module you are using?
It would be helpful for me in debugging if you can give me more details.
Hi @engcom-Lima,
I cannot provide the module, but we have an assembled environment.
We have a Magento discount rule "Desconto (10 OFF)" and the discount that our payment module offers when the credit card purchase is made in a single payment "Desconto à vista".
Please enter this address "https://m2.eloom.com.br/customer/account/login/", with this access data "m2@eloom.com.br / Papa1mage2to", go to the checkout, choose any shipping method and in the payment choose "Terminado in 1111 (expires: 2023/11)" and in the parcels leave the first one selected.
Note that in the review, both blocks have "Desconto à vista". In the console, type "window.checkoutConfig.totalsData.total_segments" and see that the block "eloom_discount" comes before "discount" (must come before).
This is because of the indexOf of the file "module-sales-rule/view/frontend/web/js/view/summary/discount.js".
Please tell me if you need my help.
Thanks.
Hi @dholidev
I checked your instance and saw the response in console same which you mentioned in your ticket.
Can you confirm me one thing? your concern is label should be "Desconto (10 OFF)" instead of "Desconto à vista"? Am i right?
Hi @engcom-Lima
Yes, "Desconto (10 OFF)".
If you change the javascript code I mentioned to "return segment.code == 'discount';", both discounts will be correct.
Hi @dholidev
One more thing please confirm, We have created magento discount rule "Discount (10 OFF)". It is applied as per expected. here i have one more question, it is necessary to install any payment offer module to reproduce this? if yes then tell me about the same so that i can install and try to reproduce for you.
Hi @engcom-Lima,
we cannot provide the payment module causing the conflict.
Hi @dholidev
As far as it is not an magento issue, it may be due to your payment module specific only. We had worked on the ticket and can't reproduce the issue so We need the reproducible steps. Hence we are closing this ticket.
Please feel free to raise the new ticket or reopen the existing ticket in case of any issue.
Thanks for the understanding !
Hi @dholidev
As far as it is not an magento issue, it may be due to your payment module specific only. We had worked on the ticket and can't reproduce the issue so We need the reproducible steps. Hence we are closing this ticket.
Please feel free to raise the new ticket or reopen the existing ticket in case of any issue.
Thanks for the understanding !
Hi @engcom-Lima,
The problem lies in Magento's poorly written code logic when using the "indexOf()" method, reported in the first thead. It is not in the payment module.
We will provide this link to agencies and developers using our solution and they will know which side the problem is on.
Thanks for your attention.
@felipeSoulmkt,
conforme pode ver em 2 theads acima, o suporte do Magento finalizou o ticket informando que o problema não está no Magento porque não conseguiu reproduzir o erro em razão de não fornecemos o módulo de pagamento a eles, mesmo montando um ambiente e dando acessos para testarem.
Se analisar o primeira thead deste chamado em que reportamos o problema e com o mínimo conhecimento de lógica de programação, verá que ao varrer o array de segmentos dos totais usando um "indexOf()" é o causador do conflito, visto que qualquer string contendo "discount" satisfaz a busca no trecho de código.
Não iremos alterar os nomes dos blocos de desconto no nosso módulo de pagamento porque o problema está no código mal escrito do Magento.
Abraço
Hey guys,
The checkout is applying the title of the block totals "discount" in the wrong way.
If there is a third-party block in totals_segment containing "discount" as part of the code and it comes before the discount, it is applied instead. (Attachment "checkout-discount.jpg")
Analyzing the code of the file "module-sales-rule/view/frontend/web/js/view/summary/discount.js", line line 60, there is a search with indexOf ('discount').
Preconditions (*)
Magento 2.3.x, 2.4.x
Steps to reproduce (*)
Create any module whose totals code contains "discount" and precede "discount" block.
Expected result (*)
Ideally, change the "return segment.code.indexOf('discount') !== -1;" for "return segment.code == 'discount';" (Attachment "discount-code.jpg")