-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Up port] Fixed the issue #19347. #19393
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
[Up port] Fixed the issue #19347. #19393
Conversation
|
Hi @tiagosampaio. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
|
Original pull request #19351 |
app/code/Magento/Checkout/view/frontend/templates/cart/totals.phtml
Outdated
Show resolved
Hide resolved
|
I'm still working on this. |
|
Hey guys, please I need you to review this PR. |
sivaschenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tiagosampaio thanks for your updates! There is one question I have in the code review. Also, can you please fix the failing static tests on travis.
|
Hi @sivaschenko, thank you for the review. |
orlangur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tiagosampaio please squash changes into a single commit so that we have perfectly clean history 😉
|
Hi @tiagosampaio, thank you for your contribution! |
|
Hi @orlangur, thank you for the review. |
|
is anyone there how to solve this in step by step ? |
|
✔️ QA passed |
sivaschenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tiagosampaio can you please adjust the pull request according to my review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we couldn't approve adding a new public function to this API class.
Can you please inject cart config as a layout argument to this block and retrieve it in the template using magic getter (see https://github.com/magento/magento2/pull/18443/files for the example of implementation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sivaschenko! Thank you for your feedback. I've done the modifications to accomplish tha same result by using the layout.
Fixing test for ShippingTest class. Made some modifications according to requests and implemented the unit tests. Removed duplicated semicolon. Changes: - Removed the @api annotation - Removed the @codeCoverageIgnore annotation - Fixed the PHPDoc annotation for the serializer attribute Removing the javascript from html and separated it to a javascript file. Added the use strict to totals.js file. Fixing the code style for totals.js file. Adding a simple semicolon. #19393: Static test fix. Removing the public method \Magento\Checkout\Block\Cart\Totals::getSeializedCheckoutConfig and implementing it as a magic argument. Removing unnecessary dependencies. Removing the unnecessary dependency annotation.
sivaschenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your updates, please see my review comments
| */ | ||
| public function getCheckoutConfig() | ||
| { | ||
| return $this->configProvider->getConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tiagosampaio can you please add caching for the config data retrieved from the config provider (as getCheckoutConfig can be called several times on the same page and there is no caching implemented in the configProvider)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sivaschenko.
The change was applied to this PR.
…odel\CompositeConfigProvider.
|
@tiagosampaio thanks! looks good |
|
@paliarush can you please approve the SVC failure (added constructor optional parameters) |
sivaschenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tiagosampaio can you please resolve introduced dependencies following the review comments
| array $data = [], | ||
| \Magento\Framework\Serialize\Serializer\Json $serializer = null | ||
| \Magento\Framework\Serialize\Serializer\Json $serializer = null, | ||
| \Magento\Checkout\Model\Cart\ConfigProvider $cartConfig = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please inject this class via block argument in layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sivaschenko
Based on the discussion in #23733 I think it's not backwards compatible to add block arguments via layout xml?
If custom modules try to instantiate the same block class in some custom xml file, then after upgrading Magento the module might crash as it's missing some arguments which are then undefined but still being used by the phtml file.
Can you double check this?
| array $layoutProcessors = [], | ||
| array $data = [] | ||
| array $data = [], | ||
| \Magento\Framework\Serialize\SerializerInterface $serializer = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please inject this dependency via block argument in layout
| <container name="checkout.cart.totals.container" as="totals" label="Shopping Cart Totals"> | ||
| <block class="Magento\Checkout\Block\Cart\Totals" name="checkout.cart.totals" template="Magento_Checkout::cart/totals.phtml"> | ||
| <arguments> | ||
| <argument name="cart_config" xsi:type="object">Magento\Checkout\Model\Cart\ConfigProvider</argument> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply the same approach for other blocks' dependencies as well
|
@tiagosampaio , I am closing this PR now due to inactivity. |
|
Hi @tiagosampaio, thank you for your contribution! |
After removing the Estimate Shipping Costs and Tax from cart using layout the totals were not displayed.
Description (*)
Please check all the description in issue #19347.
Fixed Issues (if relevant)
Manual testing scenarios (*)
The testing scenarios are described in the issue page.
Contribution checklist (*)