-
Notifications
You must be signed in to change notification settings - Fork 219
Product Image Gallery: Reintroduce filters and override-restore the global product variable. #9630
Product Image Gallery: Reintroduce filters and override-restore the global product variable. #9630
Conversation
… the global product variable.
…he get_block_type_uses_context method.
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: 0 B Total Size: 1.09 MB ℹ️ View Unchanged
|
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.
Hey @nefeline, I have reviewed the changes and noticed a small issue. When changing the thumbnail, the space at the top keeps increasing. It appears that the divs added for the previous thumbnail are taking up space in the subsequent ones. Here is a quick demonstration:
Screen.Recording.2023-06-02.at.2.46.21.PM.mov
I am not sure if this should be a blocker.
CC: @tjcafferkey @nerrad
Can we have a quick look into how much effort may be required in fixing this before making a decision on this? |
@imanish003 upon closer inspection I am not sure this is even an issue. I believe it is the result of the inserted markup via the testing instructions which is causing some layout issues since the inserted add_filter( 'woocommerce_single_product_image_thumbnail_html', function ( $html ) {
return $html . '<div>Thumbnail</div>';
} ); I am assuming, anyone using this filter to insert their markup will account for any layout issues via styling it. And since this PR is to reintroduce filters merely by the fact that they're working should be enough. Could you please confirm my above assumptions? |
Hey @tjcafferkey, Thanks for the closer inspection. After reviewing the code and considering your explanations, I agree that the layout issues are likely caused by the inserted markup via the testing filter:
Since the inserted Regarding your assumptions, it is reasonable to assume that anyone using this filter to insert their markup should account for any layout issues by styling it appropriately. Since this pull request is aimed at reintroducing filters and ensuring their functionality, the fact that they are working should indeed be sufficient. I will ahead and approve the PR. 🙂 |
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.
LGTM 🚀
Thanks for reviewing and merging PR this while I was away @imanish003; much appreciated! 🙌 |
Fixes #9618
'woocommerce_single_product_image_gallery_classes'
,'woocommerce_single_product_image_thumbnail_html'
,'woocommerce_sale_flash'
and'woocommerce_product_thumbnails_columns'
filters to the Product Image Gallery block (originally removed on Product Gallery Block > Remove global variable overwrite and keep support for the Single Product Block. #9475).Internal discussion ref. p1685275379858039-slack-C02UBB1EPEF
Testing
User Facing Testing
Hooks Testing
Add the following by the end of your
woocommerce-gutenberg-products-block.php
file:my-custom-class
: make sure it is in place as one of the available product gallery classes.'woocommerce-product-gallery--columns-1'
class and make sure it exists (the number attached to this class corresponds to the number of columns modified viawoocommerce_product_thumbnails_columns
filter).WooCommerce Visibility
Performance Impact
Changelog