/**
* Plugin Name: Auto Price Update - TGJU
* Description: بهروزرسانی خودکار قیمت محصولات ووکامرس بر اساس نرخ دلار از tgju.org با سود ثابت ۵٪.
* Version: 1.0
* Author: ChatGPT for Doctor
*/
if (!defined('ABSPATH')) exit;
add_action('init', 'apu_schedule_price_update');
add_action('apu_hourly_event', 'apu_update_product_prices');
function apu_schedule_price_update() {
if (!wp_next_scheduled('apu_hourly_event')) {
wp_schedule_event(time(), 'hourly', 'apu_hourly_event');
}
}
function apu_update_product_prices() {
$rate = apu_get_dollar_rate_from_tgju();
if (!$rate) return;
$args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => 'موبایل'
)
),
'posts_per_page' => -1
);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
global $product;
$product_id = get_the_ID();
$regular_price = get_post_meta($product_id, '_regular_price', true);
if (!$regular_price || $regular_price == 0) continue;
$base_price_dollar = $regular_price / $rate; // فرض اینکه قیمت فعلی بر حسب تومان است
$new_price = $base_price_dollar * $rate * 1.05; // اضافه کردن سود ۵٪
update_post_meta($product_id, '_regular_price', $new_price);
update_post_meta($product_id, '_price', $new_price);
endwhile;
wp_reset_query();
}
function apu_get_dollar_rate_from_tgju() {
$response = wp_remote_get('https://www.tgju.org/currency/dollar');
if (is_wp_error($response)) return false;
$body = wp_remote_retrieve_body($response);
if (preg_match('/
([\d,]+)<\/td>/', $body, $matches)) {
$rate_str = str_replace(',', '', $matches[1]);
return floatval($rate_str);
}
return false;
}
register_deactivation_hook(__FILE__, 'apu_deactivation');
function apu_deactivation() {
wp_clear_scheduled_hook('apu_hourly_event');
}
خرید سامسونگ (ویتنام) A25 5G | حافظه 128 رم 8 گیگابایت
[EMS_Form_Builder id=2]
گوشی سامسونگ (ویتنام) A25 5G | حافظه 128 رم 8 گیگابایتتومان ۰
ویژگی خرید سامسونگ (ویتنام) A25 5G | حافظه 128 رم 8 گیگابایت
-
ابعاد : 161 * 76.5 * 8.3 میلیمتر (6.34 * 3.01 * 0.33 اینچ)
وزن : 197 گرم
سیم : نانو سیم کارت
-
صفحه نمایش
مدل : Super AMOLED, 120Hz, 1000 nits (HBM)
اندازه : 6.5 اینچ , 103.7 سانت مربع (~84.2% screen-to-body ratio)
کیفیت تصویر : 1080 x 2340 پیکسل , 19.5:9 ریت (~396 ppi density)
-
پلتفرم
سیستم عامل : Android 14, One UI 6
ناموجود
توضیحات
-
فناوری شبکه
Technology
GSM / HSPA / LTE / 5G
2G bands GSM 850 / 900 / 1800 / 1900 – SIM 1 & SIM 2 (dual-SIM only)
3G bands HSDPA 850 / 900 / 1700(AWS) / 1900 / 2100
-
4G bands 1, 2, 3, 4, 5, 7, 8, 12, 13, 17, 20, 26, 28, 38, 40, 41, 66
5G bands 1, 3, 5, 7, 8, 26, 28, 40, 41, 66, 77, 78 SA/NSA/Sub6
Speed HSPA, LTE, 5G
-
معرفی
تاریخ معرفی : آذر 1402 – دسامبر 2023
تاریخ عرضه : آذر 1402 – دسامبر 2023
-
بدنه
ابعاد : 161 * 76.5 * 8.3 میلیمتر (6.34 * 3.01 * 0.33 اینچ)
وزن : 197 گرم
سیم : نانو سیم کارت
-
صفحه نمایش
مدل : Super AMOLED, 120Hz, 1000 nits (HBM)
اندازه : 6.5 اینچ , 103.7 سانت مربع (~84.2% screen-to-body ratio)
کیفیت تصویر : 1080 x 2340 پیکسل , 19.5:9 ریت (~396 ppi density)
-
پلتفرم
سیستم عامل : Android 14, One UI 6
تراشه : Exynos 1280 (5 nm)
پردازنده مرکزی : Octa-core (2×2.4 GHz Cortex-A78 & 6×2.0 GHz Cortex-A55)
پردازنده گرافیکی : Mali-G68
-
حافظه
کارت حافظه : میکرو micro
حافظه داخلی : 128GB 8GB RAM,
-
دوربین
اصلی : 50 مگاپیکسل , f/1.8, (wide), PDAF, OIS
8 مگاپیکسل , f/2.2, 120˚ (ultrawide)
2 مگاپیکسل , f/2.4, (macro)
قابلیت : LED flash, panorama, HDR
فیلمبرداری : 4K@30fps, 1080p@30fps, gyro-EIS
-
دوربین سلفی
اصلی : 13 مگاپیکسل , f/2.2, (wide)
قابلیت :
فیلم برداری : 1080p@30fps
-
صدا
بلند گو : دارد
جک هدفون : دارد
-
اتصال و ارتباط
وایرلس : Wi-Fi 802.11 a/b/g/n/ac, dual-band, Wi-Fi Direct
بلوتوث : نسخه 5.3 , A2DP, LE
GPS : دارد , GLONASS, GALILEO, BDS
NFS :
رادیو :
USB : با USB Type-C 2.0
-
حسگر ها
Fingerprint (side-mounted) اثر انگشت
شتاب سنج accelerometer
gyro ژیروسکپ
compass قطب نما
Virtual proximity sensing سنسور شخصی
-
باتری
ظرفیت : 5000 میلی آمپر
شارژر : 25 وات
|
نقد و بررسیها
هنوز بررسیای ثبت نشده است.