In Refund Process, Plugin generating 500 error
-
Hi Team,
I have been working with your plugin. Also, checking if stocks return back to their warehouse locations again or not.Under stock-locations-for-woocommerce/src/helpers/helper-slw-order-item.php
We are adding up the order notes. But since, the process was refunding. I am using the following Reflection class to pause the note on order.
// Add the note $reflect = new \ReflectionClass($lineItem->get_order()); $logger = wc_get_logger(); $logger->debug( 'Class name : '. $reflect->getShortName(), array( 'source' => 'slw-plugin' ) ); if($reflect->getShortName() !== 'OrderRefund') { $lineItem->get_order()->add_order_note( sprintf(__('The stock in the location %1$s was updated in -%2$d for the product %3$s', 'stock-locations-for-woocommerce'), $term->name, $item_stock_location_subtract_input_qty, $mainProduct->get_name()) ); }
Please suggest if it’s right. SlwOrderItemHelper::allocateLocationStock() being called when we refund the order.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘In Refund Process, Plugin generating 500 error’ is closed to new replies.