NO BUG: SVG Woo resize issue in new update

woocommerce is giving me an error on all pages on the frontend

the issue is because of SVG resizing apparently. The following snippet solves the problem but is this bricks related ?

add_filter(‘woocommerce_resize_images’, static function() { return false; });


  • Warning : Undefined array key “width” in /Users/markfulgado/Local Sites/xoxox/app/public/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php on line 276. - Warning : Undefined array key “height” in /Users/markfulgado/Local Sites/xoxoxo/app/public/wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php on line 277

Hi Mark,
Thanks so much for your report, and welcome to the forum!

What do I have to do to trigger the error? Can you provide me with the needed steps or a screencast showing and explaining how to do it?

Best regards,

hello, i am also getting the same response:

: Undefined array key “height” / “width” in file…wp-content/plugins/woocommerce/includes/class-wc-regenerate-images.php on line 277

im trying to dynamically show .svg on frontend using image field in acf

on frontend it shows well but it also shows these errors/warnings on top

best regards,

Hi Simon,
Welcome to the forum!

Please try to add a width/height to the image element, as SVGs do not have an intrinsic width or height like images. Alternatively, use the SVG element.

hello and thank you so much for the response.

i mean it works when i add dynamically the svg using image block but it shows the warnings. I have just hid them using “false” in config.php file. How good and reliable of a solution that is?

best regards,

PHP warnings should only be visible for debugging anyway - alternatively, you can apparently use a filter:

Since the PHP warning comes directly from WooCommerce and there are reports about it independently of Bricks, it’s not a Bricks bug.