Fixed error on deleted order

This commit is contained in:
Jacob Eva 2023-07-02 09:31:22 +01:00
parent 7e09937256
commit 67d9e70eca
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E

View File

@ -132,7 +132,15 @@ HTML;
switch($column_name) { switch($column_name) {
case 'col_order_id': case 'col_order_id':
echo $this->get_order_link($item->order_id); // try...catch to prevent page breaking on deleted order
try {
echo $this->get_order_link($item->order_id);
}
catch(Exception $e) {
if ($e->getMessage() === "Invalid order.") {
echo "<p>Order has been deleted.</p>";
}
}
break; break;
case 'col_payment_id': case 'col_payment_id':
echo $item->payment_id; echo $item->payment_id;