post_content, 'ifnex_tracking_form') || has_shortcode($post->post_content, 'ifnex_wallet_balance') || has_shortcode($post->post_content, 'ifnex_transactions') || has_shortcode($post->post_content, 'ifnex_tracking_status') || has_shortcode($post->post_content, 'ifnex_order_form') || has_shortcode($post->post_content, 'ifnex_user_profile') || has_shortcode($post->post_content, 'ifnex_orders_list') || has_shortcode($post->post_content, 'ifnex_order_detail') || has_shortcode($post->post_content, 'ifnex_order_payment') || has_shortcode($post->post_content, 'ifnex_customer_dashboard'))) { wp_enqueue_style('ifnex-bridge-css', plugin_dir_url(__FILE__) . 'assets/css/ifnex-bridge.css', array('ifnex-main'), '2.0.0-' . time()); wp_enqueue_script('ifnex-order-form-js', plugin_dir_url(__FILE__) . 'assets/js/ifnex-order-form.js', array('jquery'), '2.0.0-' . time(), true); } } // اضافه کردن لینک به منوی پیشخوان وردپرس add_action( 'admin_menu', 'ifnex_plugin_setup_menu' ); function ifnex_plugin_setup_menu() { add_menu_page( 'تنظیمات IFNEX', 'IFNEX', 'manage_options', 'ifnex-settings', 'ifnex_settings_page_html', 'dashicons-location-alt', 30 ); } function ifnex_settings_page_html() { if (isset($_POST['ifnex_api_url']) && check_admin_referer('ifnex_settings_save')) { update_option('ifnex_api_url', sanitize_url($_POST['ifnex_api_url'])); update_option('ifnex_api_key', sanitize_text_field($_POST['ifnex_api_key'])); update_option('ifnex_bridge_api_key', sanitize_text_field($_POST['ifnex_bridge_api_key'] ?? '')); echo '

تنظیمات ذخیره شد.

'; } $api_url = get_option('ifnex_api_url', 'http://localhost:8000/api/v1'); $api_key = get_option('ifnex_api_key', ''); $bridge_api_key = get_option('ifnex_bridge_api_key', ''); ?>

تنظیمات IFNEX Logistics Bridge

آدرس پایه API لاراول

برای APIهای عمومی مثل Tracking

مهم: باید با مقدار IFNEX_BRIDGE_API_KEY در فایل .env لاراول یکسان باشد.


راهنمای راه‌اندازی

  1. در فایل .env لاراول، خط IFNEX_BRIDGE_API_KEY=your-secret-key را تنظیم کنید
  2. همان مقدار را در فیلد "Bridge API Key" بالا وارد کنید
  3. کاربران وردپرس باید در لاراول با همان ایمیل موجود باشند (از php artisan ifnex:sync-wp-users استفاده کنید)