Automattic / _s

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
http://underscores.me/
GNU General Public License v2.0
10.93k stars 3.12k forks source link

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

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. I can also achieve this by removing all other styles with unset( $enqueue_styles['style-namel'] ) and only leaving 'woocommerce-general'.

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.