print-content.php needs to account for item meta that are PHP classes
-
templates/print-order/print-content.php
has a check for whether theitem_meta
is an array and skips it if true, but some plugins (e.g, Woocommerce Partial Orders Pro) store PHP classes in item meta resulting in a PHP fatal error in those cases.There are multiple ways to prevent the fatals, but one would be to replace lines 164-166 with:
if ( ! is_string( $value ) ) { if ( is_object( $value ) && method_exists( $value, '__toString' ) ) { $value = strval( $value ); } else { continue; } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘print-content.php needs to account for item meta that are PHP classes’ is closed to new replies.