Skip to content

Conversation

@tiagosampaio
Copy link
Member

@tiagosampaio tiagosampaio commented Nov 24, 2018

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)

  1. Removing "Estimate shipping costs and tax" from cart removes cart totals #19347: Removing "Estimate shipping costs and tax" from cart removes cart totals

Manual testing scenarios (*)

The testing scenarios are described in the issue page.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @tiagosampaio. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@sivaschenko
Copy link
Member

Original pull request #19351

@sivaschenko sivaschenko self-assigned this Nov 26, 2018
@tiagosampaio
Copy link
Member Author

I'm still working on this.

@tiagosampaio
Copy link
Member Author

Hey guys, please I need you to review this PR.

Copy link
Member

@sivaschenko sivaschenko left a 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.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Jan 17, 2019
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-3890 has been created to process this Pull Request

Copy link
Contributor

@orlangur orlangur left a 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 😉

@m2-assistant
Copy link

m2-assistant bot commented Apr 14, 2019

Hi @tiagosampaio, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-4760 has been created to process this Pull Request

@sumeetmobiwebtech
Copy link

is anyone there how to solve this in step by step ?

@VasylShvorak
Copy link
Contributor

✔️ QA passed

Copy link
Member

@sivaschenko sivaschenko left a 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.

Copy link
Member

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)

Copy link
Member Author

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.
Copy link
Member

@sivaschenko sivaschenko left a 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, please see my review comments

*/
public function getCheckoutConfig()
{
return $this->configProvider->getConfig();
Copy link
Member

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)

Copy link
Member Author

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.

@sivaschenko
Copy link
Member

@tiagosampaio thanks! looks good

@sivaschenko
Copy link
Member

@paliarush can you please approve the SVC failure (added constructor optional parameters)

Copy link
Member

@sivaschenko sivaschenko left a 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
Copy link
Member

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

Copy link
Contributor

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
Copy link
Member

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>
Copy link
Member

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

@sidolov
Copy link
Contributor

sidolov commented Sep 26, 2019

@tiagosampaio , I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@sidolov sidolov closed this Sep 26, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 26, 2019

Hi @tiagosampaio, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.