@skoz95 Ok, good that makes sense, now I can understand the cause.
WordPress should preserve plugin settings, but of course that is out of my control, I can’t promise it, and it is sensible to be careful when the printer is remote and a business is relying on it (that is honestly why I am quite slow to publish updates to WordPress).
If you prefer to just make the modifications to the version on your site, then the extra changes are not much.
Firstly, make sure that you have the full signature for the star_cloudprnt_create_receipt_order_meta_data()
function:
function star_cloudprnt_create_receipt_order_meta_data($meta_data, $order, &$printer, $max_chars)
Note the additional $order
parameter.
Then, in the star_cloudprnt_print_order_summary()
function, fine the existing line:
star_cloudprnt_create_receipt_order_meta_data($meta_data, $printer, $selectedPrinter['columns']);
and change it to:
star_cloudprnt_create_receipt_order_meta_data($meta_data, $order, $printer, $selectedPrinter['columns']);
Again, the difference is passing in the extra $order
parameter so that it can call functions like $order->meta_exists()
to check each meta data key is available before trying to print it.