جستجو در محصولات

%6

سرویس ۵۲پارچه طرح فلاور طوسی لب پلاتینی و نیلوفری صدفی
۱۱٬۷۰۸٬۰۰۰
۱۲٬۵۷۶٬۰۰۰

%1

"سرویس آرکوپال ۵۲ پارچه ۱۲ نفره ترکیبی دیوالی شامپاینی و صدفی - کیفیت بالا و طراحی
۱۲٬۲۴۷٬۰۰۰
۱۲٬۴۹۵٬۰۰۰

%2

سرویس ۲۶ پارچه ۶ نفره ارکوپال طرح نیلوفری | رنگ شامپاینی و صدفی | ۷ رنگ متنوع
۶٬۵۰۴٬۰۰۰
۶٬۶۳۷٬۰۰۰
📌 سرویس قابلمه ۱۰ پارچه زیو ترکیه سایز 20-24-28-32 با تابه 28
۱۷٬۸۴۴٬۰۰۰

%1

سرویس قاشق و چنگال یونیک 144 پارچه 24 نفره استیل نگیر ضخیم 6 کیلویی | طرح ماینز ناخونی دونا شیکاگو
۱۹٬۴۳۸٬۰۰۰
۱۹٬۸۳۴٬۰۰۰
جاادویه
جا ادویه چرخشی 20 عددی استیل طلایی با پایه بامبو مربعی | وارداتی درجه یک
۲٬۹۶۱٬۰۰۰
🧵 چرخ خیاطی مینی فانتزی Brother (برادر)
۷٬۹۵۹٬۰۰۰

%1

سرویس ۲۶ پارچه نیلوفری طرح درخت طلایی لب‌طلایی | سرویس ۶ نفره شیک
۶٬۳۰۰٬۰۰۰
۶٬۴۲۷٬۰۰۰
سرویس قابلمه ۱۲ پارچه آبرون Abroon – چدن داخل گرانیت، طرح دیاموند، رنگ سرمه‌ای و مشکی
۱۴٬۹۹۸٬۰۰۰

%1

جاروبرقی کیسه‌دار فیلیپس 3300 وات مدل FC9922 - پاکیزگی کامل با فیلتر HEPA * **توضیحات:**
۲۰٬۸۳۰٬۰۰۰
۲۱٬۲۵۴٬۰۰۰

%1

رنده برقی سالادساز یونیک | موتور قدرتمند | چندین تیغه استیل ضدزنگ | خردکن و اسلایسر سریع خانگی
۸٬۲۷۰٬۰۰۰
۸٬۴۳۸٬۰۰۰

%1

🧵 چرخ خیاطی برادر مینی فانتزی – کوچک، قدرتمند، کاربردی!
۱۳٬۳۲۹٬۰۰۰
۱۳٬۶۰۱٬۰۰۰

%1

**سماور گازی ۶ لیتری ناروان مدل ورق ضخیم - با کیفیت و بادوام**
۹٬۰۹۸٬۰۰۰
۹٬۲۸۱٬۰۰۰
خردکن برقی سان لایف ۳.۳ لیتر | ۶ تیغه استیل | کاسه پیرکس | ۱۸۰۰ وات | مناسب سبزیجات، میوه، آجیل و گوشت
۲٬۸۰۸٬۰۰۰
سرخ‌کن 16 لیتر فیلیپس اصل | منوی رنگی دیجیتال | سبد بزرگ و دوقلو | سه‌شاخه اروپایی
۱۷٬۸۲۹٬۰۰۰

%1

سرویس ۲۶ پارچه ۶ نفره ارکوپال طرح نیلوفری | رنگ شامپاینی و صدفی | ۷ رنگ متنوع
۱۳٬۲۶۲٬۰۰۰
۱۳٬۵۳۲٬۰۰۰
سرویس پذیرایی
۲٬۰۰۰

%1

**چای ساز روهمی یونیک مدل پیرکس - ۲۰۰۰ وات، تمام لمسی دیجیتال، با قابلیت تنظیم دما**
۹٬۰۹۸٬۰۰۰
۹٬۲۸۱٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

