Catalog Name:*Unique Kurta Sets*
Top Fabric: Georgette
Dupatta: With Dupatta
Top Shape: A-line
Bottom Type: dhoti pants
Top Length: above knee
Top Pattern: Embroidered
Sleeve Length: Sleeveless
// 1. Category पेज से सारे प्रोडक्ट्स के लिंक निकालना (CHECKING SYSTEM) public static function get_product_urls_from_category( $category_url ) { $response = wp_remote_get( $category_url, array( 'timeout' => 30, 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', 'headers' => array( 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', 'Accept-Language' => 'en-US,en;q=0.5', ) )); // 🌟 Error Check 1: Server Connection Error if ( is_wp_error( $response ) ) { JWS_Woo_Sync::log("Connection Error: " . $response->get_error_message()); return array(); } // 🌟 Error Check 2: JioMart Status Code $status_code = wp_remote_retrieve_response_code( $response ); JWS_Woo_Sync::log("JioMart Connection Status: " . $status_code); $html = wp_remote_retrieve_body( $response ); JWS_Woo_Sync::log("Received HTML Data Size: " . strlen($html)); $urls = array(); // ज़्यादा स्ट्रॉन्ग लिंक फाइंडर preg_match_all('/href="([^"]*\/p\/[^"]+)"/i', $html, $matches); if (!empty($matches[1])) { foreach ($matches[1] as $href) { // अगर लिंक में http नहीं है, तो jiomart जोड़ें if (strpos($href, 'http') === false) { $urls[] = 'https://www.jiomart.com' . $href; } else { $urls[] = $href; } } } $urls = array_unique($urls); return $urls; }