-
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
Fix for remove 'product_list_toolbar' block from layout in XML #9413 #11473
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…format on construcor of the product list block class
…ility. Use the default toolbar to get current listing mode. Refactor the code.
…using the mode layout configuration
…L depends on product collection. Because you can remove the toolbar from layout, there is no reason for parent class to add the product collection to default toolbar if the toolbar is never used. That is why the test toolbar coverage needs to include a product collection before checking the toolbar HTML.
…ion present in default layout. Remove the previews correction made because it's not solve the problem where is checking if the toolbar HTML is not empty.
orlangur
reviewed
Oct 23, 2017
orlangur
reviewed
Oct 23, 2017
dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php
Show resolved
Hide resolved
Remove FQCN
magento-engcom-team
added
2.2.x
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
labels
Nov 7, 2017
magento-engcom-team
added
the
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
label
Nov 20, 2017
magento-team
pushed a commit
that referenced
this pull request
Nov 25, 2017
magento-team
pushed a commit
that referenced
this pull request
Nov 25, 2017
[EngCom] Public Pull Requests - 2.2-develop - MAGETWO-83552: save invoice ID on credit memo when using API method salesRefundInvoiceV1 #11670 - MAGETWO-82577: [Backport 2.2] Translate order getCreatedAtFormatted() to store locale #11422 - MAGETWO-84474: 10128: New Orders not being saved to order grid #12241 - MAGETWO-83783: Shipping method fixtures not compatible with getShippingMethod(true) in OrderCreateTest #12227 - MAGETWO-83290: Add swatch option: Prevent loosing data and default value if data is not populated via adminhtml #12036 - MAGETWO-83741: 11740: Sending emails from Admin in Multi-Store Environment defaults to Primary Store #11992 - MAGETWO-83399: Fix for remove 'product_list_toolbar' block from layout in XML #9413 #11473
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Progress: accept
Release Line: 2.2
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for remove 'product_list_toolbar' block from layout in XML #9413
Description
This solution solves the issue when you want to not have toolbar block set on product listing. The reason why toolbar persisted even after that was explicit removed from layout configuration, it's because the method Magento\Catalog\Block\Product\ListProduct:getToolbarBlock always returns a toolbar block.
I think the main reason was build to return a toolbar block is because the product collection needs to use pagination. But there are cases when you have listing with less then 20 products and you want to not have toolbar in place. In that case you will be forced to create a custom product listing block class because you cannot remove it from the layout.
The product list use modes for listing and this depends on toolbar block to get that information. Because the toolbar block has a default block, this fix will use this block to get the default mode. You can change the listing mode on layout like this:
Fixed Issues (if relevant)
Manual testing scenarios