"https://schema.org/", "@type"=>"Product", "name"=>$product['title'], "image"=>$product['image'], "description"=>substr(strip_tags($description),0,500), "sku"=>$product['sku'] ?? '', "brand"=>["@type"=>"Brand","name"=>$product['brand']], "offers"=>[ "@type"=>"Offer", "url"=>$product['url'], "priceCurrency"=>"IRR", "price"=>$product['price'], "availability"=>"https://schema.org/InStock" ] ]; echo ''; // 3️⃣ آپدیت خودکار فید ترب $feedXml = simplexml_load_file(FEED_FILE) ?: new SimpleXMLElement(''); $productXml = $feedXml->addChild('product'); $productXml->addChild('name',$product['title']); $productXml->addChild('url',$product['url']); $productXml->addChild('price',$product['price']); $productXml->addChild('image',$product['image']); $productXml->addChild('brand',$product['brand']); $productXml->addChild('availability','instock'); $productXml->addChild('description',strip_tags($description)); $feedXml->asXML(FEED_FILE); // 4️⃣ ارسال خودکار ایندکس گوگل $client = new Google_Client(); $client->setAuthConfig(GOOGLE_CREDENTIALS); $client->addScope('https://www.googleapis.com/auth/indexing'); $indexingService = new Google_Service_Indexing($client); $urlNotification = new Google_Service_Indexing_UrlNotification(); $urlNotification->setUrl($product['url']); $urlNotification->setType("URL_UPDATED"); try { $indexingService->urlNotifications->publish($urlNotification); } catch(Exception $e){ error_log("Indexing API error: ".$e->getMessage()); } } // تابع گرفتن 100 محصول پرفروش میکسین (خودکار) function get_top_100_products(){ // اینجا با دیتابیس میکسین ارتباط داره // و 100 محصول پرفروش رو برمیگردونه return query_top_100_products_from_db(); // فرضی } // اجرای خودکار روی همه محصولات $products = get_top_100_products(); foreach($products as $product){ autoSeoIndexTorob($product); } ?> . . .
جستجو در محصولات
کالایی در این صفحه موجود نیست
    پروفایلسبد خریددسته‌بندیخانه