From 533cf5e7d295453aa92c1c1b3faac14ccc1e6248 Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Thu, 8 Jan 2026 14:50:08 +0700 Subject: [PATCH] fix(rajaongkir): fix relative endpoint path and increase min_chars to 3 - search_endpoint changed from '/woonoow/v1/rajaongkir/destinations' to '/rajaongkir/destinations' (relative to API base) - min_chars increased from 2 to 3 to reduce early API hits --- RAJAONGKIR_INTEGRATION.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RAJAONGKIR_INTEGRATION.md b/RAJAONGKIR_INTEGRATION.md index 887c059..2dba5d3 100644 --- a/RAJAONGKIR_INTEGRATION.md +++ b/RAJAONGKIR_INTEGRATION.md @@ -50,7 +50,7 @@ add_action('rest_api_init', function() { function woonoow_rajaongkir_search_destinations($request) { $search = sanitize_text_field($request->get_param('search') ?? ''); - if (strlen($search) < 2) { + if (strlen($search) < 3) { return []; } @@ -112,9 +112,10 @@ add_filter('woocommerce_checkout_fields', function($fields) { 'class' => ['form-row-wide'], 'placeholder' => __('Search destination...', 'woonoow'), // WooNooW-specific: API endpoint configuration - 'search_endpoint' => '/woonoow/v1/rajaongkir/destinations', + // NOTE: Path is relative to /wp-json/woonoow/v1 + 'search_endpoint' => '/rajaongkir/destinations', 'search_param' => 'search', - 'min_chars' => 2, + 'min_chars' => 3, // Custom attribute to indicate this is for Indonesia only 'custom_attributes' => [ 'data-show-for-country' => 'ID',