?php /** * ru-product-enhancements.php — RetailUnlimit Product Page Improvements * ====================================================================== * Adds: * 1. Stock / availability badge with shipping estimate * 2. B2B Quote Request button (next to Add to Cart) * 3. Warranty & Return policy trust snippet */ if (!defined('ABSPATH')) exit; // ── 1. STOCK / AVAILABILITY BADGE ──────────────────────────────────────────── // Fires just before the price (priority 9 = just before default price at 10) add_action('woocommerce_single_product_summary', 'ru_availability_badge', 9); function ru_availability_badge() { global $product; if (!$product) return; $stock_status = $product->get_stock_status(); $stock_qty = $product->get_stock_quantity(); $manage_stock = $product->managing_stock(); if ($stock_status === 'instock') { if ($manage_stock && $stock_qty !== null && $stock_qty <= 5) { // Low stock $badge_html = '
Only ' . intval($stock_qty) . ' left — Estimated Shipping: 2-5 Business Days
'; } else { // In stock $badge_html = '
In Stock — Estimated Shipping: 1-3 Business Days
'; } } elseif ($stock_status === 'onbackorder') { $badge_html = '
Available for Backorder — Additional lead time may apply. Contact us for delivery estimates.
'; } else { $badge_html = '
Out of Stock — Contact us for availability and alternative sourcing options.
'; } // Check for special order meta $special_order = get_post_meta(get_the_ID(), '_special_order', true); if ($special_order) { $badge_html .= '
Special Order — Non-cancellable once placed
'; } echo $badge_html; } // ── 1b. SHARED FULFILLMENT-STATE MAPPING (Issue #108) ──────────────────────── // Reusable state classifier — #109 Product Fulfillment State vocabulary. // Used by category/search card badges (ru_card_availability_badge). // Deliberately excludes shipping-estimate copy and Special Order status; // both are surface-specific rendering concerns handled separately. // ru_availability_badge() (single-product page) is NOT yet refactored to // use this function — that is explicitly deferred (see #108 follow-on). function ru_map_to_fulfillment_state($product) { $stock_status = $product->get_stock_status(); $stock_qty = $product->get_stock_quantity(); if ($stock_status === 'onbackorder') { return array( 'state' => 'available_for_backorder', 'label' => 'Available for Backorder', 'class' => 'ru-stock-backorder' ); } if ($stock_status !== 'instock') { return array( 'state' => 'out_of_stock', 'label' => 'Out of Stock', 'class' => 'ru-stock-out' ); } if ($product->managing_stock() && $stock_qty !== null && $stock_qty <= 5) { return array( 'state' => 'low_stock', 'label' => 'Only ' . intval($stock_qty) . ' left', 'class' => 'ru-stock-low' ); } return array( 'state' => 'in_stock', 'label' => 'In Stock', 'class' => 'ru-stock-in' ); } // ── 1c. CATEGORY/SEARCH CARD AVAILABILITY BADGE (Issue #108) ───────────────── function ru_card_availability_badge() { global $product; if (!$product) { return; } $info = ru_map_to_fulfillment_state($product); echo '
' . esc_html($info['label']) . '
'; } // ── 2. B2B QUOTE REQUEST BUTTON ─────────────────────────────────────────────── // Fires after Add to Cart button (priority 32 = just after default 30) add_action('woocommerce_single_product_summary', 'ru_b2b_quote_button', 32); function ru_b2b_quote_button() { global $product, $post; $product_name = get_the_title(); $mpn = get_post_meta($post->ID, '_mpn', true); $sku = get_post_meta($post->ID, '_sku', true); $price = $product->get_price(); $product_id = $post->ID; $quote_url = '/b2b-enterprise-quote/?prod_name=' . urlencode($product_name) . '&mpn=' . urlencode($mpn) . '&sku=' . urlencode($sku) . '&price=' . urlencode($price) . '&product_id=' . $product_id; echo '
Request B2B Quote
'; } // ── 3. WARRANTY & RETURN POLICY TRUST SNIPPET ──────────────────────────────── // Fires after the Add to Cart area (priority 35) add_action('woocommerce_single_product_summary', 'ru_trust_snippet', 35); function ru_trust_snippet() { echo '
Manufacturer Warranty All products include full manufacturer warranty
30-Day Returns Hassle-free returns on eligible items
Secure Checkout SSL encrypted · Net terms available for B2B
Fast Shipping Same/next business day dispatch
'; } // ── CSS FOR ALL THREE ELEMENTS ──────────────────────────────────────────────── add_action('wp_head', 'ru_product_enhancements_styles'); function ru_product_enhancements_styles() { if (!(is_product() || is_shop() || is_product_category() || is_product_tag())) { return; } echo ''; } B2B Enterprise Quote - RetailUnlimit.com
Dark Light

B2B Enterprise Quote

Enterprise Hardware Catalog

High-value enterprise equipment — request a custom quote with volume pricing, financing, or leasing options.

📦
HPE

HPE Aruba Networking CX 8100 24x10G SFP+ 4×40/100G QSFP28 Switch – Switch – L3…

Starting at $20,908.10
📦
APC

(1) YEAR ADVANTAGE ULTRA SERVICE PLAN FOR (1) EPS 8000 1000 KVA UPS

Starting at $20,909.99
📦
APC

INROW SC SYSTEM 1 INROW SC, 1 NETSHELTER SX RACK 600MM, WITH FRONT AND…

Starting at $20,919.99
📦
Lenovo

NV BF-3 B3220 2Px200G DPU

Starting at $20,946.95
Veeam Data Platform Foundation Universal Subscription License. Includes Enterprise Plus Edition features. 10 instance pack. 5 Years Subscription Upfront Billing Production 24/7 Support.- Software
Lenovo

Veeam Data Platform Foundation Universal Subscription License. Includes Enterprise Plus Edition features. 10 instance…

Starting at $20,966.32
📦
UZBL

UZBL 100 pack Pre-Paid Repair for 11″ Chromebooks – Touch/Non-Touch and 2in1

Starting at $21,002.17
📦
APC

UPS – 16 KW – DB-9 RS-232, RJ-45 10/100 BASE-T – BLACK

Starting at $21,029.99
📦
APC

MODULAR BATTERY REPLACEMENT SERVICE 5 X SYBT9-B4

Starting at $21,039.99
📦
HPE

HPE MSA 2062 16Gb FC SFF Storage

Starting at $21,073.05
📦
APC

START-UP SERVICE 5X8 FOR ALL-IN-ONE WITH EASY 3S, CW COOLING, UP TO 40KW

Starting at $21,094.99
📦
APC

APC SYCF40KF SYMMETRA PX 40KW FRAME, 208V

Starting at $21,134.99
📦
APC

GVX1000 SPARE PARTS KIT LEVEL 2

Starting at $21,158.37

Apply for Net Terms / Financing

Apply for Net 30/60/90 terms or third-party financing. Approval typically within 1-2 business days.

Questions? Call (469) 251-0066 or email sales@retailunlimit.com

SHOPPING CART

close