HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/tepnot/public_html/wp-content/plugins/dokan-pro/modules/rma/includes/Hooks.php
<?php

namespace WeDevs\DokanPro\Modules\RMA;

use Exception;
use WC_Order;
use WC_Order_Item_Product;

class Hooks {
    public function __construct() {
        add_filter( 'woocommerce_rest_prepare_shop_order_object', [ $this, 'prepare_rma_order_object' ], 10, 2 );
    }

    /**
     * Add Warranty data into order object
     *
     * @param mixed $response
     * @param WC_Order $order
     *
     * @return mixed
     * @throws Exception
     */
    public function prepare_rma_order_object( $response, WC_Order $order ) {
        $allowed_status                = dokan_get_option( 'rma_order_status', 'dokan_rma', 'wc-completed' );
        $data                          = $response->get_data();
        $data['eligible_for_warranty'] = ! ( $allowed_status !== 'wc-' . $order->get_status() );
        $response->set_data( $data );

        return $response;
    }
}