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 219
Use the single product block on the Hero Product pattern #9935
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
23ee6f0
Use the single product block on the Hero Product pattern
albarin ddea172
Use the add to cart button block
albarin 397238e
Merge branch 'trunk' into 9855/product-hero
albarin 4eefdb1
Use featured image and fix alignment
albarin 1642f59
Merge branch 'trunk' into 9855/product-hero
albarin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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 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.
While I agree this is a valid way to provide an initial/default product for the user to work with, I believe, ideally, we should somehow display a list of available products for the user to choose from before inserting the pattern, similar to what is displayed when inserting the single product block itself in the editor:
We don't necessarily have to solve this problem on this PR, but IMO it would be a good idea to open a separate issue and explore the feasibility of something along these lines. What are your thoughts?
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.
Removing that PHP snippet to select a product would give us that same single product selector from the image above, but the problem then is that we lose the preview 👇 so the pattern is not really visible until inserted, making it less likely for a user to insert it.
I think eventually GB will have something to provide a custom preview, but until now, that's the only way to show the actual pattern there.
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.
Oh ok, gotcha! Feels like we are stuck in a bad loop: without a preview, the user might not insert the pattern, but if they do insert it and can't change the product, they may not use it either 😭
Out of curiosity, do you know if there's an issue on GB already for allowing us to modify this custom preview?
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.
Opened https://github.com/woocommerce/woocommerce-blocks/issues/10022 so we can discuss this separately and unblock this work =)
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.
I found this issue WordPress/gutenberg#28135 but there's not much activity, not sure if there are more.
They can actually change the product (it's still a
Single Product
block) though it may not be obvious after inserting, that's true.