پلوپز تمام لمسی دیجیتال سان رایس SP150 - ۵ لیتر - منوی فارسی - سبد سرخ کن - استیل مشکی
۱۹٬۹۵۵٬۰۰۰
۲۰٬۳۶۲٬۰۰۰

%1

سرویس قاشق و چنگال ۱۴۴ پارچه ۲۴ نفره برند یونی
۱۴٬۲۷۹٬۰۰۰
۱۴٬۵۷۰٬۰۰۰

%1

سرخکن سیلورکرست 15لیتری
۱۶٬۳۲۴٬۰۰۰
۱۶٬۵۲۸٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو طرح گل‌دار آبی (6 نفره
۶٬۱۷۳٬۰۰۰
۶٬۲۹۸٬۰۰۰

%1

سرویس ۲۸ پارچه غذاخوری چینی زرین طرح هدیه طلایی، مناسب ۶ نفره
۱۰٬۸۳۶٬۰۰۰
۱۱٬۰۵۶٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس قاشق و چنگال یونیک ۲۴ نفره ۱۲۰ پارچه سیلور – استیل نگیر ۴ میل دهانه اروپایی
۱۶٬۲۶۸٬۰۰۰
۱۶٬۵۹۹٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس چینی بن‌چاین ۱۸ نفره ۱۴۵ پارچه مدل مارگارت و الیزابت پلاس لب طلا
۱۱۵٬۴۱۸٬۹۳۶٬۰۰۰
۱۱۷٬۷۷۴٬۴۲۴٬۰۰۰

%1

اسپیکر شارژی 40 سانتی مدل 4239 به‌همراه میکروفن بی‌سیم
۵٬۱۷۹٬۰۰۰
۵٬۲۸۴٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

آرکوپال شامپاینی ۲۶ پارچه مدل Golden Opal Coconut
۴٬۹۶۰٬۰۰۰
۵٬۰۶۱٬۰۰۰

%1

سرویس پذیرایی ۲۳ پارچه لب‌طلا طرح خاص ساخت ژاپن – کیفیت عالی و رنگ‌بندی متنوع
۱۰٬۴۶۲٬۰۰۰
۱۰٬۶۷۵٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو طرح گل‌دار آبی (6 نفره
۶٬۱۷۳٬۰۰۰
۶٬۲۹۸٬۰۰۰

%1

سرویس قابلمه ۱۰ پارچه مربع زیو ترکیه | تمام گرانیت، نچسب و ضدخش
۲۷٬۳۷۲٬۰۰۰
۲۷٬۹۳۰٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو طرح گل‌دار آبی (6 نفره
۶٬۱۷۳٬۰۰۰
۶٬۲۹۸٬۰۰۰

%1

سرویس قاشق و چنگال یونیک ۲۴ نفره ۱۲۰ پارچه سیلور – استیل نگیر ۴ میل دهانه اروپایی
۱۶٬۲۶۸٬۰۰۰
۱۶٬۵۹۹٬۰۰۰
سرویس قاشق و چنگال ۱۴۴ پارچه یونیک (۲۴ نفره) - استیل ضدزنگ (نگیر)**

%1

سرویس قاشق و چنگال ۱۴۴ پارچه یونیک (۲۴ نفره) - استیل ضدزنگ (نگیر)**
۱۳٬۸۷۱٬۰۰۰
۱۴٬۱۵۴٬۰۰۰

%1

سرویس آرکوپال۲۶ پارچه دینو طرح (6 نفره
۵٬۰۵۱٬۰۰۰
۵٬۱۵۳٬۰۰۰

%1

سرویس 29 پارچه لورین قالب کویین صادراتی | طرح بسیار زیبا چشمک
۱۱٬۶۹۱٬۰۰۰
۱۱٬۹۲۹٬۰۰۰

%1

سرویس قاشق و چنگال ۳۰ نفره سولینگن آلمان مدل لاکچری ۱۴۶ پارچه  
۲۸٬۲۷۰٬۰۰۰
۲۸٬۸۴۶٬۰۰۰

%2

سرویس ۱۰۲ پارچه چینی زرین مدل کویین | ۱۸ نفره درجه عالی
۵۸٬۳۴۷٬۰۰۰
۵۹٬۵۳۸٬۰۰۰

%1

سرویس ۲۶ پارچه آرکوپال بست اپال درجه عالی
۱۰٬۶۴۴٬۰۰۰
۱۰٬۸۶۰٬۰۰۰

%1

سرویس 29 پارچه لورین قالب ریچنبرگ صادراتی | طرح بسیار زیبا آروند
۹٬۸۵۰٬۰۰۰
۱۰٬۰۵۱٬۰۰۰

%1

سرویس غذاخوری ۶ نفره ۲۵ پارچه   تولید شرکت **برند دینو**
۵٬۱۲۳٬۰۰۰
۵٬۲۲۷٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰

%1

سرویس غذاخوری ۶ نفره ۲۵ پارچه   تولید شرکت **برند دینو**
۵٬۱۲۳٬۰۰۰
۵٬۲۲۷٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس غذاخوری ۶ نفره ۲۵ پارچه   تولید شرکت **برند دینو**
۵٬۱۲۳٬۰۰۰
۵٬۲۲۷٬۰۰۰

%2

سرویس ۹۹ پارچه لورین قالب کویین صادراتی | طرح بسیار زیبا چشمک
۳۶٬۳۴۴٬۰۰۰
۳۷٬۰۸۶٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس ۹۵ پارچه لورین قالب ریچنبرگ صادراتی | طرح بسیار زیبا آروند
۲۸٬۸۹۵٬۰۰۰
۲۹٬۴۸۳٬۰۰۰

%1

سالاد ساز 6 کاره چندمنظوره – موجود در دو رنگ
۹٬۸۳۸٬۰۰۰
۱۰٬۰۳۸٬۰۰۰

%1

سرویس غذاخوری ۱۰۸ پارچه چینی زرین ایران مدل Samarkand درجه عالی ۱۲ نفره
۳۱٬۵۵۳٬۰۰۰
۳۲٬۱۹۶٬۰۰۰
سرویس_چهارتکه

%1

سرویس چهار تکه دسته‌ دار طرح گندم
۱۰٬۰۹۸٬۰۰۰
۱۰٬۳۰۳٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰
سرخ‌کن 15 لیتری سه‌شاخه اروپایی مدل Dualment | ظرفیت بالا، عملکرد حرفه‌ای

%1

سرخ‌کن 15 لیتری سه‌شاخه اروپایی مدل Dualment | ظرفیت بالا، عملکرد حرفه‌ای
۱۹٬۹۵۵٬۰۰۰
۲۰٬۳۶۲٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۶۳۱٬۰۰۰
۶٬۷۶۶٬۰۰۰
سرخ کن بدون روغن گوسونیک مدل GAF-879 (ظرفیت ۹ لیتر، دو المنت ۲۱۰۰ وات، صفحه نمایش لمسی رنگ

%1

سرخ کن بدون روغن گوسونیک مدل GAF-879 (ظرفیت ۹ لیتر، دو المنت ۲۱۰۰ وات، صفحه نمایش لمسی رنگی) ✨
۱۴٬۲۷۹٬۰۰۰
۱۴٬۵۷۰٬۰۰۰

%1

سرویس آرکوپال 25 پارچه دینو طرح گل‌دار سورمه‌ای (6 نفره
۵٬۲۷۶٬۰۰۰
۵٬۳۸۳٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰

%1

سرویس چهار تکه دسته‌ دار طرح گندم
۱۰٬۰۹۸٬۰۰۰
۱۰٬۳۰۳٬۰۰۰
سرویس پذیرایی ۲۳ پارچه ژاپنی

%2

سرویس پذیرایی ۲۳ پارچه ژاپنی | تجمل و کیفیت
۸٬۶۷۰٬۰۰۰
۸٬۸۴۷٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰

%1

سرویس آرکوپال 26پارچه کارن قالب مربع طرح شامپاینی گلدن اوپال
۶٬۳۲۵٬۰۰۰
۶٬۴۵۴٬۰۰۰
https://lavasemkhangi.ir/search/

%2

سرویس پذیرایی ۲۳ پارچه ژاپنی سوگا (SOGA)
۸٬۶۷۰٬۰۰۰
۸٬۸۴۷٬۰۰۰

%2

سرویس پذیرایی ۲۳ پارچه ژاپنی سوگا (SOGA)
۸٬۶۷۰٬۰۰۰
۸٬۸۴۷٬۰۰۰

%2

سرویس پذیرایی ۲۳ پارچه ژاپنی
۸٬۶۷۰٬۰۰۰
۸٬۸۴۷٬۰۰۰

%1

ناموجود
خردکن برقی بوش حک شده مدل G-3000 | ۲ کاسه ۳ لیتری، ۶ تیغ استیل طلایی، ۴ تیغ اضافه + سیر پاکن | کیفیت عالی، موتور پرقدرت، فروش ویژه
ناموجود
ناموجود
سرخ‌کن دو المنت فیلیپس 3000 وات | کنترل لمسی، فن دوطرفه، پخت سالم با 80٪ چربی کمتر
ناموجود

لوازم خانگی

<?php

/* =====================================================

   Intelligent Feed Generator for Torob + Google Merchant

   Optimized & Auto‑Update with Hash Cache

   Author: YourSystem

===================================================== */

 

// ========================

// تنظیمات

// ========================

$mixins_json_url = "https://lavasemkhangi.ir/mixin-products.json";

$torob_api = "https://seller.torob.com/api/upload_feed?token=YOUR_API_TOKEN";

 

$torob_feed_file = __DIR__ . "/torob-feed.xml";

$google_feed_file = __DIR__ . "/google-feed.xml";

$log_file = __DIR__ . "/feed-log.txt";

$hash_file = __DIR__ . "/last-hash.txt";

 

 

// ========================

// تابع لاگ‌نویسی سطحی

// ========================

function log_msg($level, $msg) {

    global $log_file;

    $line = "[" . date("Y-m-d H:i:s") . "] [$level] $msg\n";

    file_put_contents($log_file, $line, FILE_APPEND);

}

 

 

// ========================

// دریافت JSON محصولات

// ========================

$json = @file_get_contents($mixins_json_url);

 

if ($json === false) {

    log_msg("ERROR", "Cannot fetch JSON.");

    exit("JSON fetch failed.");

}

 

$products = json_decode($json, true);

if (!is_array($products)) {

    log_msg("ERROR", "Invalid JSON structure.");

    exit("JSON invalid.");

}

 

 

// ========================

// کش هوشمند برای جلوگیری از کار اضافه

// ========================

$new_hash = md5($json);

$old_hash = file_exists($hash_file) ? trim(file_get_contents($hash_file)) : "";

 

if ($new_hash === $old_hash) {

    log_msg("INFO", "No data change. Skip build.");

    exit("No change — skip");

}

 

file_put_contents($hash_file, $new_hash);

log_msg("INFO", "Changes detected — rebuilding feeds.");

 

 

// ========================

// تابع کمک‌ساز XML

// ========================

function xml_add($dom, $parent, $tag, $value) {

    $el = $dom->createElement($tag);

    $el->appendChild($dom->createTextNode($value));

    $parent->appendChild($el);

}

 

 

// =====================================================

// ساخت فید مخصوص ترب

// =====================================================

$dom_t = new DOMDocument("1.0", "UTF-8");

$dom_t->formatOutput = true;

$root_t = $dom_t->createElement("products");

 

foreach ($products as $p) {

 

    if (($p['status'] ?? "") !== "active") continue;

    if (($p['stock'] ?? 0) <= 0) continue;

 

    $item = $dom_t->createElement("product");

 

    xml_add($dom_t, $item, "id", $p['id']);

    xml_add($dom_t, $item, "name", $p['title']);

    xml_add($dom_t, $item, "price", $p['price']);

    xml_add($dom_t, $item, "brand", $p['brand']);

    xml_add($dom_t, $item, "category", $p['category']);

    xml_add($dom_t, $item, "url", $p['link']);

    xml_add($dom_t, $item, "image", $p['image']);

    xml_add($dom_t, $item, "availability", "instock");

 

    $root_t->appendChild($item);

}

 

$dom_t->appendChild($root_t);

$dom_t->save($torob_feed_file);

log_msg("INFO", "Torob feed generated.");

 

 

// =====================================================

// ساخت فید گوگل Merchant Center

// =====================================================

$dom_g = new DOMDocument("1.0", "UTF-8");

$dom_g->formatOutput = true;

 

$rss = $dom_g->createElement("rss");

$rss->setAttribute("version", "2.0");

$rss->setAttribute("xmlns:g", "http://base.google.com/ns/1.0");

 

$channel = $dom_g->createElement("channel");

 

xml_add($dom_g, $channel, "title", "LavasemKhangi Product Feed");

xml_add($dom_g, $channel, "link", "https://lavasemkhangi.ir");

xml_add($dom_g, $channel, "description", "Google Shopping Feed");

 

foreach ($products as $p) {

 

    if (($p['status'] ?? "") !== "active") continue;

    if (($p['stock'] ?? 0) <= 0) continue;

 

    $item = $dom_g->createElement("item");

 

    xml_add($dom_g, $item, "g:id", $p['id']);

    xml_add($dom_g, $item, "g:title", $p['title']);

    xml_add($dom_g, $item, "g:description", $p['title']);

    xml_add($dom_g, $item, "g:link", $p['link']);

    xml_add($dom_g, $item, "g:image_link", $p['image']);

    xml_add($dom_g, $item, "g:brand", $p['brand']);

    xml_add($dom_g, $item, "g:price", $p['price'] . " IRR");

    xml_add($dom_g, $item, "g:availability", "in stock");

 

    $channel->appendChild($item);

}

 

$rss->appendChild($channel);

$dom_g->appendChild($rss);

$dom_g->save($google_feed_file);

 

log_msg("INFO", "Google feed generated.");

 

 

// =====================================================

// آپلود خودکار فید به ترب

// =====================================================

$ch = curl_init();

curl_setopt_array($ch, [

    CURLOPT_URL => $torob_api,

    CURLOPT_POST => true,

    CURLOPT_POSTFIELDS => [

        'feed_file' => new CURLFile($torob_feed_file)

    ],

    CURLOPT_RETURNTRANSFER => true

]);

 

$response = curl_exec($ch);

$error = curl_error($ch);

curl_close($ch);

 

if ($error) {

    log_msg("ERROR", "Torob upload failed: $err<?php

/* =====================================================

   Intelligent Feed Generator for Torob + Google Merchant

   Optimized & Auto‑Update with Hash Cache

   Author: YourSystem

===================================================== */

 

// ========================

// تنظیمات

// ========================

$mixins_json_url = "https://lavasemkhangi.ir/mixin-products.json";

$torob_api = "https://seller.torob.com/api/upload_feed?token=YOUR_API_TOKEN";

 

$torob_feed_file = __DIR__ . "/torob-feed.xml";

$google_feed_file = __DIR__ . "/google-feed.xml";

$log_file = __DIR__ . "/feed-log.txt";

$hash_file = __DIR__ . "/last-hash.txt";

 

 

// ========================

// تابع لاگ‌نویسی سطحی

// ========================

function log_msg($level, $msg) {

    global $log_file;

    $line = "[" . date("Y-m-d H:i:s") . "] [$level] $msg\n";

    file_put_contents($log_file, $line, FILE_APPEND);

}

 

 

// ========================

// دریافت JSON محصولات

// ========================

$json = @file_get_contents($mixins_json_url);

 

if ($json === false) {

    log_msg("ERROR", "Cannot fetch JSON.");

    exit("JSON fetch failed.");

}

 

$products = json_decode($json, true);

if (!is_array($products)) {

    log_msg("ERROR", "Invalid JSON structure.");

    exit("JSON invalid.");

}

 

 

// ========================

// کش هوشمند برای جلوگیری از کار اضافه

// ========================

$new_hash = md5($json);

$old_hash = file_exists($hash_file) ? trim(file_get_contents($hash_file)) : "";

 

if ($new_hash === $old_hash) {

    log_msg("INFO", "No data change. Skip build.");

    exit("No change — skip");

}

 

file_put_contents($hash_file, $new_hash);

log_msg("INFO", "Changes detected — rebuilding feeds.");

 

 

// ========================

// تابع کمک‌ساز XML

// ========================

function xml_add($dom, $parent, $tag, $value) {

    $el = $dom->createElement($tag);

    $el->appendChild($dom->createTextNode($value));

    $parent->appendChild($el);

}

 

 

// =====================================================

// ساخت فید مخصوص ترب

// =====================================================

$dom_t = new DOMDocument("1.0", "UTF-8");

$dom_t->formatOutput = true;

$root_t = $dom_t->createElement("products");

 

foreach ($products as $p) {

 

    if (($p['status'] ?? "") !== "active") continue;

    if (($p['stock'] ?? 0) <= 0) continue;

 

    $item = $dom_t->createElement("product");

 

    xml_add($dom_t, $item, "id", $p['id']);

    xml_add($dom_t, $item, "name", $p['title']);

    xml_add($dom_t, $item, "price", $p['price']);

    xml_add($dom_t, $item, "brand", $p['brand']);

    xml_add($dom_t, $item, "category", $p['category']);

    xml_add($dom_t, $item, "url", $p['link']);

    xml_add($dom_t, $item, "image", $p['image']);

    xml_add($dom_t, $item, "availability", "instock");

 

    $root_t->appendChild($item);

}

 

$dom_t->appendChild($root_t);

$dom_t->save($torob_feed_file);

log_msg("INFO", "Torob feed generated.");

 

 

// =====================================================

// ساخت فید گوگل Merchant Center

// =====================================================

$dom_g = new DOMDocument("1.0", "UTF-8");

$dom_g->formatOutput = true;

 

$rss = $dom_g->createElement("rss");

$rss->setAttribute("version", "2.0");

$rss->setAttribute("xmlns:g", "http://base.google.com/ns/1.0");

 

$channel = $dom_g->createElement("channel");

 

xml_add($dom_g, $channel, "title", "LavasemKhangi Product Feed");

xml_add($dom_g, $channel, "link", "https://lavasemkhangi.ir");

xml_add($dom_g, $channel, "description", "Google Shopping Feed");

 

foreach ($products as $p) {

 

    if (($p['status'] ?? "") !== "active") continue;

    if (($p['stock'] ?? 0) <= 0) continue;

 

    $item = $dom_g->createElement("item");

 

    xml_add($dom_g, $item, "g:id", $p['id']);

    xml_add($dom_g, $item, "g:title", $p['title']);

    xml_add($dom_g, $item, "g:description", $p['title']);

    xml_add($dom_g, $item, "g:link", $p['link']);

    xml_add($dom_g, $item, "g:image_link", $p['image']);

    xml_add($dom_g, $item, "g:brand", $p['brand']);

    xml_add($dom_g, $item, "g:price", $p['price'] . " IRR");

    xml_add($dom_g, $item, "g:availability", "in stock");

 

    $channel->appendChild($item);

}

 

$rss->appendChild($channel);

$dom_g->appendChild($rss);

$dom_g->save($google_feed_file);

 

log_msg("INFO", "Google feed generated.");

 

 

// =====================================================

// آپلود خودکار فید به ترب

// =====================================================

$ch = curl_init();

curl_setopt_array($ch, [

    CURLOPT_URL => $torob_api,

    CURLOPT_POST => true,

    CURLOPT_POSTFIELDS => [

        'feed_file' => new CURLFile($torob_feed_file)

    ],

    CURLOPT_RETURNTRANSFER => true

]);

 

$response = curl_exec($ch);

$error = curl_error($ch);

curl_close($ch);

 

if ($error) {

    log_msg("ERROR", "Torob upload failed: $error");

    exit("Torob upload failed.");

}

 

log_msg("INFO", "Torob upload OK. Response: $response");

 

 

// =====================================================

// پینگ خودکار گوگل جهت بروزرسانی

// =====================================================

$ping_url = "https://www.google.com/ping?sitemap=" . urlencode("https://lavasemkhangi.ir/google-feed.xml");

@file_get_contents($ping_url);

log_msg("INFO", "Google ping sent.");

 

echo "Feed built, uploaded to Torob, and Google notified.";

?>

 

 

const response = await fetch(seoApiUrl, {

                method: "POST",

                headers: { "Content-Type": "application/json" },

                body: JSON.stringify(productDataForApi)

            });

 

            if (response.ok) {

                const seoData = await response.json();

 

                // آپدیت متا دیکریپشن و کلمات کلیدی

                let metaDesc = document.querySelector('meta[name="description"]');

                if (!metaDesc) {

                    metaDesc = document.createElement("meta");

                    metaDesc.name = "description";

                    document.head.appendChild(metaDesc);

                }

                metaDesc.content = seoData.meta_description || pageDescription; // استفاده از متا تولید شده یا قبلی

 

                let metaKeywords = document.querySelector('meta[name="keywords"]');

                if (!metaKeywords) {

                    metaKeywords = document.createElement("meta");

                    metaKeywords.name = "keywords";

                    document.head.appendChild(metaKeywords);

                }

                metaKeywords.content = seoData.seo_keywords || ""; // اضافه کردن کلمات کلیدی

 

                // آپدیت OG Description اگر API توضیحات بهتری داد

                if (seoData.description) {

                    setOGMeta("og:description", seoData.description);

                    pageDescription = seoData.description; // برای استفاده در اسکیما

                }

 

                // --- افزودن Schema Markup برای محصول ---

                const productSchema = {

                    "@context": "https://schema.org",

                    "@type": "Product",

                    "name": pageTitle,

                    "image": pageImage ? [pageImage] : [], // تصویر باید در آرایه باشد

                    "description": pageDescription,

                    "sku": seoData.sku || "", // اگر API کد SKU داد

                    "brand": {

                        "@type": "Brand",

                        "name": seoData.brand_name || "نام برند" // اگر API اسم برند داد

                    },

                    "offers": {

                        "@type": "Offer",

                        "url": url,

                        "priceCurrency": "IRR", // یا IRT

                        "price": price seoData.price "", // اول قیمت استخراج شده، بعد از API، یا خالی

                        "availability": "https://schema.org/InStock", // فرض بر موجود بودن

                        "seller": { // اضافه کردن اطلاعات فروشنده

                            "@type": "Organization",

                            "name": "نام فروشگاه شما", // اسم فروشگاه خودتان را اینجا بگذارید

                            "url": window.location.origin // آدرس سایت شما

                        }

                    },

                    // اضافه کردن ویژگی‌های دیگر محصول اگر از API گرفتید

                    // "color": seoData.color,

                    // "material": seoData.material,

                };

 

                // حذف فیلدهای خالی از اسکیما

                Object.keys(productSchema).forEach(key => {

                    if (productSchema[key] === "" || (typeof productSchema[key] === 'object' && Object.keys(productSchema[key]).length === 0 && key !== 'image')) {

                        delete productSchema[key];

                    }

                });

                 Object.keys(productSchema.offers).forEach(key => {

                    if (productSchema.offers[key] === "" || (typeof productSchema.offers[key] === 'object' && Object.keys(productSchema.offers[key]).length === 0)) {

                        delete productSchema.offers[key];

                    }

                });

                 if (productSchema.offers.seller && Object.keys(productSchema.offers.seller).length === 0) {

                    delete productSchema.offers.seller;

                }

OK. Response: $response");

 

 

// =====================================================

// پینگ خودکار گوگل جهت بروزرسانی

// =====================================================

$ping_url = "https://www.google.com/ping?sitemap=" . urlencode("https://lavasemkhangi.ir/google-feed.xml");

@file_get_contents($ping_url);

log_msg("INFO", "Google ping sent.");

 

echo "Feed built, uploaded to Torob, and Google notified.";

?>

 

 

const response = await fetch(seoApiUrl, {

                method: "POST",

                headers: { "Content-Type": "application/json" },

                body: JSON.stringify(productDataForApi)

            });

 

            if (response.ok) {

                const seoData = await response.json();

 

                // آپدیت متا دیکریپشن و کلمات کلیدی

                let metaDesc = document.querySelector('meta[name="description"]');

                if (!metaDesc) {

                    metaDesc = document.createElement("meta");

                    metaDesc.name = "description";

                    document.head.appendChild(metaDesc);

                }

                metaDesc.content = seoData.meta_description || pageDescription; // استفاده از متا تولید شده یا قبلی

 

                let metaKeywords = document.querySelector('meta[name="keywords"]');

                if (!metaKeywords) {

                    metaKeywords = document.createElement("meta");

                    metaKeywords.name = "keywords";

                    document.head.appendChild(metaKeywords);

                }

                metaKeywords.content = seoData.seo_keywords || ""; // اضافه کردن کلمات کلیدی

 

                // آپدیت OG Description اگر API توضیحات بهتری داد

                if (seoData.description) {

                    setOGMeta("og:description", seoData.description);

                    pageDescription = seoData.description; // برای استفاده در اسکیما

                }

 

                // --- افزودن Schema Markup برای محصول ---

                const productSchema = {

                    "@context": "https://schema.org",

                    "@type": "Product",

                    "name": pageTitle,

                    "image": pageImage ? [pageImage] : [], // تصویر باید در آرایه باشد

                    "description": pageDescription,

                    "sku": seoData.sku || "", // اگر API کد SKU داد

                    "brand": {

                        "@type": "Brand",

                        "name": seoData.brand_name || "نام برند" // اگر API اسم برند داد

                    },

                    "offers": {

                        "@type": "Offer",

                        "url": url,

                        "priceCurrency": "IRR", // یا IRT

                        "price": price seoData.price "", // اول قیمت استخراج شده، بعد از API، یا خالی

                        "availability": "https://schema.org/InStock", // فرض بر موجود بودن

                        "seller": { // اضافه کردن اطلاعات فروشنده

                            "@type": "Organization",

                            "name": "نام فروشگاه شما", // اسم فروشگاه خودتان را اینجا بگذارید

                            "url": window.location.origin // آدرس سایت شما

                        }

                    },

                    // اضافه کردن ویژگی‌های دیگر محصول اگر از API گرفتید

                    // "color": seoData.color,

                    // "material": seoData.material,

                };

 

                // حذف فیلدهای خالی از اسکیما

                Object.keys(productSchema).forEach(key => {

                    if (productSchema[key] === "" || (typeof productSchema[key] === 'object' && Object.keys(productSchema[key]).length === 0 && key !== 'image')) {

                        delete productSchema[key];

                    }

                });

                 Object.keys(productSchema.offers).forEach(key => {

                    if (productSchema.offers[key] === "" || (typeof productSchema.offers[key] === 'object' && Object.keys(productSchema.offers[key]).length === 0)) {

                        delete productSchema.offers[key];

                    }

                });

                 if (productSchema.offers.seller && Object.keys(productSchema.offers.seller).length === 0) {

                    delete productSchema.offers.seller;

                }

پروفایلسبد خریددسته‌بندیخانه