WooCommerce Plugin
Add W-Scrut warranty adjudication to any WooCommerce store with a single PHP snippet or WordPress plugin. Compatible with WooCommerce 7.x and later.
Method 1 — PHP snippet (functions.php)
Add this to your theme's functions.php or a custom plugin:
<?php
// W-Scrut Warranty Button — add to order-received.php or My Account
function wscrut_warranty_button($order_id) {
$tenant_id = 'YOUR_TENANT_ID';
$api_key = 'wsc_live_xxx';
$order = wc_get_order($order_id);
foreach ($order->get_items() as $item) {
$sku = $item->get_product()->get_sku();
echo '<a href="https://wscrut.silnt.in/widget/claim'
. '?tenant=' . $tenant_id
. '&order=' . $order_id
. '&sku=' . $sku . '"'
. ' class="button wscrut-btn"'
. ' target="_blank">🔧 Request Warranty Return</a>';
}
}
add_action('woocommerce_order_details_after_order_table', 'wscrut_warranty_button');
?>Method 2 — REST API (headless)
If you have a headless WooCommerce setup, use the REST Webhook API directly from your frontend or backend.
Receiving callbacks
Add a WooCommerce webhook receiver endpoint in your plugin to process approved/rejected decisions and update order status or notify customers. See the REST Webhook guide for the exact callback payload format.