Fix my wp all import with custom function

Job ID: 31409964

Budget: €30 – €250 EUR

I have a wp all import that imports orders from amazon. The amazon feed has a field for the product purchased "sku". This does not match store "sku" but a custom field "_pp_sku_0". Since the wpai import tries to match on sku and doesnt find any matching in shop, the import fails.

I need a code snippet that matches import feed "sku" value to custom field in WooCommerce "_pp_sku_0".

I already have some code made, it needs adjustement: https://codeshare.io/wn4Zjp

The wpai comment on this code is:
"The issue here is that the "my_get_product" function is only returning the variation ID. You would need to extend it so that the main variation SKU is returned (using the "wc_get_product" function would be useful here, along with the "get_sku" method that's available).

In addition, since the main variation SKU has a pipe character: https://d.pr/i/yiT0bN - you'll need to change the value for "Multiple products separated by" in the "Order Items" section: https://d.pr/i/6y313q"

Please only issue offer if you have a good understanding of WooCommerce.
Related categories: PHP WordPress WooCommerce