Server error on checkout in latest php 8.2
-
Hi.
Great plugin.
There is an issue around line 606 when plugin is enabled and customers buy non raffle ticket products. The order AND payment are created but the checkout returns an error as the wc-ajax call caused a 500 error.
I think you need to check if (get_post_meta( $item[‘product_id’], ‘_number_field’, true ) actually returns a value before doing the calculation.
$no_of_tickets = ($item['qty']) * (get_post_meta( $item['product_id'], '_number_field', true )); // change to $product_no_of_tickets = get_post_meta( $item['product_id'], '_number_field', true ); if($product_no_of_tickets > 0){ $no_of_tickets = ($item['qty']) * $product_no_of_tickets; .... }
Works fine on php 7.4 as it is a bit more forgiving than 8
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Server error on checkout in latest php 8.2’ is closed to new replies.