-
Notifications
You must be signed in to change notification settings - Fork 215
Product Gallery Thumbnails: Add support for cropping #11718
Product Gallery Thumbnails: Add support for cropping #11718
Conversation
…and better control the width of the thumbnails
…p images to fit' setting
|
The release ZIP for this PR is accessible via: Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
|
Size Change: +8 B (0%) Total Size: 1.61 MB
ℹ️ View Unchanged
|
sunyatasattva
left a comment
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'm going to pre-approve not to block you, but there is a small change request 🙏
| $post_thumbnail_id = $product->get_image_id(); | ||
| $product_gallery_images = ProductGalleryUtils::get_product_gallery_images( $post_id, 'thumbnail', array(), 'wc-block-product-gallery-thumbnails__thumbnail' ); | ||
| $crop_images = $block->context['cropImages'] ?? ''; | ||
| $product_gallery_images = ProductGalleryUtils::get_product_gallery_images( $post_id, 'full', array(), 'wc-block-product-gallery-thumbnails__thumbnail', $crop_images ); |
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.
Would you mind explaining why the image size went from thumbnail to full when we're dealing with thumbnails?
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.
…s setting to false
…ocks into fix/11699-product-gallery-thumbnails-cropping

What
Fixes #11699
Why
This PR adds support for cropping to thumbnails.
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Appearance > Editor.Templates > Single Product.Convert to Blocksif you are using the Classic Templates.Product Galleryblock.Crop images to fitenabled and disabled.Screenshots or screencast
With Cropping setting:
WooCommerce Visibility
Required:
Checklist
Required:
[type]label or a[skip-changelog]label.Conditional:
[skip-changelog]label is not present).Changelog