Woocommerce Emogrifier Error on Composite Products and Bundles
-
I am getting the following error when checking out a product bundle or composite product in woocommerce:
2020-09-29T12:45:04+00:00 CRITICAL Uncaught Error: Call to a member function appendChild() on null in /home/uktradeb/public_html/wp-content/plugins/woocommerce/vendor/pelago/emogrifier/src/Emogrifier.php:1165
Stack trace:
#0 /home/uktradeb/public_html/wp-content/plugins/woocommerce/vendor/pelago/emogrifier/src/Emogrifier.php(1021): Pelago\Emogrifier->addStyleElementToDocument(‘.bundled_table_…’)
#1 /home/uktradeb/public_html/wp-content/plugins/woocommerce/vendor/pelago/emogrifier/src/Emogrifier.php(517): Pelago\Emogrifier->copyUninlinableCssToStyleNode(Array, ”)
#2 /home/uktradeb/public_html/wp-content/plugins/woocommerce/vendor/pelago/emogrifier/src/Emogrifier.php(366): Pelago\Emogrifier->process()
#3 /home/uktradeb/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(570): Pelago\Emogrifier->emogrify()
#4 /home/uktradeb/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(650): WC_Email->style_inline(‘<h1 style=”text…’)
#5 /home/uktradeb/public_html/wp-content/plugins/woocommerce/include in /home/uktradeb/public_html/wp-content/plugins/woocommerce/vendor/pelago/emogrifier/src/Emogrifier.php on line 1165I have managed to workaround this by changing line 1165 in Emogrifier.php from/to:
// $headElement->appendChild($styleElement);
if($headElement){$headElement->appendChild($styleElement);}The error occurs when creating the new order emails, which led me to think the emails had been customised, however they have not.
Has anyone else had this error, as I don’t think I should have to change the Emogrifier.php as a workaround, as it will create problems down the line when it is updated?
- The topic ‘Woocommerce Emogrifier Error on Composite Products and Bundles’ is closed to new replies.