D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
stickain
/
davidsteele.com
/
wp-content
/
plugins
/
woocommerce-notification
/
admin
/
Filename :
settings.php
back
Copy
<?php /* Class Name: WP_SM_Admin_Settings Author: Andy Ha (support@villatheme.com) Author URI: http://villatheme.com Copyright 2016 villatheme.com. All rights reserved. */ if ( ! defined( 'ABSPATH' ) ) { exit; } class VI_WNOTIFICATION_Admin_Settings { static $params; public function __construct() { add_action( 'admin_init', array( $this, 'save_meta_boxes' ) ); add_action( 'wp_ajax_wcn_search_product', array( $this, 'search_product' ) ); } /*Ajax Search*/ public function search_product( $x = '', $post_types = array( 'product' ) ) { if ( ! current_user_can( 'manage_options' ) ) { return; } ob_start(); $keyword = filter_input( INPUT_GET, 'keyword', FILTER_SANITIZE_STRING ); if ( empty( $keyword ) ) { die(); } $arg = array( 'post_status' => 'publish', 'post_type' => $post_types, 'posts_per_page' => 50, 's' => $keyword ); $the_query = new WP_Query( $arg ); $found_products = array(); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $prd = wc_get_product( get_the_ID() ); if ( $prd->has_child() && $prd->is_type( 'variable' ) ) { $product_children = $prd->get_children(); if ( count( $product_children ) ) { foreach ( $product_children as $product_child ) { if ( woocommerce_version_check() ) { $product = array( 'id' => $product_child, 'text' => get_the_title( $product_child ) ); } else { $child_wc = wc_get_product( $product_child ); $get_atts = $child_wc->get_variation_attributes(); $attr_name = array_values( $get_atts )[0]; $product = array( 'id' => $product_child, 'text' => get_the_title() . ' - ' . $attr_name ); } $found_products[] = $product; } } } else { $product = array( 'id' => get_the_ID(), 'text' => get_the_title() ); $found_products[] = $product; } } } wp_send_json( $found_products ); die; } /** * Get files in directory * * @param $dir * * @return array|bool */ static private function scan_dir( $dir ) { $ignored = array( '.', '..', '.svn', '.htaccess', 'test-log.log' ); $files = array(); foreach ( scandir( $dir ) as $file ) { if ( in_array( $file, $ignored ) ) { continue; } $files[ $file ] = filemtime( $dir . '/' . $file ); } arsort( $files ); $files = array_keys( $files ); return ( $files ) ? $files : false; } private function stripslashes_deep( $value ) { $value = is_array( $value ) ? array_map( 'stripslashes_deep', $value ) : stripslashes( $value ); return $value; } /** * Save post meta * * @param $post * * @return bool */ public function save_meta_boxes() { if ( ! isset( $_POST['_wnotification_nonce'] ) || ! isset( $_POST['wnotification_params'] ) ) { return false; } if ( ! wp_verify_nonce( $_POST['_wnotification_nonce'], 'wnotification_save_email_settings' ) ) { return false; } if ( ! current_user_can( 'manage_options' ) ) { return false; } $_POST['wnotification_params']['conditional_tags'] = $this->stripslashes_deep( $_POST['wnotification_params']['conditional_tags'] ); update_option( '_woocommerce_notification_prefix', substr( md5( date( "YmdHis" ) ), 0, 10 ) ); update_option( 'wnotification_params', $_POST['wnotification_params'] ); if ( is_plugin_active( 'wp-fastest-cache/wpFastestCache.php' ) ) { $cache = new WpFastestCache(); $cache->deleteCache( true ); } } /** * Set Nonce * @return string */ protected static function set_nonce() { return wp_nonce_field( 'wnotification_save_email_settings', '_wnotification_nonce' ); } /** * Set field in meta box * * @param $field * @param bool $multi * * @return string */ protected static function set_field( $field, $multi = false ) { if ( $field ) { if ( $multi ) { return 'wnotification_params[' . $field . '][]'; } else { return 'wnotification_params[' . $field . ']'; } } else { return ''; } } /** * Get Post Meta * * @param $field * * @return bool */ public static function get_field( $field, $default = '' ) { $params = get_option( 'wnotification_params', array() ); if ( self::$params ) { $params = self::$params; } else { self::$params = $params; } if ( isset( $params[ $field ] ) && $field ) { return $params[ $field ]; } else { return $default; } } /** * Get list shortcode * @return array */ public static function page_callback() { self::$params = get_option( 'wnotification_params', array() ); ?> <div class="wrap woocommerce-notification"> <h2><?php esc_attr_e( 'WooCommerce Notification Settings', 'woocommerce-notification' ) ?></h2> <div class="top-help"> <a target="_blank" class="button" href="https://villatheme.com/supports/forum/plugins/woocommerce-notification/"><?php esc_html_e( 'Get Support', 'woocommerce-notification' ) ?></a> <a target="_blank" class="button" href="http://docs.villatheme.com/?item=woocommerce-notification"><?php esc_html_e( 'Documentation', 'woocommerce-notification' ) ?></a> </div> <form method="post" action="" class="vi-ui form"> <?php echo ent2ncr( self::set_nonce() ) ?> <div class="vi-ui attached tabular menu"> <div class="item active" data-tab="general"><?php esc_html_e( 'General', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="design"><?php esc_html_e( 'Design', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="products"><?php esc_html_e( 'Products', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="product-detail"><?php esc_html_e( 'Product Detail', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="time"><?php esc_html_e( 'Time', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="sound"><?php esc_html_e( 'Sound', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="short-code"><?php esc_html_e( 'Short code', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="assign"><?php esc_html_e( 'Assign', 'woocommerce-notification' ) ?></div> <div class="item" data-tab="logs"><?php esc_html_e( 'Report', 'woocommerce-notification' ) ?></div> </div> <div class="vi-ui bottom attached tab segment active" data-tab="general"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'enable' ) ?>"> <?php esc_html_e( 'Enable', 'woocommerce-notification' ) ?> </label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'enable' ) ?>" type="checkbox" <?php checked( self::get_field( 'enable' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'enable' ) ?>" /> <label></label> </div> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'enable_mobile' ) ?>"> <?php esc_html_e( 'Mobile', 'woocommerce-notification' ) ?> </label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'enable_mobile' ) ?>" type="checkbox" <?php checked( self::get_field( 'enable_mobile' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'enable_mobile' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Notification will show on mobile and responsive.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!--Products--> <div class="vi-ui bottom attached tab segment" data-tab="products"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Show Products', 'woocommerce-notification' ) ?></label> </th> <td> <select name="<?php echo self::set_field( 'archive_page' ) ?>" class="vi-ui fluid dropdown"> <option <?php selected( self::get_field( 'archive_page' ), 0 ) ?> value="0"><?php esc_attr_e( 'Get from Billing', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'archive_page' ), 1 ) ?> value="1"><?php esc_attr_e( 'Select Products', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'archive_page' ), 2 ) ?> value="2"><?php esc_attr_e( 'Latest Products', 'woocommerce-notification' ) ?></option> </select> <p class="description"><?php esc_html_e( 'You can arrange product order or special product which you want to up-sell.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="hidden latest-product"> <th scope="row"> <label><?php esc_html_e( 'Limit Product', 'woocommerce-notification' ) ?></label> </th> <td> <input id="<?php echo self::set_field( 'limit_product' ) ?>" type="number" tabindex="0" value="<?php echo self::get_field( 'limit_product', 50 ) ?>" name="<?php echo self::set_field( 'limit_product' ) ?>" /> <p class="description"><?php esc_html_e( 'Product quantity will be got in list latest products.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="hidden exclude_products"> <th scope="row"> <label><?php esc_html_e( 'Exclude Products', 'woocommerce-notification' ) ?></label> </th> <td> <?php $products = self::get_field( 'exclude_products', array() ); ?> <select multiple="multiple" name="<?php echo self::set_field( 'exclude_products', true ) ?>" class="product-search" placeholder="<?php esc_attr_e( 'Please select products', 'woocommerce-notification' ) ?>"> <?php if ( count( $products ) ) { $args_p = array( 'post_type' => array( 'product', 'product_variation' ), 'post_status' => 'publish', 'post__in' => $products ); $the_query_p = new WP_Query( $args_p ); if ( $the_query_p->have_posts() ) { $products = $the_query_p->posts; foreach ( $products as $product ) { $data = wc_get_product( $product ); if ( woocommerce_version_check() ) { if ( $data->get_type() == 'variation' ) { $name_prd = $data->get_name(); } else { $name_prd = $data->get_title(); } } else { $prd_var_title = $data->post->post_title; if ( $data->get_type() == 'variation' ) { $prd_var_attr = $data->get_variation_attributes(); $attr_name1 = array_values( $prd_var_attr )[0]; $name_prd = $prd_var_title . ' - ' . $attr_name1; } else { $name_prd = $prd_var_title; } } if ( $data ) { ?> <option selected="selected" value="<?php echo esc_attr( $data->get_id() ) ?>"><?php echo esc_html( $name_prd ) ?></option> <?php } } } // Reset Post Data wp_reset_postdata(); } ?> </select> <p class="description"><?php esc_html_e( 'These products will not show on notification.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'product_link' ) ?>"><?php esc_html_e( 'External link', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'product_link' ) ?>" type="checkbox" <?php checked( self::get_field( 'product_link' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'product_link' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Working with External/Affiliate product. Product link is product URL.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="get_from_billing hidden"> <th scope="row"> <label><?php esc_html_e( 'Order Time', 'woocommerce-notification' ) ?></label> </th> <td> <div class="fields"> <div class="twelve wide field"> <input type="number" value="<?php echo self::get_field( 'order_threshold_num', 30 ) ?>" name="<?php echo self::set_field( 'order_threshold_num' ) ?>" /> </div> <div class="two wide field"> <select name="<?php echo self::set_field( 'order_threshold_time' ) ?>" class="vi-ui fluid dropdown"> <option <?php selected( self::get_field( 'order_threshold_time' ), 0 ) ?> value="0"><?php esc_attr_e( 'Hours', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'order_threshold_time' ), 1 ) ?> value="1"><?php esc_attr_e( 'Days', 'woocommerce-notification' ) ?></option> </select> </div> </div> <p class="description"><?php esc_html_e( 'Products in this recently time will get from order. ', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="select_product hidden"> <th scope="row"> <label><?php esc_html_e( 'Select Products', 'woocommerce-notification' ) ?></label> </th> <td> <?php $products_ach = self::get_field( 'archive_products', array() ); ?> <select multiple="multiple" name="<?php echo self::set_field( 'archive_products', true ) ?>" class="product-search" placeholder="<?php esc_attr_e( 'Please select products', 'woocommerce-notification' ) ?>"> <?php if ( count( $products_ach ) ) { $args_p = array( 'post_type' => array( 'product', 'product_variation' ), 'post_status' => 'publish', 'post__in' => $products_ach ); $the_query_p = new WP_Query( $args_p ); if ( $the_query_p->have_posts() ) { $products_ach = $the_query_p->posts; foreach ( $products_ach as $product_ach ) { $data_ach = wc_get_product( $product_ach ); if ( woocommerce_version_check() ) { if ( $data_ach->get_type() == 'variation' ) { $name_prd = $data_ach->get_name(); } else { $name_prd = $data_ach->get_title(); } } else { $prd_var_title = $data_ach->post->post_title; if ( $data_ach->get_type() == 'variation' ) { $prd_var_attr = $data_ach->get_variation_attributes(); $attr_name1 = array_values( $prd_var_attr )[0]; $name_prd = $prd_var_title . ' - ' . $attr_name1; } else { $name_prd = $prd_var_title; } } if ( $data_ach ) { ?> <option selected="selected" value="<?php echo esc_attr( $data_ach->get_id() ); ?>"><?php echo esc_html( $name_prd ); ?></option> <?php } } } // Reset Post Data wp_reset_postdata(); } ?> </select> </td> </tr> <tr valign="top" class="select_product hidden"> <th scope="row"> <label><?php esc_html_e( 'Virtual First Name', 'woocommerce-notification' ) ?></label> </th> <td> <textarea name="<?php echo self::set_field( 'virtual_name' ) ?>"><?php echo self::get_field( 'virtual_name' ) ?></textarea> <p class="description"><?php esc_html_e( 'Virtual first name what will show on notification. Each first name on a line.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="select_product hidden"> <th scope="row"> <label><?php esc_html_e( 'Virtual Time', 'woocommerce-notification' ) ?></label></th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="number" name="<?php echo self::set_field( 'virtual_time' ) ?>" value="<?php echo self::get_field( 'virtual_time', '10' ) ?>" /> <label><?php esc_html_e( 'hours', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php esc_html_e( 'Time will auto get random in this time threshold ago.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="select_product hidden"> <th scope="row"> <label><?php esc_html_e( 'Address', 'woocommerce-notification' ) ?></label></th> <td> <select name="<?php echo self::set_field( 'country' ) ?>" class="vi-ui fluid dropdown"> <option <?php selected( self::get_field( 'country' ), 0 ) ?> value="0"><?php esc_attr_e( 'Auto Detect', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'country' ), 1 ) ?> value="1"><?php esc_attr_e( 'Virtual', 'woocommerce-notification' ) ?></option> </select> <p class="description"><?php esc_html_e( 'You can use auto detect address or make virtual address of customer.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="virtual_address hidden"> <th scope="row"> <label><?php esc_html_e( 'Virtual City', 'woocommerce-notification' ) ?></label></th> <td> <textarea name="<?php echo self::set_field( 'virtual_city' ) ?>"><?php echo self::get_field( 'virtual_city' ) ?></textarea> <p class="description"><?php esc_html_e( 'Virtual city name what will show on notification. Each city name on a line.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="virtual_address hidden"> <th scope="row"> <label><?php esc_html_e( 'Virtual Country', 'woocommerce-notification' ) ?></label></th> <td> <input type="text" name="<?php echo self::set_field( 'virtual_country' ) ?>" value="<?php echo self::get_field( 'virtual_country' ) ?>" /> <p class="description"><?php esc_html_e( 'Virtual country name what will show on notification.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="detect_address hidden"> <th scope="row"> <label><?php esc_html_e( 'Ipfind Auth Key', 'woocommerce-notification' ) ?></label></th> <td> <input type="text" name="<?php echo self::set_field( 'ipfind_auth_key' ) ?>" value="<?php echo self::get_field( 'ipfind_auth_key', '2644131a-a1e7-4681-a923-8069a9c9ff2b' ) ?>" /> <p class="description"><?php esc_html_e( 'When you use detect IP, please enter your auth key. You can get at https://ipfind.co', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Product image size', 'woocommerce-notification' ) ?></label> </th> <td> <?php global $_wp_additional_image_sizes; ?> <select name="<?php echo self::set_field( 'product_sizes' ) ?>" class="vi-ui fluid dropdown"> <option <?php selected( self::get_field( 'product_sizes' ), 'shop_thumbnail' ) ?> value="shop_thumbnail"><?php esc_attr_e( 'shop_thumbnail', 'woocommerce-notification' ) ?> - <?php echo isset( $_wp_additional_image_sizes['shop_thumbnail'] ) ? $_wp_additional_image_sizes['shop_thumbnail']['width'] . 'x' . $_wp_additional_image_sizes['shop_thumbnail']['height'] : ''; ?></option> <option <?php selected( self::get_field( 'product_sizes' ), 'shop_catalog' ) ?> value="shop_catalog"><?php esc_attr_e( 'shop_catalog', 'woocommerce-notification' ) ?> - <?php echo isset( $_wp_additional_image_sizes['shop_catalog'] ) ? $_wp_additional_image_sizes['shop_catalog']['width'] . 'x' . $_wp_additional_image_sizes['shop_catalog']['height'] : ''; ?></option> <option <?php selected( self::get_field( 'product_sizes' ), 'shop_single' ) ?> value="shop_single"><?php esc_attr_e( 'shop_single', 'woocommerce-notification' ) ?> - <?php echo isset( $_wp_additional_image_sizes['shop_single'] ) ? $_wp_additional_image_sizes['shop_single']['width'] . 'x' . $_wp_additional_image_sizes['shop_single']['height'] : ''; ?></option> </select> <p class="description"><?php esc_html_e( 'Image size will get form your WordPress site.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'cache_enable' ) ?>"><?php esc_html_e( 'Cache', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'cache_enable' ) ?>" type="checkbox" <?php checked( self::get_field( 'cache_enable' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'cache_enable' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Virtual name and city will be saved in cookie. Your site is faster.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Product detail !--> <div class="vi-ui bottom attached tab segment" data-tab="product-detail"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'enable_single_product' ) ?>"><?php esc_html_e( 'Run single product', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'enable_single_product' ) ?>" type="checkbox" <?php checked( self::get_field( 'enable_single_product' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'enable_single_product' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Notification will only display current product in product detail page that they are viewing.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'show_variation' ) ?>"><?php esc_html_e( 'Show variation', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'show_variation' ) ?>" type="checkbox" <?php checked( self::get_field( 'show_variation' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'show_variation' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Show variation instead of product variable.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Design !--> <div class="vi-ui bottom attached tab segment" data-tab="design"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Message purchased', 'woocommerce-notification' ) ?></label> </th> <td> <textarea name="<?php echo self::set_field( 'message_purchased' ) ?>"><?php echo strip_tags( self::get_field( 'message_purchased', 'Someone in {city}, {country} purchased a {product_with_link} {time_ago}' ) ) ?></textarea> <ul class="description" style="list-style: none"> <li> <span>{first_name}</span> - <?php esc_html_e( 'Customer\'s first name', 'woocommerce-notification' ) ?> </li> <li> <span>{city}</span> - <?php esc_html_e( 'Customer\'s city', 'woocommerce-notification' ) ?> </li> <li> <span>{country}</span> - <?php esc_html_e( 'Customer\'s country', 'woocommerce-notification' ) ?> </li> <li> <span>{product}</span> - <?php esc_html_e( 'Product title', 'woocommerce-notification' ) ?> </li> <li> <span>{product_with_link}</span> - <?php esc_html_e( 'Product title with link', 'woocommerce-notification' ) ?> </li> <li> <span>{time_ago}</span> - <?php esc_html_e( 'Time after purchase', 'woocommerce-notification' ) ?> </li> <li> <span>{custom}</span> - <?php esc_html_e( 'Use custom shortcode', 'woocommerce-notification' ) ?> </li> </ul> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Message checkout', 'woocommerce-notification' ) ?></label> </th> <td> <textarea name="<?php echo self::set_field( 'message_checkout' ) ?>"><?php echo self::get_field( 'message_checkout' ) ?></textarea> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Highlight color', 'woocommerce-notification' ) ?></label> </th> <td> <input data-ele="highlight" type="text" class="color-picker" name="<?php echo self::set_field( 'highlight_color' ) ?>" value="<?php echo self::get_field( 'highlight_color', '#000000' ) ?>" style="background-color: <?php echo esc_attr( self::get_field( 'highlight_color', '#000000' ) ) ?>" /> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Text color', 'woocommerce-notification' ) ?></label> </th> <td> <input data-ele="textcolor" style="background-color: <?php echo esc_attr( self::get_field( 'text_color', '#000000' ) ) ?>" type="text" class="color-picker" name="<?php echo self::set_field( 'text_color' ) ?>" value="<?php echo self::get_field( 'text_color', '#000000' ) ?>" /> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Background color', 'woocommerce-notification' ) ?></label> </th> <td> <input style="background-color: <?php echo esc_attr( self::get_field( 'background_color', '#ffffff' ) ) ?>" data-ele="backgroundcolor" type="text" class="color-picker" name="<?php echo self::set_field( 'background_color' ) ?>" value="<?php echo self::get_field( 'background_color', '#ffffff' ) ?>" /> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Image Position', 'woocommerce-notification' ) ?></label> </th> <td> <select name="<?php echo self::set_field( 'image_position' ) ?>" class="vi-ui fluid dropdown"> <option <?php selected( self::get_field( 'image_position' ), 0 ) ?> value="0"><?php esc_attr_e( 'Left', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'image_position' ), 1 ) ?> value="1"><?php esc_attr_e( 'Right', 'woocommerce-notification' ) ?></option> </select> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Position', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="fields"> <div class="four wide field"> <img src="<?php echo VI_WNOTIFICATION_IMAGES . 'position_1.jpg' ?>" class="vi-ui centered medium image middle aligned " /> <div class="vi-ui toggle checkbox center aligned segment"> <input id="<?php echo self::set_field( 'position' ) ?>" type="radio" <?php checked( self::get_field( 'position', 0 ), 0 ) ?> tabindex="0" class="hidden" value="0" name="<?php echo self::set_field( 'position' ) ?>" /> <label><?php esc_attr_e( 'Bottom left', 'woocommerce-notification' ) ?></label> </div> </div> <div class="four wide field"> <img src="<?php echo VI_WNOTIFICATION_IMAGES . 'position_2.jpg' ?>" class="vi-ui centered medium image middle aligned " /> <div class="vi-ui toggle checkbox center aligned segment"> <input id="<?php echo self::set_field( 'position' ) ?>" type="radio" <?php checked( self::get_field( 'position' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'position' ) ?>" /> <label><?php esc_attr_e( 'Bottom right', 'woocommerce-notification' ) ?></label> </div> </div> <div class="four wide field"> <img src="<?php echo VI_WNOTIFICATION_IMAGES . 'position_4.jpg' ?>" class="vi-ui centered medium image middle aligned " /> <div class="vi-ui toggle checkbox center aligned segment"> <input id="<?php echo self::set_field( 'position' ) ?>" type="radio" <?php checked( self::get_field( 'position' ), 2 ) ?> tabindex="0" class="hidden" value="2" name="<?php echo self::set_field( 'position' ) ?>" /> <label><?php esc_attr_e( 'Top left', 'woocommerce-notification' ) ?></label> </div> </div> <div class="four wide field"> <img src="<?php echo VI_WNOTIFICATION_IMAGES . 'position_3.jpg' ?>" class="vi-ui centered medium image middle aligned " /> <div class="vi-ui toggle checkbox center aligned segment"> <input id="<?php echo self::set_field( 'position' ) ?>" type="radio" <?php checked( self::get_field( 'position' ), 3 ) ?> tabindex="0" class="hidden" value="3" name="<?php echo self::set_field( 'position' ) ?>" /> <label><?php esc_attr_e( 'Top right', 'woocommerce-notification' ) ?></label> </div> </div> </div> </div> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'show_close_icon' ) ?>"> <?php esc_html_e( 'Show Close Icon', 'woocommerce-notification' ) ?> </label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'show_close_icon' ) ?>" type="checkbox" <?php checked( self::get_field( 'show_close_icon' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'show_close_icon' ) ?>" /> <label></label> </div> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'message_display_effect' ) ?>"> <?php esc_html_e( 'Message display effect', 'woocommerce-notification' ) ?> </label> </th> <td> <select name="<?php echo self::set_field( 'message_display_effect' ) ?>" class="vi-ui fluid dropdown" id="<?php echo self::set_field( 'message_display_effect' ) ?>"> <optgroup label="Bouncing Entrances"> <option <?php selected( self::get_field( 'message_display_effect' ), 'bounceIn' ) ?> value="bounceIn"><?php esc_attr_e( 'bounceIn', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'bounceInDown' ) ?> value="bounceInDown"><?php esc_attr_e( 'bounceInDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'bounceInLeft' ) ?> value="bounceInLeft"><?php esc_attr_e( 'bounceInLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'bounceInRight' ) ?> value="bounceInRight"><?php esc_attr_e( 'bounceInRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'bounceInUp' ) ?> value="bounceInUp"><?php esc_attr_e( 'bounceInUp', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Fading Entrances"> <option <?php selected( self::get_field( 'message_display_effect' ), 'fade-in' ) ?> value="fade-in"><?php esc_attr_e( 'fadeIn', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInDown' ) ?> value="fadeInDown"><?php esc_attr_e( 'fadeInDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInDownBig' ) ?> value="fadeInDownBig"><?php esc_attr_e( 'fadeInDownBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInLeft' ) ?> value="fadeInLeft"><?php esc_attr_e( 'fadeInLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInLeftBig' ) ?> value="fadeInLeftBig"><?php esc_attr_e( 'fadeInLeftBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInRight' ) ?> value="fadeInRight"><?php esc_attr_e( 'fadeInRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInRightBig' ) ?> value="fadeInRightBig"><?php esc_attr_e( 'fadeInRightBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInUp' ) ?> value="fadeInUp"><?php esc_attr_e( 'fadeInUp', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'fadeInUpBig' ) ?> value="fadeInUpBig"><?php esc_attr_e( 'fadeInUpBig', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Flippers"> <option <?php selected( self::get_field( 'message_display_effect' ), 'flipInX' ) ?> value="flipInX"><?php esc_attr_e( 'flipInX', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'flipInY' ) ?> value="flipInY"><?php esc_attr_e( 'flipInY', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Lightspeed"> <option <?php selected( self::get_field( 'message_display_effect' ), 'lightSpeedIn' ) ?> value="lightSpeedIn"><?php esc_attr_e( 'lightSpeedIn', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Rotating Entrances"> <option <?php selected( self::get_field( 'message_display_effect' ), 'rotateIn' ) ?> value="rotateIn"><?php esc_attr_e( 'rotateIn', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'rotateInDownLeft' ) ?> value="rotateInDownLeft"><?php esc_attr_e( 'rotateInDownLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'rotateInDownRight' ) ?> value="rotateInDownRight"><?php esc_attr_e( 'rotateInDownRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'rotateInUpLeft' ) ?> value="rotateInUpLeft"><?php esc_attr_e( 'rotateInUpLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'rotateInUpRight' ) ?> value="rotateInUpRight"><?php esc_attr_e( 'rotateInUpRight', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Sliding Entrances"> <option <?php selected( self::get_field( 'message_display_effect' ), 'slideInUp' ) ?> value="slideInUp"><?php esc_attr_e( 'slideInUp', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'slideInDown' ) ?> value="slideInDown"><?php esc_attr_e( 'slideInDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'slideInLeft' ) ?> value="slideInLeft"><?php esc_attr_e( 'slideInLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'slideInRight' ) ?> value="slideInRight"><?php esc_attr_e( 'slideInRight', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Zoom Entrances"> <option <?php selected( self::get_field( 'message_display_effect' ), 'zoomIn' ) ?> value="zoomIn"><?php esc_attr_e( 'zoomIn', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'zoomInDown' ) ?> value="zoomInDown"><?php esc_attr_e( 'zoomInDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'zoomInLeft' ) ?> value="zoomInLeft"><?php esc_attr_e( 'zoomInLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'zoomInRight' ) ?> value="zoomInRight"><?php esc_attr_e( 'zoomInRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_display_effect' ), 'zoomInUp' ) ?> value="zoomInUp"><?php esc_attr_e( 'zoomInUp', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Special"> <option <?php selected( self::get_field( 'message_display_effect' ), 'rollIn' ) ?> value="rollIn"><?php esc_attr_e( 'rollIn', 'woocommerce-notification' ) ?></option> </optgroup> </select> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'message_hidden_effect' ) ?>"> <?php esc_html_e( 'Message hidden effect', 'woocommerce-notification' ) ?> </label> </th> <td> <select name="<?php echo self::set_field( 'message_hidden_effect' ) ?>" class="vi-ui fluid dropdown" id="<?php echo self::set_field( 'message_hidden_effect' ) ?>"> <optgroup label="Bouncing Exits"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'bounceOut' ) ?> value="bounceOut"><?php esc_attr_e( 'bounceOut', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'bounceOutDown' ) ?> value="bounceOutDown"><?php esc_attr_e( 'bounceOutDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'bounceOutLeft' ) ?> value="bounceOutLeft"><?php esc_attr_e( 'bounceOutLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'bounceOutRight' ) ?> value="bounceOutRight"><?php esc_attr_e( 'bounceOutRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'bounceOutUp' ) ?> value="bounceOutUp"><?php esc_attr_e( 'bounceOutUp', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Fading Exits"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fade-out' ) ?> value="fade-out"><?php esc_attr_e( 'fadeOut', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutDown' ) ?> value="fadeOutDown"><?php esc_attr_e( 'fadeOutDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutDownBig' ) ?> value="fadeOutDownBig"><?php esc_attr_e( 'fadeOutDownBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutLeft' ) ?> value="fadeOutLeft"><?php esc_attr_e( 'fadeOutLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutLeftBig' ) ?> value="fadeOutLeftBig"><?php esc_attr_e( 'fadeOutLeftBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutRight' ) ?> value="fadeOutRight"><?php esc_attr_e( 'fadeOutRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutRightBig' ) ?> value="fadeOutRightBig"><?php esc_attr_e( 'fadeOutRightBig', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutUp' ) ?> value="fadeOutUp"><?php esc_attr_e( 'fadeOutUp', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'fadeOutUpBig' ) ?> value="fadeOutUpBig"><?php esc_attr_e( 'fadeOutUpBig', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Flippers"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'flipOutX' ) ?> value="flipOutX"><?php esc_attr_e( 'flipOutX', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'flipOutY' ) ?> value="flipOutY"><?php esc_attr_e( 'flipOutY', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Lightspeed"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'lightSpeedOut' ) ?> value="lightSpeedOut"><?php esc_attr_e( 'lightSpeedOut', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Rotating Exits"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rotateOut' ) ?> value="rotateOut"><?php esc_attr_e( 'rotateOut', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rotateOutDownLeft' ) ?> value="rotateOutDownLeft"><?php esc_attr_e( 'rotateOutDownLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rotateOutDownRight' ) ?> value="rotateOutDownRight"><?php esc_attr_e( 'rotateOutDownRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rotateOutUpLeft' ) ?> value="rotateOutUpLeft"><?php esc_attr_e( 'rotateOutUpLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rotateOutUpRight' ) ?> value="rotateOutUpRight"><?php esc_attr_e( 'rotateOutUpRight', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Sliding Exits"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'slideOutUp' ) ?> value="slideOutUp"><?php esc_attr_e( 'slideOutUp', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'slideOutDown' ) ?> value="slideOutDown"><?php esc_attr_e( 'slideOutDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'slideOutLeft' ) ?> value="slideOutLeft"><?php esc_attr_e( 'slideOutLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'slideOutRight' ) ?> value="slideOutRight"><?php esc_attr_e( 'slideOutRight', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Zoom Exits"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'zoomOut' ) ?> value="zoomOut"><?php esc_attr_e( 'zoomOut', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'zoomOutDown' ) ?> value="zoomOutDown"><?php esc_attr_e( 'zoomOutDown', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'zoomOutLeft' ) ?> value="zoomOutLeft"><?php esc_attr_e( 'zoomOutLeft', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'zoomOutRight' ) ?> value="zoomOutRight"><?php esc_attr_e( 'zoomOutRight', 'woocommerce-notification' ) ?></option> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'zoomOutUp' ) ?> value="zoomOutUp"><?php esc_attr_e( 'zoomOutUp', 'woocommerce-notification' ) ?></option> </optgroup> <optgroup label="Special"> <option <?php selected( self::get_field( 'message_hidden_effect' ), 'rollOut' ) ?> value="rollOut"><?php esc_attr_e( 'rollOut', 'woocommerce-notification' ) ?></option> </optgroup> </select> </td> </tr> </tbody> </table> <?php $class = array(); switch ( self::get_field( 'position' ) ) { case 1: $class[] = 'bottom_right'; break; case 2: $class[] = 'top_left'; break; case 3: $class[] = 'top_right'; break; default: $class[] = ''; } $class[] = self::get_field( 'image_position' ) ? 'img-right' : ''; ?> <div style="display: block;" class="customized <?php echo esc_attr( implode( ' ', $class ) ) ?>" id="message-purchased" data-effect_display="<?php echo esc_attr( self::get_field( 'message_display_effect' ) ); ?>" data-effect_hidden="<?php echo esc_attr( self::get_field( 'message_hidden_effect' ) ); ?>"> <img src="<?php echo esc_url( VI_WNOTIFICATION_IMAGES . 'demo-image.jpg' ) ?>"> <p>Joe Doe in London, England purchased a <a href="#">Ninja Silhouette</a> <small>About 9 hours ago</small> </p> <span id="notify-close"></span> </div> </div> <!-- Time !--> <div class="vi-ui bottom attached tab segment" data-tab="time"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'loop' ) ?>"><?php esc_html_e( 'Loop', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'loop' ) ?>" type="checkbox" <?php checked( self::get_field( 'loop' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'loop' ) ?>" /> <label></label> </div> </td> </tr> <tr valign="top" class="hidden time_loop"> <th scope="row"> <label><?php esc_html_e( 'Next time display', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="number" name="<?php echo self::set_field( 'next_time' ) ?>" value="<?php echo self::get_field( 'next_time', 60 ) ?>" /> <label><?php esc_html_e( 'seconds', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php esc_html_e( 'Time to show next notification ', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="hidden time_loop"> <th scope="row"> <label><?php esc_html_e( 'Notification per page', 'woocommerce-notification' ) ?></label> </th> <td> <input type="number" name="<?php echo self::set_field( 'notification_per_page' ) ?>" value="<?php echo self::get_field( 'notification_per_page', 30 ) ?>" /> <p class="description"><?php esc_html_e( 'Number of notifications on a page.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'initial_delay_random' ) ?>"><?php esc_html_e( 'Initial time random', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'initial_delay_random' ) ?>" type="checkbox" <?php checked( self::get_field( 'initial_delay_random' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'initial_delay_random' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Initial time will be random from 0 to current vaule.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top" class="hidden initial_delay_random"> <th scope="row"> <label><?php esc_html_e( 'Minimum initial delay time', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="number" name="<?php echo self::set_field( 'initial_delay_min' ) ?>" value="<?php echo self::get_field( 'initial_delay_min', 0 ) ?>" /> <label><?php esc_html_e( 'seconds', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php esc_html_e( 'Time will be random from Initial delay time min to Initial time.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Initial delay', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="number" name="<?php echo self::set_field( 'initial_delay' ) ?>" value="<?php echo self::get_field( 'initial_delay', 0 ) ?>" /> <label><?php esc_html_e( 'seconds', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php esc_html_e( 'When your site loads, notifications will show after this amount of time', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Display time', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="number" name="<?php echo self::set_field( 'display_time' ) ?>" value="<?php echo self::get_field( 'display_time', 5 ) ?>" /> <label><?php esc_html_e( 'seconds', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php esc_html_e( 'Time your notification display.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Sound !--> <div class="vi-ui bottom attached tab segment" data-tab="sound"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'sound_enable' ) ?>"><?php esc_html_e( 'Enable', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'sound_enable' ) ?>" type="checkbox" <?php checked( self::get_field( 'sound_enable' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'sound_enable' ) ?>" /> <label></label> </div> </td> </tr> <tr valign="top"> <th scope="row"> <label><?php esc_html_e( 'Sound', 'woocommerce-notification' ) ?></label> </th> <td> <?php $sounds = self::scan_dir( VI_WNOTIFICATION_SOUNDS ); ?> <select name="<?php echo self::set_field( 'sound' ) ?>" class="vi-ui fluid dropdown"> <?php foreach ( $sounds as $sound ) { ?> <option <?php selected( self::get_field( 'sound', 'cool' ), $sound ) ?> value="<?php echo esc_attr( $sound ) ?>"><?php echo esc_html( $sound ) ?></option> <?php } ?> </select> <p class="description"><?php echo esc_html__( 'Please select sound. Notification rings when show.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Short code !--> <div class="vi-ui bottom attached tab segment" data-tab="short-code"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'custom_shortcode' ) ?>"><?php esc_html_e( 'Custom', 'woocommerce-notification' ) ?></label> </th> <td> <input id="<?php echo self::set_field( 'custom_shortcode' ) ?>" type="text" tabindex="0" value="<?php echo self::get_field( 'custom_shortcode', esc_attr( '{number} people seeing this product right now' ) ) ?>" name="<?php echo self::set_field( 'custom_shortcode' ) ?>" /> <p class="description"><?php esc_html_e( 'This is {custom} shortcode content.', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'min_number' ) ?>"><?php esc_html_e( 'Min Number', 'woocommerce-notification' ) ?></label> </th> <td> <input id="<?php echo self::set_field( 'min_number' ) ?>" type="number" tabindex="0" value="<?php echo self::get_field( 'min_number', 100 ) ?>" name="<?php echo self::set_field( 'min_number' ) ?>" /> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'max_number' ) ?>"><?php esc_html_e( 'Max number', 'woocommerce-notification' ) ?></label> </th> <td> <input id="<?php echo self::set_field( 'max_number' ) ?>" type="number" tabindex="0" value="<?php echo self::get_field( 'max_number', 200 ) ?>" name="<?php echo self::set_field( 'max_number' ) ?>" /> <p class="description"><?php esc_html_e( 'Number will random from Min number to Max number', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Assign !--> <div class="vi-ui bottom attached tab segment" data-tab="assign"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'is_home' ) ?>"><?php esc_html_e( 'Home page', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'is_home' ) ?>" type="checkbox" <?php checked( self::get_field( 'is_home' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'is_home' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Turn on is hidden notification on Home page', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'is_checkout' ) ?>"><?php esc_html_e( 'Checkout page', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'is_checkout' ) ?>" type="checkbox" <?php checked( self::get_field( 'is_checkout' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'is_checkout' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Turn on is hidden notification on Checkout page', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'is_cart' ) ?>"><?php esc_html_e( 'Cart page', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'is_cart' ) ?>" type="checkbox" <?php checked( self::get_field( 'is_cart' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'is_cart' ) ?>" /> <label></label> </div> <p class="description"><?php esc_html_e( 'Turn on is hidden notification on Cart page', 'woocommerce-notification' ) ?></p> </td> </tr> <tr valign="top"> <th scope="row"> <?php esc_html_e( 'Conditional Tags', 'woocommerce-notification' ) ?> </th> <td> <input placeholder="<?php esc_html_e( 'eg: !is_page(34,98,73)', 'woocommerce-notification' ) ?>" type="text" value="<?php echo htmlentities( self::get_field( 'conditional_tags' ) ) ?>" name="<?php echo self::set_field( 'conditional_tags' ) ?>" /> <p class="description"><?php esc_html_e( 'Let you adjust which pages will appear using WP\'s conditional tags.', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <!-- Logs !--> <div class="vi-ui bottom attached tab segment" data-tab="logs"> <!-- Tab Content !--> <table class="optiontable form-table"> <tbody> <tr valign="top"> <th scope="row"> <label for="<?php echo self::set_field( 'save_logs' ) ?>"><?php esc_html_e( 'Save Logs', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui toggle checkbox"> <input id="<?php echo self::set_field( 'save_logs' ) ?>" type="checkbox" <?php checked( self::get_field( 'save_logs' ), 1 ) ?> tabindex="0" class="hidden" value="1" name="<?php echo self::set_field( 'save_logs' ) ?>" /> <label></label> </div> </td> </tr> <tr valign="top" class="hidden save_logs"> <th scope="row"> <label><?php esc_html_e( 'History time', 'woocommerce-notification' ) ?></label> </th> <td> <div class="vi-ui form"> <div class="inline fields"> <input type="text" name="<?php echo self::set_field( 'history_time' ) ?>" value="<?php echo self::get_field( 'history_time', 30 ) ?>" /> <label><?php esc_html_e( 'days', 'woocommerce-notification' ) ?></label> </div> </div> <p class="description"><?php echo esc_html__( 'Logs will be saved at ', 'woocommerce-notification' ) . VI_WNOTIFICATION_CACHE . esc_html__( ' in time', 'woocommerce-notification' ) ?></p> </td> </tr> </tbody> </table> </div> <p style="position: relative; z-index: 99999; margin-bottom: 70px;"> <input type="submit" class="button button-primary" value=" <?php esc_html_e( 'Save', 'woocommerce-notification' ) ?> " /> </p> </form> </div> <?php } } ?>