Error assigned_to
-
Hello,
i have updated the plugin and now my assign function not works. This is the funtcion
add_filter( 'site-reviews/create/review-values', function( $reviewValues ) { if( !empty( $reviewValues['custom']['order']) && is_numeric( $reviewValues['custom']['order'] )) { $post = get_post( $reviewValues['custom']['order'] ); if( $post instanceof \WP_Post && $post->post_type != 'site-review' ) { global $wpdb; $order_id = $wpdb->get_results( "SELECT order_id FROM ".$wpdb->prefix."woocommerce_order_items WHERE order_item_id = ".$post->ID."" ); $order = wc_get_order($order_id[0]->order_id); glsr_log("SONO IN ROTOLO"); foreach ($order->get_items() as $item_key => $item_values){ $product = $item_values->get_product('attributes'); // the WC_Product object switch ( $product->get_attributes()['tipologia']['options'][0] ) { case 'rotolo': $reviewValues['assigned_to'] = '8582'; break; case 'foglio:': case 'fogli': $reviewValues['assigned_to'] = '8580'; break; case 'cartellini': $reviewValues['assigned_to'] = '8578'; break; } } } } return $reviewValues; });
How can i resolve it? i have insert glsr_log($order) but the console not show the variable
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Error assigned_to’ is closed to new replies.