Title: Error 200: parsererror
Last modified: September 8, 2023

---

# Error 200: parsererror

 *  Resolved [cangle](https://wordpress.org/support/users/cangle/)
 * (@cangle)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/error-200-parsererror-3/)
 * I narrowed this error down to this code in my functions.php file but I am unsure
   how to update it.
 * Can you help?
 * add_action( ‘wpo_wcpdf_after_order_details’, ‘woocommerce_invoice_gift_message’,
   10, 2 );
   function woocommerce_invoice_gift_message ($template_type, $order) {
   global $wpo_wcpdf;if ($template_type == ‘invoice’) {?>
 * custom_field(‘Gift Message’, “Gift Message:
   “); ?><?php}}

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Yordan Soares](https://wordpress.org/support/users/yordansoares/)
 * (@yordansoares)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/error-200-parsererror-3/#post-17037603)
 * Hi [@cangle](https://wordpress.org/support/users/cangle/),
 * Replace your outdated code with this one:
 *     ```wp-block-code
       /**
        * PDF Invoices & Packing Slips for WooCommerce:
        * Display the gift message after the order details
        */
   
        add_filter( 'wpo_wcpdf_after_order_details', function( $address, $document ) {
       	if ( ( $order = $document->order ) && ( $gift_message = $order->get_meta( 'Gift Message' ) ) ) {
       		$address .= sprintf( '<p>Gift Message: %s</p>', $gift_message ); 
       	}
       	return $address;
       }, 10, 2 );
       ```
   
 * Please note that this happened because you are using deprecated code that we 
   started removing on the latest version. Actually, these legacy code is very old,
   and we kept them for long time in order to provide support old WooCommerce versions.
   However, since WooCommerce started bumping the minimal requirements, we chose
   to follow the same approach.

Viewing 1 replies (of 1 total)

The topic ‘Error 200: parsererror’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Yordan Soares](https://wordpress.org/support/users/yordansoares/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/error-200-parsererror-3/#post-17037603)
 * Status: resolved