Issue with REST API
-
Starting from version 30 we are facing an issue with the PPOEM plugin, In case when order contains a single product and a product with modifiers, we receive an error message, we checked the functionality of the PPOM API through the URL. and received the following “There has been a critical error on this website”
We find out a solution simply adding the following code :
if (!$ppom_cart_items) return $ppom_meta;File: woocommerce-product-addon/inc/functions.php
Function: ppom_generate_cart_meta
Original code:
function ppom_generate_cart_meta( $ppom_cart_items, $product_id, $ppom_meta_ids = null, $context = ‘cart’, $variation_id = null ) {$ppom_meta = array(); $ppom_cart_fields = $ppom_cart_items['fields'];Patched code:
function ppom_generate_cart_meta( $ppom_cart_items, $product_id, $ppom_meta_ids = null, $context = ‘cart’, $variation_id = null ) {$ppom_meta = array(); if (!$ppom_cart_items) return $ppom_meta; $ppom_cart_fields = $ppom_cart_items['fields'];Can you please add this code to the following versions, Thank you.
The topic ‘Issue with REST API’ is closed to new replies.