settings_api = new WooNotify_360Messenger_Settings_Api; add_action('init', [$this, 'updateOption__3_8']); if (is_admin()) { add_action('admin_init', [$this, 'adminInit']); add_action('admin_menu', [$this, 'adminMenu'], 60); add_filter('woocommerce_settings_tabs_array', [$this, 'adminSubMenu'], 99999); add_action('wp_before_admin_bar_render', [$this, 'adminBar']); add_filter('WooNotify_buyer_settings', [$this, 'buyerSettings']); add_filter('WooNotify_super_admin_settings', [$this, 'superAdminSettings']); add_filter('WooNotify_product_admin_settings', [$this, 'productAdminSettings']); add_filter('admin_footer_text', [$this, 'footerNote']); add_filter('update_footer', [$this, 'footerVersion'], 11); } } public function updateOption__3_8() { global $wpdb; if (get_option('WooNotify_update_gateway_options')) { return; } $wpdb->query("UPDATE {$wpdb->options} SET option_value=REPLACE(option_value, 's:24:\"woonotify_360Messenger_username\"', 's:20:\"360Messenger_gateway_apiKey\"') WHERE option_name='360Messenger_main_settings'"); $wpdb->query("UPDATE {$wpdb->options} SET option_value=REPLACE(option_value, 's:24:\"woonotify_360Messenger_password\"', 's:20:\"360Messenger_gateway_password\"') WHERE option_name='360Messenger_main_settings'"); $wpdb->query("UPDATE {$wpdb->options} SET option_value=REPLACE(option_value, 's:22:\"woonotify_360Messenger_sender\"', 's:18:\"360Messenger_gateway_sender\"') WHERE option_name='360Messenger_main_settings'"); update_option('WooNotify_update_gateway_options', '1'); } public function adminMenu() { $slug = 'woocommerce'; add_submenu_page($slug, '360Notify', '360Notify', 'manage_woocommerce', 'wooNotify-woocommerece-360Messenger-pro', [$this, 'settingPage']); } public function adminInit() { if (!empty($_GET['tab']) && $_GET['tab'] == 'WooNotify_settings_page') { wp_redirect(admin_url('admin.php?page=wooNotify-woocommerece-360Messenger-pro')); exit(); } $this->settings_api->set_sections(self::settingSections()); $this->settings_api->set_fields($this->settingFields()); $this->settings_api->admin_init(); } public static function settingSections() { if (get_locale() == 'fa_IR') { $title1 = 'وبسرویس'; $title2 = 'پیامهای مدیر کل'; $title3 = 'پیامهای مشتری'; $title4 = 'پیامهای فروشندگان'; //$title5 = 'اطلاع رسانی مشتری ها'; //$title6 = 'اعضای اطلاع رسانی محصولات'; $title7 = 'ارسال پیام واتساپ'; $title8 = 'پیامهای ارسال شده'; } else { $title1 = 'webservice'; $title2 = "admin template"; $title3 = 'client template'; $title4 = 'vendor template'; //$title5 = 'Information of products to customers'; //$title6 = 'Product Information Members'; $title7 = 'Send message'; $title8 = 'report'; } $sections = [ [ 'id' => '360Messenger_main_settings', 'title' => $title1, ], [ 'id' => '360Messenger_super_admin_settings', 'title' => $title2, ], [ 'id' => '360Messenger_buyer_settings', 'title' => $title3, ], [ 'id' => '360Messenger_product_admin_settings', 'title' => $title4, ], /*[ 'id' => '360Messenger_notif_settings', 'title' => $title5, ], [ 'id' => '360Messenger_contacts', 'title' => $title6, 'form_tag' => false, ],*/ [ 'id' => '360Messenger_send', 'title' => $title7, 'form_tag' => false, ], [ 'id' => '360Messenger_archive', 'title' => $title8, 'form_tag' => false, ], ]; return apply_filters('WooNotify_settings_sections', $sections); } public function settingFields() { $gateway = WooNotify()->Options('360Messenger_gateway'); $gateway = !empty($gateway) && $gateway != 'none'; $gateways_list = class_exists('WooNotify_360Messenger_Gateways') ? WooNotify_360Messenger_Gateways::get_360Messenger_gateway() : []; asort($gateways_list); $gateways_list = array_merge($gateways_list); $shortcode = WooNotify_Shortcode(true); if (get_locale() == 'fa_IR') { $text1 = 'کلید وبسرویس'; $text2 = 'دیتا سنتر'; $text3 = 'دسترسی سریع از ادمین بار'; $text4 = 'اگر فعال باشد، لینک ارسال پیام جهت دسترسی سریع تر به ادمین بار اضافه خواهد شد'; $text5 = 'ارسال پیام واتساپ به مدیران کل'; $text6 = 'با فعالسازی این گزینه، در هنگام ثبت و یا تغییر سفارش، برای مدیران کل، پیام واتساپ ارسال می گردد'; $text7 = 'شماره واتساپ های مدیران کل'; $text8='شماره ها را با کاما (,) جدا نمایید'; $text9='وضعیت های دریافت پیام واتساپ'; $text10='می توانید مشخص کنید مدیران کل در چه وضعیت هایی از سفارش پیام واتساپ دریافت کنند'; $text11='متن پیام مدیر کل'; $text12='کد های کوتاه شده قابل استفاده'; $text13='ارسال پیام واتساپ به مشتری'; $text14='با فعالسازی این گزینه، در هنگام ثبت و یا تغییر وضعیت سفارش و یا به صورت دست جمعی، به مشتری پیام واتساپ ارسال می گردد' ; $text15='متاباکس ارسال پیام واتساپ'; $text16='با فعالسازی این گزینه، در صورت فعال بودن قابلیت ارسال پیام واتساپ به مشتری، در صفحه سفارشات متاباکس ارسال پیام واتساپ به مشتریان اضافه میشود'; $text17='عنوان فیلد شماره واتساپ'; $text18='این عنوان در صفحه تسویه حساب نمایش داده خواهد شد و جایگزین کلمه ی "شماره واتساپ" میگردد'; $text19='شماره واتساپ'; $text20='اختیاری بودن دریافت پیام واتساپ برای مشتری'; $text21='با فعال سازی این گزینه، مشتری میتواند انتخاب کند که پیام واتساپ را دریافت کند و یا دریافت نکند. در غیر این صورت پیام واتساپ همواره ارسال خواهد شد'; $text22='بله'; $text23='خیر'; $text24='متن نمایش داده شده به کاربر برای دریافت پیام واتساپ'; $text25='این متن در بالای کادر بررسی دریافت پیام‌های واتساپ در صفحه تسویه حساب نمایش داده می‌شود'; $text26='میخواهم از وضعیت سفارش از طریق پیام واتساپ آگاه شوم'; $text27='وضعیت های پیام واتساپ'; $text28='وضعیت های دریافت پیام واتساپ'; $text29='می توانید مشخص کنید مشتری در چه وضعیت هایی از سفارش قادر به دریافت پیام واتساپ باشد'; $text30='انتخاب وضعیت ها توسط مشتری'; $text31='با فعالسازی این گزینه، مشتری میتواند در صفحه تسویه حساب، وضعیت های دلخواه خود برای دریافت پیام واتساپ را از میان وضعیت های انتخاب شده در بالا، انتخاب نماید. در صورت عدم فعالسازی این قسمت، در تمام وضعیت های انتخاب شده در بالا پیام ارسال میشود'; $text32='الزامی بودن انتخاب حداقل یک وضعیت'; $text33='با فعال سازی این گزینه، کاربر می بایست حداقل یک وضعیت سفارش را از بین وضعیت های انتخاب شده در بالا انتخاب کند. این قسمت ملزم به "بله" بودن تنظیمات "انتخاب وضعیت ها توسط مشتری" است'; $text34='نوع انتخاب وضعیت ها'; $text35='این قسمت نیز ملزم به "بله" بودن تنظیمات "انتخاب وضعیت ها توسط مشتری" است و نوع فیلد انتخاب وضعیت های سفارش توسط مشتری را تعیین میکند'; $text36='چند انتخابی'; $text37='چک باکس'; $text38='متن بالای انتخاب وضعیت ها'; $text39='این متن بالای لیست وضعیت ها در صفحه تسویه حساب برای انتخاب مشتری قرار میگیرد'; $text40='وضعیت هایی که مایل به دریافت پیام واتساپ هستید را انتخاب نمایید'; $text41='متن پایین انتخاب وضعیت ها'; $text42='این متن پایین لیست وضعیت ها در صفحه تسویه حساب برای انتخاب مشتری قرار میگیرد'; $text43='متن پیام واتساپ مشتری'; $text44='کد های کوتاه شده قابل استفاده'; $text45='ارسال پیام واتساپ به فروشندگان محصول'; $text46='با فعالسازی این گزینه، در هنگام ثبت و یا تغییر سفارش، برای مدیران هر محصول (فروشندگان) پیام واتساپ ارسال می گردد'; $text47='یوزر متای شماره واتساپ فروشندگان (اختیاری)'; $text48='با فعالسازی گزینه بالا یعنی "ارسال پیام واتساپ به فروشندگان محصول"، قسمت ویرایش و مدیریت هر محصول، یک تب جدید به اسم "پیام واتساپ" اضافه خواهد شد که در آنجا میتوانید به صورت دستی شماره واتساپ فروشندگان (مدیران محصول) را وارد نمایید. ولی با توجه به اینکه وارد کردن دستی شماره واتساپ فروشنده هر محصول ممکن است کار بسیار سخت و زمانبری باشد، این قابلیت وجود خواهد داشت که کلید متای کاربر یا User Meta Key مربوط به شماره واتساپ فروشندگان را در این فیلد وارد کنید تا به صورت خودکار پیام به شماره واتساپ ثبت شده برای آن متا ارسال شود.
این قابلیت اکثرا زمانی مورد استفاده قرار میگیرد که از افزونه های چند فروشندگی ووکامرس استفاده نمایید. در صورتی که دانش کافی در این مورد را ندارید، بدون نگرانی آن را خالی رها کنید'; $text49='پست متای شماره واتساپ فروشندگان (اختیاری)'; $text50='بعضی اوقات ممکن است شما از طریق برخی دیگر از افزونه های چند فروشندگی ووکامرس و یا کدنویسی شخصی، شماره موبایل فروشندگان را بجای user_meta در post_meta محصول متعلق به آن فروشنده ذخیره نمایید که در این صورت بجای استفاده از یوزر متا میتوانید از پست متا و یا هر دو استفاده نمایید.اگر دانش کافی در این مورد را ندارید، بدون نگرانی آن را خالی رها کنید'; $text51='وضعیت های دریافت پیام واتساپ'; $text52='این وضعیت های دریافت پیام واتساپ برای فروشندگانی که از طریق user_meta و یا post_meta تنظیم شده اند، لحاظ خواهد شد. برای تنظیم وضعیت پیام واتساپ فروشندگانی که به صورت دستی به محصول اضافه میشوند، میتوانید به صفحه ویرایش همان محصول مراجعه نموده و از تب پیام واتساپ، شماره موبایل مدیر آن محصول و وضعیت های سفارش متناظر با آن را اضافه کنید'; $text53='متن پیام به فروشندگان محصول'; $text54='کدهای کوتاه شده قابل استفاده'; $text55='اطلاع رسانی محصولات به مشتریان چیست؟'; $text56='آگاه سازی کاربران از جزییات و تغییرات محصولات مورد علاقه شان است.
بعنوان مثال کاربران پس از عضویت در اطلاع رسانی محصولات میتوانند از فروش ویژه (حراج) شدن آن محصول از طریق پیام واتساپ با خبر شوند و یا در صورتی که محصول مورد نظرشان در سایت موجود شد بلافاصله از این موضوع مطلع گردند'; $text57='فعال سازی اطلاع رسانی محصولات به مشتری'; $text58='با فعالسازی این گزینه، اطلاع رسانی محصولات به مشتریان فعال میشود. در غیر این صورت کلیه قسمت های زیر بی تاثیر خواهند شد'; $text59='اطلاع رسانی محصولات قدیمی (محصولاتی که قبل از نصب این افزونه ثبت شده اند)'; $text60='اطلاع رسانی هر محصول در صفحه ایجاد و یا ویرایش همان محصول (مدیریت محصول) به صورت مجزا قابل تنظیم است.این قابلیت وجود دارد که اطلاع رسانی هر محصول شخصی سازی شود. اما در صورتی که قبل از نصب افزونه WooNotify دارای محصولات بسیار زیادی بوده اید که ویرایش و تنظیم اطلاع رسانی محصولات آن ها زمانبر است، میتوانید از تنظیمات پیشفرض زیر استفاده کنید، ضمنا اگر برای محصولی تنظیمات اطلاع رسانی انجام نشده است از همین تنظیمات استفاده کنید'; $text61='اعمال تنظیمات پیشفرض برای محصولات قدیمی (محصولات اضافه شده قبل از نصب افزونه)'; $text62='غیرفعال سازی برای محصولات قدیمی (محصولات اضافه شده قبل از نصب افزونه)'; $text63='فرم عضویت اطلاع رسانی محصولات'; $text64='نمایش فرم عضویت در صفحه محصول'; $text65='توسط این گزینه میتوانید نحوه نمایش فرم عضویت اطلاع رسانی به مشتری را در صفحه محصولات تعیین نمایید. در صورتی که قصد استفاده از اکشن های ووکامرس را دارید میتوانید تابع WooNotify_Shortcode() را به اکشن مورد نظر متصل کنید'; $text66='نمایش خودکار در بدنه محصول'; $text67='نمایش خودکار زیر تصویر شاخص'; $text68='نمایش دستی به وسیله WooCommerce hooks یا ابزارک اطلاع رسانی محصولات ووکامرس و یا کد کوتاه شده %s'; $text69='متن عضویت در اطلاع رسانی محصولات'; $text70='این متن در صفحه محصول به صورت چک باکس ظاهر خواهد شد و کاربر با انتخاب آن میتواند شماره واتساپ و گروه های مورد نظر خود را برای عضویت در اطلاع رسانی، محصول وارد نماید'; $text71='به من از طریق پیام واتساپ اطلاع بده'; $text72='عضویت فقط برای اعضای سایت'; $text73='با فعالسازی این گزینه، فقط کاربرانی که وارد سایت شده اند لاگین شده قادر به عضویت در اطلاع رسانی محصول خواهند بود'; $text74='متن جلوگیری از عضویت مهمانان'; $text75='در صورتی که گزینه "عضویت فقط برای اعضای سایت" را فعال کرده باشید، هنگامی که کاربران مهمان قصد عضویت در اطلاع رسانی محصولات را داشته باشند، با این متن وارد شده مواجه خواهند شد'; $text76='عضویت در اطلاع رسانی محصولات فقط برای اعضای سایت امکان پذیر خواهد بود'; $text77='گروه (رویداد) های اطلاع رسانی'; $text78='رویداد های اتوماتیک'; $text79='رویداد اتوماتیک (ویژه شدن یا حراج شدن محصول - موجود شدن محصول - رو به اتمام بودن انبار محصول) برای اطلاع رسانی وجود دارند که پیام واتساپ مربوط به این رویداد ها به صورت خودکار به مشترکینی که عضو اطلاع رسانی هستند ارسال میشود و نیازی به ارسال دستی پیام ها توسط شما نیست.
توجه داشته باشید که عملکرد گزینه های مربوط به "موجودی و انبار" وابسته به تنظیمات ووکامرس خواهد بود'; $text80='رویداد های دستی'; $text81='علاوه بر رویداد های اتوماتیک ذکر شده، می توانید گزینه های دلخواه دیگری را به سیستم اطلاع رسانی اضافه نمایید و از طریق متاباکسی که در صفحه ویرایش محصول اضافه می شود، به هر کدام از مشترکین این گروه ها به صورت دستی پیامک ارسال کنید.
برای اضافه کردن گزینه ها، همانند نمونه بالا ابتدا یک کد عددی دلخواه تعریف کنید، سپس بعد از قرار دادن عبارت ":" متن مورد نظر را تایپ کنید. دقت کنید که کد عددی منحصر به فرد بوده و نباید بعد از ذخیره کردن کد تغییر کند '; $text82='1:زمانیکه محصول توقف فروش شد\n2:زمانیکه نسخه جدید محصول منتشر شد\n '; $text83='پیام واتساپ رویداد های اتوماتیک '; $text84='{product_id} : آیدی محصول، {sku} : شناسه محصول، {product_title} : عنوان محصول، {regular_price} قیمت اصلی، {onsale_price} : قیمت فروش فوق العاده
{onsale_from} : تاریخ شروع فروش فوق العاده، {onsale_to} : تاریخ اتمام فروش فوق العاده، {stock} : موجودی انبار'; $text85='زمانیکه محصول حراج شد'; $text86='با فعال سازی این گزینه، در صورت حراج نبودن محصول، گزینه "زمانیکه که محصول حراج شد" در فرم عضویت اطلاع رسانی نمایش داده خواهد شد'; $text87='متن گزینه "زمانیکه محصول حراج شد"'; $text88='میتوانید متن دلخواه خود را جایگزین جمله "زمانیکه محصول حراج شد" نمایید'; $text89="زمانیکه محصول حراج شد"; $text90='متن پیام واتساپ "زمانیکه محصول حراج شد"'; $text91="سلام\nقیمت محصول {product_title} از {regular_price} به {onsale_price} کاهش یافت"; $text92='زمانیکه محصول موجود شد'; $text93='با فعالسازی این گزینه، در صورت ناموجود بودن محصول، گزینه "زمانیکه که محصول موجود شد" در فرم عضویت اطلاع رسانی نمایش داده خواهد شد.'; $text94='متن گزینه "زمانیکه محصول موجود شد"'; $text95='میتوانید متن دلخواه خود را جایگزین جمله "زمانیکه محصول موجود شد" نمایید'; $text96="زمانیکه محصول موجود شد"; $text97= 'متن پیام واتساپ "زمانیکه محصول موجود شد"'; $text98="سلام\nمحصول {product_title} هم اکنون موجود شده است و قابل خرید می باشد."; $text99='زمانیکه محصول رو به اتمام است'; $text100='با فعالسازی این گزینه، در صورتی که موجودی محصول در انبار زیاد بود، گزینه "زمانیکه که محصول رو به اتمام است" در فرم عضویت اطلاع رسانی نمایش داده خواهد شد'; $text101='متن گزینه "زمانیکه محصول رو به اتمام است"'; $text102='میتوانید متن دلخواه خود را جایگزین جمله "زمانیکه محصول رو به اتمام است" نمایید'; $text103="سلام\nموجودی محصول {product_title} کم می باشد. لطفا در صورت تمایل به خرید سریعتر اقدام نمایید"; $text104='

پیام واتساپ رویداد های دستی

'; $text105='برای این دسته از رویداد ها، می بایست از طریق متاباکسی که در صفحه ویرایش محصول اضافه خواهد شد، به هر کدام از مشترکین این گروه ها به صورت دستی پیام واتساپ ارسال کنید'; $text106= 'برای دریافت کلید وب سرویس اینجا را کلیک کنید'; } else { $text1 = 'APIKEY'; $text2 = 'Datacenter'; $text3 = 'Quick access from admin bar'; $text4 = 'If it is active, the link to send a message will be added to the admin bar for faster access'; $text5 = 'Send whatsapp message to general managers'; $text6 = 'By activating this option, when registering or changing an order, a whatsapp message will be sent to the general managers'; $text7 = 'whatsapp numbers of general managers'; $text8='Separate numbers with commas (,)'; $text9='Status of receiving whatsapp messages'; $text10='You can specify in what situations general managers receive whatsapp messages from the order'; $text11="General manager's message text"; $text12='Usable Shortcodes'; $text13='Send a whatsapp message to the customer'; $text14='By activating this option, a whatsapp message will be sent to the customer when registering or changing the status of the order or in bulk'; $text15='Metabox for sending whatsapp messages'; $text16="By activating this option, if the ability to send whatsapp messages to customers is enabled, sending whatsapp messages to customers will be added to Metabox's orders page"; $text17='whatsapp number field title'; $text18='This title will be displayed on the checkout page and will replace the word "whatsapp number"'; $text19='whatsapp number'; $text20='Optionality of receiving whatsapp messages for the customer'; $text21='By activating this option, the customer can choose to receive whatsapp messages or not. Otherwise, the whatsapp message will always be sent'; $text22='yes'; $text23='No'; $text24='The text displayed to the user to receive whatsapp messages'; $text25='This text will be displayed above the check box for receiving whatsapp messages on the account settlement page'; $text26='I want to be informed about the status of the order through whatsapp message'; $text27='whatsapp Message Status'; $text28='Status of receiving whatsapp messages'; $text29='You can specify in which statuses of the order the customer can receive whatsapp messages'; $text30='Selection of statuses by the customer'; $text31='By activating this option, the customer can choose his desired statuses to receive whatsapp messages from the statuses selected above on the account settlement page. If this part is not activated, the message will be sent in all the situations selected above'; $text32='It is necessary to select at least one status'; $text33='By activating this option, the user must select at least one order status from among the statuses selected above. This field is required to be "Yes" in the setting "Customer select statuses" '; $text34='Type of statuses selection'; $text35='This field is also required to be "Yes" in the setting "Select statuses by the client". And the field type determines the order status selection by the customer'; $text36='multiple choice'; $text37='checkbox'; $text38='Text above the status selection'; $text39='This text is placed above the list of statuses on the account settlement page for the customer to choose'; $text40='Choose the statuses you want to receive whatsapp messages'; $text41='bottom text of status selection'; $text42='This text is placed at the bottom of the status list on the account settlement page for the customer to choose'; $text43='Customer whatsapp message text'; $text44='Usable Shortcodes'; $text45='Send whatsapp message to product sellers'; $text46='By activating this option, when registering or changing an order, a whatsapp message will be sent to the managers of each product (sellers)'; $text47='Meta user whatsapp number of sellers (optional)'; $text48='By activating the above option, "Send whatsapp message to product sellers", in the editing and management section of each product, a new tab named "whatsapp message" will be added, where you can manually enter the whatsapp number of sellers (product managers) ) enter But considering that manually entering the whatsapp number of the seller of each product may be a very difficult and time-consuming task, it will be possible to enter the User Meta Key related to the sellers whatsapp number in this field to automatically enter it. Send a message to the whatsapp number registered for that meta.
This feature is mostly used when you use WooCommerce multi-vendor plugins. If you dont have enough knowledge about this, feel free to leave it blank'; $text49='Meta post of sellers whatsapp number (optional)'; $text50="Sometimes you may save the seller's mobile number instead of user_meta in the post_meta of the product belonging to that seller through some other WooCommerce multi-vendor plugins or personal coding. In this case, instead of using user meta, you can use Use post meta or both. If you don't know enough about this, don't worry, leave it blank"; $text51='Status of receiving whatsapp messages'; $text52='These statuses of receiving whatsapp messages will be considered for sellers who are set through user_meta or post_meta. To adjust the whatsapp message status of sellers who are manually added to the product, you can refer to the editing page of the same product and add the mobile number of the manager of that product and the corresponding order status from the whatsapp message tab'; $text53='Message text to product sellers'; $text54='Usable Shortcodes'; $text55='What is product information to customers?'; $text56='Notifying users of the details and changes of their favorite products.
For example, after subscribing to product notification, users can be informed about the special sale (auction) of that product through whatsapp messages or in If the desired product is available on the site, they will be informed immediately'; $text57='Enable product notification to the customer'; $text58='By activating this option, notification of products to customers will be activated. Otherwise, all the following parts will be ineffective'; $text59='Notification of old products (products that were registered before installing this plugin)'; $text60='The notification of each product can be set separately on the page of creating or editing the same product (product management). It is possible to personalize the notification of each product. But if before installing the WooNotify plugin you have many products that it takes time to edit and set the notification of their products, you can use the following default settings, and if the notification settings have not been done for a product, use the same settings '; $text61='Apply default settings to old products (products added before plugin installation)'; $text62='Deactivation for old products (products added before plugin installation)'; $text63='Product notification membership form'; $text64='Display the membership form on the product page'; $text65='With this option, you can determine how to display the customer notification membership form on the products page. If you intend to use WooCommerce actions, you can connect the WooNotify_Shortcode() function to the desired action'; $text66='Auto display in product body'; $text67='Auto display below the index image'; $text68='Manual display by WooCommerce hooks or WooCommerce product notification widget or shortcode %s'; $text69='Subscription text in product notification'; $text70='This text will appear on the product page in the form of a check box, and by selecting it, the user can enter the whatsapp number and desired groups to be a member of the product notification.'; $text71='Notify me via whatsapp message'; $text72='Membership only for site members'; $text73='By activating this option, only users who are logged in to the site will be able to subscribe to product notifications'; $text74='Text to prevent guest membership'; $text75='If you have activated the option "Subscription only for members of the site", when guest users intend to subscribe to product notifications, they will encounter this entered text'; $text76='Membership in product notification will be possible only for site members'; $text77='Notification group (events)'; $text78='Automatic events'; $text79='Automatic event (specialization or auction of the product - availability of the product - running out of stock) are there to inform that the whatsapp message related to these events is automatically sent to the subscribers who are members of the notification. And you dont need to send messages manually.
Note that the functionality of options related to "inventory and warehouse" depends on WooCommerce Settings will be'; $text80='Manual events'; $text81='In addition to the mentioned automatic events, you can add other optional options to the notification system and manually send text messages to each of the subscribers of these groups through the metabox that is added on the product editing page. Send.
To add options, like the example above, first define a desired numeric code, then type the desired text after placing the expression ":". Make sure that the numeric code is unique and should not be changed after saving the code'; $text82='1: When the product was discontinued\n2: When the new version of the product was released\n '; $text83='whatsapp Message Automatic Events'; $text84='{product_id} : product ID, {sku} : product ID, {product_title} : product title, { regular_price} Regular price, {onsale_price} : Onsale price
{onsale_from} : Onsale start date, {onsale_to} : end date of super sale, {stock} : stock in stock'; $text85='When the product was auctioned'; $text86='By activating this option, if the product is not auctioned, the option "when the product is auctioned" will be displayed in the notification membership form'; $text87='The text of the option "When the product was auctioned"'; $text88='You can replace the sentence "when the product is auctioned" with your desired text'; $text89="When the product was auctioned"; $text90='whatsapp message text "When the product is auctioned"'; $text91="Hello\nThe price of the product {product_title} has been reduced from {regular_price} to {onsale_price}"; $text92='When the product is available'; $text93='By activating this option, if the product is not available, the option "when the product is available" will be displayed in the notification membership form.'; $text94='The text of the option "When the product is available"'; $text95='You can replace the sentence "when the product is available" with your desired text'; $text96="When the product became available"; $text97= 'whatsapp message text "when the product is available"'; $text98="Hello\nProduct {product_title} is now available and can be purchased."; $text99='When the product is running out'; $text100='By activating this option, if the product is in stock, the option "When the product is running out" will be displayed in the notification subscription form'; $text101='The text of the option "when the product is running out"'; $text102='You can replace the sentence "When the product is running out" with your desired text'; $text103="Hello\nThe product {product_title} is in short supply. Please, if you want to buy it, proceed as soon as possible"; $text104='

Manual Events whatsapp Message

'; $text105='For this category of events, you should manually send a whatsapp message to each of the subscribers of these groups through the metabox that will be added on the product editing page'; $text106= 'Click here to get Api key'; } $settings_fields = [ '360Messenger_main_settings' => apply_filters('WooNotify_main_settings', [ [ 'name' => '360Messenger_gateway', 'label' => $text2, 'type' => 'select', 'default' => 'Server1', 'desc' => '', 'options' => $gateways_list, 'ltr' => true, ], [ 'name' => '360Messenger_gateway_apiKey', 'label' => $text1, 'type' => 'password', 'ltr' => false, ], [ 'name' => '360Messenger_gateway_apiKey_des', 'desc' => $text106, 'type' => 'html', ], [ 'name' => 'enable_admin_bar', 'label' => $text3, 'desc' => $text4, 'type' => 'checkbox', ], ]), '360Messenger_super_admin_settings' => apply_filters('WooNotify_super_admin_settings', [ [ 'name' => 'enable_super_admin_360Messenger', 'label' => $text5, 'desc' => $text6, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'super_admin_phone', 'label' => $text7, 'desc' => $text8, 'type' => 'text', 'ltr' => true, ], [ 'name' => 'super_admin_order_status', 'label' => $text9, 'desc' => $text10, 'type' => 'multicheck', 'options' => WooNotify()->GetAllSuperAdminStatuses(), ], [ 'name' => 'header_super_admin', 'label' => '

' . $text11 . '

', 'type' => 'html', ], [ 'name' => '360Messenger_body_shortcodes_super_admin', 'label' => $text12, 'type' => 'html', 'desc' => $this->ShortCodes(), ], ]), '360Messenger_buyer_settings' => apply_filters('WooNotify_buyer_settings', [ [ 'name' => 'enable_buyer', 'label' => $text13, 'desc' => $text14, 'type' => 'checkbox', ], [ 'name' => 'enable_metabox', 'label' => $text15, 'desc' => $text16, 'type' => 'checkbox', ], [ 'name' => 'buyer_phone_label', 'label' => $text17, 'desc' => $text18, 'type' => 'text', 'default' => $text19, ], [ 'name' => 'force_enable_buyer', 'label' => $text20, 'desc' => $text21, 'type' => 'radio', 'default' => 'yes', 'options' => [ 'no' => $text22, //reverse 'yes' => $text23, ], ], [ 'name' => 'buyer_checkbox_text', 'label' => $text24, 'desc' => $text25, 'type' => 'text', 'default' => $text26, ], [ 'name' => 'header_2', 'label' => '

' . $text27 . '

', 'type' => 'html', ], [ 'name' => 'order_status', 'label' => $text28, 'desc' => $text29, 'type' => 'multicheck', 'options' => WooNotify()->GetAllStatuses(), ], [ 'name' => 'allow_buyer_select_status', 'label' => $text30, 'desc' => $text31, 'type' => 'radio', 'default' => 'no', 'options' => [ 'yes' => $text22, 'no' => $text23, ], ], [ 'name' => 'force_buyer_select_status', 'label' => $text32, 'desc' => $text33, 'type' => 'radio', 'default' => 'no', 'options' => [ 'yes' => $text22, 'no' => $text23, ], ], [ 'name' => 'buyer_status_mode', 'label' => $text34, 'desc' => $text35, 'type' => 'radio', 'default' => 'selector', 'options' => [ 'selector' => $text36, 'checkbox' => $text37, ], ], [ 'name' => 'buyer_select_status_text_top', 'label' => $text38, 'desc' => $text39, 'type' => 'text', 'default' => $text40, ], [ 'name' => 'buyer_select_status_text_bellow', 'label' => $text41, 'desc' => $text42, 'type' => 'text', 'default' => '', ], [ 'name' => 'header_3', 'label' => '

' . $text43 . '

', 'type' => 'html', ], [ 'name' => '360Messenger_body_shortcodes', 'label' => $text44, 'type' => 'html', 'desc' => $this->ShortCodes(), ], ]), '360Messenger_product_admin_settings' => apply_filters('WooNotify_product_admin_settings', [ [ 'name' => 'enable_product_admin_360Messenger', 'label' => $text45, 'desc' => $text46, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'product_admin_user_meta', 'label' => $text47, 'desc' => $text48, 'type' => 'text', 'ltr' => true, 'default' => '', ], [ 'name' => 'product_admin_post_meta', 'label' => $text49, 'desc' => $text50, 'type' => 'text', 'ltr' => true, 'default' => '', ], [ 'name' => 'product_admin_meta_order_status', 'label' => $text51, 'desc' => $text52, 'type' => 'multicheck', 'options' => WooNotify()->GetAllSuperAdminStatuses(), ], [ 'name' => 'header_product_admin', 'label' => '

' . $text53 . '

', 'type' => 'html', ], [ 'name' => '360Messenger_body_shortcodes_product_admin', 'label' => $text54, 'type' => 'html', 'desc' => $this->ShortCodes(), ], ]), '360Messenger_notif_settings' => apply_filters('WooNotify_notif_settings', [ [ 'name' => 'header_whatis_notif', 'label' => '

' . $text55 . '

', 'desc' => $text56, 'type' => 'html', ], [ 'name' => 'enable_notif_360Messenger_main', 'label' => $text57, 'desc' => $text58, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'notif_old_pr', 'label' => $text59, 'desc' => $text60, 'type' => 'radio', 'default' => 'no', 'options' => [ 'yes' => $text61, 'no' => $text62, ], ], [ 'name' => 'header_2', 'label' => '

' . $text63 .'

', 'type' => 'html', ], [ 'name' => 'enable_notif_360Messenger', 'label' => $text64, 'desc' => $text65, 'type' => 'radio', 'default' => 'no', 'br' => true, 'options' => [ 'on' => $text66, 'thumbnail' => $text67, 'no' => sprintf($text68, "$shortcode"), ], ], [ 'name' => 'notif_title', 'label' => $text69, 'desc' => $text70, 'type' => 'text', 'default' => $text71, ], [ 'name' => 'notif_only_loggedin', 'label' => $text72, 'desc' => $text73, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'notif_only_loggedin_text', 'label' => $text74, 'desc' => $text75, 'type' => 'text', 'default' => $text76, ], [ 'name' => 'header_notif_group', 'label' => '

' . $text77 .'

', 'type' => 'html', ], [ 'name' => 'header_3', 'label' => '

' . $text78 . '

', 'desc' => $text79, 'type' => 'html', ], [ 'name' => 'notif_options', 'label' => '

' . $text80 . '

', 'desc' => $text81, 'type' => 'textarea', 'default' => $text82, ], [ 'name' => 'header_notif_360Messenger', 'label' => '

' .$text83 . '

', 'type' => 'html', ], [ 'name' => 'header_4', 'label' => $text54, 'desc' => $text84, 'type' => 'html', ], [ 'name' => 'header_null_1', 'label' => '', 'type' => 'html', ], [ 'name' => 'enable_onsale', 'label' => $text85, 'desc' => $text86, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'notif_onsale_text', 'label' => $text87, 'desc' => $text88, 'type' => 'text', 'default' => $text89, ], [ 'name' => 'notif_onsale_360Messenger', 'label' => $text90, 'type' => 'textarea', 'default' => $text91, 'row' => 2, ], [ 'name' => 'header_null_2', 'label' => '', 'type' => 'html', ], [ 'name' => 'enable_notif_no_stock', 'label' => $text92, 'desc' => $text93, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'notif_no_stock_text', 'label' => $text94, 'desc' => $text95, 'type' => 'text', 'default' => $text96, ], [ 'name' => 'notif_no_stock_360Messenger', 'label' =>$text97, 'type' => 'textarea', 'default' => $text98, 'row' => 2, ], [ 'name' => 'header_null_3', 'label' => '', 'type' => 'html', ], [ 'name' => 'enable_notif_low_stock', 'label' => $text99, 'desc' => $text100, 'type' => 'checkbox', 'default' => 'no', ], [ 'name' => 'notif_low_stock_text', 'label' => $text101, 'desc' => $text102, 'type' => 'text', 'default' => $text99, ], [ 'name' => 'notif_low_stock_360Messenger', 'label' =>$text101, 'desc' => '', 'type' => 'textarea', 'default' => $text103, 'row' => 2, ], [ 'name' => 'header_null_4', 'label' => '', 'type' => 'html', ], [ 'name' => 'header_7', 'label' => $text104, 'desc' => $text105, 'type' => 'html', ], ]), ]; return apply_filters('WooNotify_settings_fields', $settings_fields); } public function ShortCodes() { if (get_locale() == 'fa_IR') { } else { } $shortcode_list = apply_filters('WooNotify_shortcodes_list', ''); $product_admin_shortcodes = ''; if (!empty($_GET['tab']) && $_GET['tab'] == 'product_admin') { if (get_locale() == 'fa_IR') { $product_admin_shortcodes = " کد های کوتاه شده اختصاصی فروشندگان :
{vendor_items} = محصولات سفارش هر فروشنده ، {vendor_items_qty} = محصولات سفارش هر فروشنده به همراه تعداد ،
{count_vendor_items} = تعداد محصولات سفارش هر فروشنده ، {vendor_price} = مجموع قیمت محصولات سفارش هر فروشنده ،

"; } else { $product_admin_shortcodes = " Special shortened codes of sellers:
{vendor_items} = products ordered by each vendor, {vendor_items_qty} = products ordered by each vendor with quantity,
{count_vendor_items} = number of products ordered by each vendor, {vendor_price} = total price of products ordered by each vendor,

"; } } if (get_locale() == 'fa_IR'){ return " برای مشاهده کدهای کوتاه شده قابل استفاده در متن پیام واتساپ کلیک کنید. "; } else { return " Click to see the shortened codes that can be used in the text of the whatsapp message. "; } } public function adminSubMenu($pages) { $pages['WooNotify_settings_page'] = '360Notify'; return $pages; } public function settingPage() { echo '
'; $this->settings_api->show_navigation(); $this->settings_api->show_forms(); echo '
'; } public function adminBar() { if (WooNotify()->Options('enable_admin_bar')) { if (current_user_can('manage_woocommerce') && is_admin_bar_showing()) { global $wp_admin_bar; $wp_admin_bar->add_menu([ 'id' => 'adminBar_send', 'title' => '360Notify', 'href' => admin_url('admin.php?page=wooNotify-woocommerece-360Messenger-pro&tab=send'), ]); } } } public function buyerSettings($settings) { $statuses = WooNotify()->GetAllStatuses(); foreach ((array) $statuses as $status_val => $status_name) { $_status_name = preg_replace('/\(.*\)/is', '', $status_name); $_status_name = trim($_status_name); if (get_locale() == 'fa_IR') { $text = [ [ 'name' => '360Messenger_body_' . $status_val, 'label' => 'وضعیت ' . $status_name, 'desc' => "میتوانید از کد های کوتاه شده در بالای این بخش استفاده نمایید.", 'type' => 'textarea', 'default' => "سلام {b_first_name} {b_last_name}\nسفارش {order_id} دریافت شد و هم اکنون در وضعیت " . $_status_name . " می باشد.\nآیتم های سفارش : {all_items}\nمبلغ سفارش : {price}\nشماره تراکنش : {transaction_id}", ], ]; } else { $text = [ [ 'name' => '360Messenger_body_' . $status_val, 'label' => 'status'. $status_name, 'desc' => "You can use the shortened codes above this section.", 'type' => 'textarea', 'default' => "Hello {b_first_name} {b_last_name}\nThe order {order_id} has been received and is now in status ". $_status_name . ".\nOrder items: {all_items}\nOrder amount: {price}\nTransaction number: {transaction_id}", ], ]; } $settings = array_merge($settings, $text); } return $settings; } public function superAdminSettings($settings) { $statuses = WooNotify()->GetAllStatuses(); foreach ((array) $statuses as $status_val => $status_name) { $_status_name = preg_replace('/\(.*\)/is', '', $status_name); $_status_name = trim($_status_name); if (get_locale() == 'fa_IR'){ $text = [ [ 'name' => 'super_admin_360Messenger_body_' . $status_val, 'label' => 'وضعیت ' . $status_name, 'desc' => "میتوانید از شورت کد های معرفی شده در بالای این بخش استفاده نمایید.", 'type' => 'textarea', 'row' => 5, 'default' => "سلام مدیر\nسفارش {order_id} ثبت شده است و هم اکنون در وضعیت " . $_status_name . " می باشد.\nآیتم های سفارش : {all_items}\nمبلغ سفارش : {price}", ], ]; } else { $text = [ [ 'name' => 'super_admin_360Messenger_body_' . $status_val, 'label' => 'status'. $status_name, 'desc' => "You can use the shortened codes above this section.", 'type' => 'textarea', 'row' => 5, 'default' => "Hello manager\nThe order {order_id} has been registered and is now in the status ". $_status_name . ".\nOrder items: {all_items}\nOrder amount: {price}", ], ]; } $settings = array_merge($settings, $text); } if (get_locale() == 'fa_IR'){ $text = [ [ 'name' => 'header_3', 'label' => '

متن پیام واتساپ موجودی انبار

', 'desc' => 'توجه داشته باشید که متن پیام های مربوط به "موجودی و انبار" برای "فروشندگان محصول" نیز اعمال خواهد شد و تنظیمات و آستانه موجودی انبار وابسته به تنظیمات ووکامرس می باشد.', 'type' => 'html', ], [ 'name' => 'header_4', 'label' => 'کد های کوتاه شده قابل استفاده', 'desc' => "کدهای کوتله شده قابل استفاده در متن پیام های واتساپ مرتبط با موجوی انبار :
{product_id} : آیدی محصول، {sku} : شناسه محصول، {product_title} : عنوان محصول، {stock} : موجودی انبار", 'type' => 'html', ], [ 'name' => 'admin_low_stock', 'label' => 'کم بودن موجودی انبار', 'desc' => "متن پیام واتساپ زمانی که موجودی انبار کم است.", 'type' => 'textarea', 'row' => 3, 'default' => "سلام\nموجودی انبار محصول {product_title} رو به اتمام است.", ], [ 'name' => 'admin_out_stock', 'label' => 'تمام شدن موجودی انبار', 'desc' => "متن پیام واتساپ زمانی که موجودی انبار تمام شد.", 'type' => 'textarea', 'row' => 3, 'default' => "سلام\nموجودی انبار محصول {product_title} به اتمام رسیده است.", ], ]; } else { $text = [ [ 'name' => 'header_3', 'label' => '

whatsapp message text of warehouse inventory

', 'desc' => 'Note that the text of the "Inventory and Warehouse" messages will also apply to "Product Sellers" and that the warehouse inventory thresholds and settings depend on WooCommerce settings."', 'type' => 'html', ], [ 'name' => 'header_4', 'label' => 'Usable Shortcodes', 'desc' => "Cut codes that can be used in the text of whatsapp messages related to Mojoi Warehouse:
{product_id}: Product ID, {sku}: ID Product, {product_title} : product title, {stock} : warehouse stock", 'type' => 'html', ], [ 'name' => 'admin_low_stock', 'label' => 'low inventory', 'desc' => "whatsapp message text when stock is low.", 'type' => 'textarea', 'row' => 3, 'default' => "Hello\nProduct {product_title} is running out of stock.", ], [ 'name' => 'admin_out_stock', 'label' => 'out of stock', 'desc' => "whatsapp message text when out of stock.", 'type' => 'textarea', 'row' => 3, 'default' => "Hello\nProduct {product_title} is out of stock.", ], ]; } $settings = array_merge($settings, $text); return $settings; } public function productAdminSettings($settings) { $statuses = WooNotify()->GetAllStatuses(); foreach ((array) $statuses as $status_val => $status_name) { $_status_name = preg_replace('/\(.*\)/is', '', $status_name); $_status_name = trim($_status_name); if (get_locale() == 'fa_IR'){ $text = [ [ 'name' => 'product_admin_360Messenger_body_' . $status_val, 'label' => 'وضعیت ' . $status_name, 'desc' => "میتوانید از کدهای کوتاه شده معرفی شده در بالای این بخش استفاده نمایید.", 'type' => 'textarea', 'row' => 4, 'default' => "سلام\nسفارش {order_id} ثبت شده است و هم اکنون در وضعیت " . $_status_name . " می باشد.\nآیتم های سفارش متعلق به شما: {vendor_items}", ], ]; } else{ $text = [ [ 'name' => 'product_admin_360Messenger_body_' . $status_val, 'label' => 'status'. $status_name, 'desc' => "You can use the shortened codes introduced at the top of this section.", 'type' => 'textarea', 'row' => 4, 'default' => "Hello\nThe order {order_id} has been registered and is now in the status of ". $_status_name . " is.\nYour order items: {vendor_items}", ], ]; } $settings = array_merge($settings, $text); } if (get_locale() == 'fa_IR'){ $text = [ [ 'name' => '360Messenger_body_stock_product_admin', 'label' => '

متن پیام واتساپ موجودی انبار

', 'desc' => sprintf('با توجه به مشترک بودن متن پیام های موجودی انبار بین مدیران کل و فروشندگان محصول، برای تنظیم متن این پیام ها از %s استفاده کنید.', 'این لینک'), 'type' => 'html', ], ]; } else{ $text = [ [ 'name' => '360Messenger_body_stock_product_admin', 'label' => '

whatsapp message text of warehouse inventory

', 'desc' => sprintf('According to the fact that the text of the warehouse inventory messages is shared between general managers and product sellers, use %s to set the text of these messages.', 'this link'), 'type' => 'html', ], ]; } $settings = array_merge($settings, $text); return $settings; } public function footerNote($text) { if (isset($_GET['page']) && $_GET['page'] == 'wooNotify-woocommerece-360Messenger-pro') { if (get_locale() == 'fa_IR'){ // return footer text } else { } } return $text; } public function footerVersion($text) { if (isset($_GET['page']) && $_GET['page'] == 'wooNotify-woocommerece-360Messenger-pro') { $text = '360Notify version ' . WooNotify_VERSION; } return $text; } public function WooNotify_360Messenger_array_sanitize_text_field($array) { foreach ($array as $key => &$value) { if (is_array($value)) { $value = WooNotify_360Messenger_array_sanitize_text_field($value); } else { $value = sanitize_text_field($value); } } return $array; } } new WooNotify_360Messenger_Settings();