Automattic / underscores.me

https://underscores.me
GNU General Public License v2.0
210 stars 117 forks source link

Best way to re-enable catalog images auto-scaling that comes with WooCommerce core? #75

Closed petitetit closed 4 years ago

petitetit commented 4 years ago

So apparently when using Underscores with Woo boilerplate, WooCommerce use of (most likely) wp_get_attachment_image_src() WP function is disabled, this makes stuff pretty messy when dealing with product catalogues and it's image scaling cross devices.

I can re-enable the default WooCommerce stylesheet by removing the following line from woocommerce.php:

add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

However this is not a recommended practice, as already noted in the comments.

Upon reading https://docs.woocommerce.com/document/image-sizes-theme-developers/, at ### #section-4 there seems to be a filter workaround, more specifically I would need the filter 'single_product_archive_thumbnail_size', however this seems not to work and right below it, it says the following:

Note: The hooks listed above are used by WooCommerce core. If a theme has custom template files or uses it’s own functions to output images, these filters may not be in use.

So it is either me not getting something due to my limited knowledge or indeed there is no template in use/or other functions are used to output images when using the WooCommerce boiler plate with _s.