Fix my WooCommerce php snippet

Job ID: 34651537

Budget: €25 – €35 EUR

I have a custom snippet, that allows me to backend search for custom field "pp_sku_0".
The code is here: https://codeshare.io/JbY1MK

The problem is when using backend woocommerce product filters, this fatal error appears:
https://codeshare.io/QnY1EL

Your task is to fix my code snippet so it no longer produces error on product filtering and filtering can happen as usual.

This is 1 hr job max.
Related categories: PHP WordPress WooCommerce