This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
Simplify unused Add to Cart button form placeholder for grouped product #8438
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
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: -438 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
kmanijak
added
block-type: product elements
Issues related to Product Element blocks.
type: bug
The issue/PR concerns a confirmed bug.
type: cooldown
Things that are queued for a cooldown period (assists with planning).
and removed
type: bug
The issue/PR concerns a confirmed bug.
labels
Feb 15, 2023
woocommercebot
requested review from
a team and
albarin
and removed request for
a team
February 15, 2023 13:31
albarin
approved these changes
Feb 15, 2023
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.
Looks good! 👍
E2E tests failing seem unrelated. Bypassing and merging. |
Aljullu
pushed a commit
that referenced
this pull request
Feb 17, 2023
…ct (#8438) * Simplify Add to Cart grouped version as it's never displayed
dinhtungdu
added
the
skip-changelog
PRs that you don't want to appear in the changelog.
label
Feb 28, 2023
kmanijak
added a commit
that referenced
this pull request
Feb 28, 2023
PR should be marked as Experimental, not Core
dinhtungdu
pushed a commit
that referenced
this pull request
Mar 1, 2023
dinhtungdu
added a commit
that referenced
this pull request
Mar 1, 2023
* Empty commit for release pull request * update 9.7.0 changelog for readme.txt * bump WC versions * 9.7.0 testing notes * Update 970.md * remove 7945 and update 8489 testing note * Remove 8264 testing notes * remove 8482 from testing instructions * Fix alignment of Add to Cart form block (#8578) * update testing zip after cherry-picking 8578 * update changelog * Move testing steps #8438 to experimental section (#8580) * Fix image is not showing at correct position (#8585) Co-authored-by: Tung Du <dinhtungdu@gmail.com> * fix 8478 testing note * fix md error cause the last section hidden * Add to Cart Form Block > Ensure the editor preview is properly displayed with the Gutenberg plugin disabled (#8582) * Update the editor styles for the add to cart form button so it is properly displayed with the Gutenberg plugin disabled. * update for the input height. * update the min-height * update testing zip link * Bumping version strings to new version. --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Tung Du <dinhtungdu@gmail.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com> Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: kmanijak <karol.manijak@automattic.com> Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block-type: product elements
Issues related to Product Element blocks.
skip-changelog
PRs that you don't want to appear in the changelog.
type: cooldown
Things that are queued for a cooldown period (assists with planning).
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.
There are two versions of a library used in the repo:
This PR is a step towards that goal. (Issue: #8452)
There's an Add to Cart block which has the control "Display Form Elements". Depends on the product type, it displays the form, e.g. allows to change the quantity for simple product or choose variant for variable products. If the prodict type is not supported, it fallbacks to default behaviour, e.g. displays a link to product for grouped products.
Based on the logic here, which is used in the block as
showFormElements
, the grouped product type is not supported by the Add to Cart block. Instead it fallbacks to regular behaviour and a "View Products" link is rendered instead.Having said that, it's safe to simplify the
GroupedProductForm
, which serves only a developer placeholder purpose for now and won't be displayed in the browser (neither editor nor frontend).It's especially valid, since it allows to remove the usage of
Placeholder
component imported fromwordpress-components
.Screenshots
There's no visual regression to the block
Editor - Grouped product is the middle one on each image. Other products are included for comparison
Frontend - Grouped product is the middle one on each image. Other products are included for comparison
Testing
Automated Tests
User Facing Testing
Prerequisites:
Go to Editor
Edit the Product Catalog template
Add All Products block
Enter the "edit" mode of All Products block by clicking a pencil button
Remove "Add to Cart Button" block
Add "Add to Cart" block - THESE ARE TWO SEPARATE BLOCKS. IT'S ABOUT "ADD TO CART" BLOCK!
By default the "Display form elements" toggle should be disabled
Expected: Button looks like on a pictures above
Save the changes and check the frontend as well
Enter the edit mode of "Add to Cart" button (there's a bug that block cannot be clicked. To enter the edit mode, please open a "list view" of blocks and choose "Add to Cart" from there)
Enable "Display form elements" toggle
Expected: Button looks like on a pictures above (while it changes to form for other types of products: simple, variable)
Save the changes and check the frontend as well
WooCommerce Visibility
Changelog skipped on purpose