css
3 weeks ago
img
3 weeks ago
js
3 weeks ago
partials
3 weeks ago
class-accesscontrol.php
3 weeks ago
class-adv-order-filter.php
3 weeks ago
class-analytics.php
3 weeks ago
class-order-tip-promotion.php
3 weeks ago
class-pi-dtt-labels.php
3 weeks ago
class-pi-dtt-order-table.php
3 weeks ago
conflict-fixer.php
3 weeks ago
menu.php
3 weeks ago
options-accesscontrol.php
3 weeks ago
options-addons.php
3 weeks ago
options-date.php
3 weeks ago
options-limit.php
3 weeks ago
options-pickup.php
3 weeks ago
options-time-slot.php
3 weeks ago
options-time.php
3 weeks ago
options.php
3 weeks ago
options-limit.php
78 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | |
| 4 | class pisol_dtt_option_order_limit{ |
| 5 | |
| 6 | private $settings = array(); |
| 7 | |
| 8 | private $active_tab; |
| 9 | |
| 10 | private $this_tab = 'pi_time_limit'; |
| 11 | |
| 12 | private $tab_name = "Order limit (pro)"; |
| 13 | |
| 14 | private $setting_key = 'pisol_time_limit'; |
| 15 | |
| 16 | private $pro_version = false; |
| 17 | |
| 18 | public $tab; |
| 19 | |
| 20 | function __construct(){ |
| 21 | |
| 22 | $this->pro_version = pi_dtt_pro_check(); |
| 23 | |
| 24 | $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab')); |
| 25 | $this->active_tab = $this->tab != "" ? $this->tab : 'default'; |
| 26 | |
| 27 | $this->settings = array( |
| 28 | array('field'=>'pi_time_slot') |
| 29 | |
| 30 | ); |
| 31 | |
| 32 | |
| 33 | if($this->this_tab == $this->active_tab){ |
| 34 | add_action('pisol_dtt_tab_content', array($this,'tab_content')); |
| 35 | } |
| 36 | |
| 37 | add_action('pisol_dtt_tab', array($this,'tab'),6); |
| 38 | |
| 39 | $this->register_settings(); |
| 40 | |
| 41 | |
| 42 | } |
| 43 | |
| 44 | function register_settings(){ |
| 45 | |
| 46 | foreach($this->settings as $setting){ |
| 47 | register_setting( $this->setting_key, $setting['field']); |
| 48 | } |
| 49 | |
| 50 | } |
| 51 | |
| 52 | function tab(){ |
| 53 | $page = sanitize_text_field(filter_input( INPUT_GET, 'page')); |
| 54 | $this->tab_name = __('Order limit (pro)', 'pisol-dtt'); |
| 55 | ?> |
| 56 | <a class=" pi-side-menu <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?> hide-pro" href="<?php echo esc_url( admin_url( 'admin.php?page='.$page.'&tab='.$this->this_tab ) ); ?>"> |
| 57 | <span class="dashicons dashicons-editor-contract"></span> <?php echo esc_html($this->tab_name); ?> |
| 58 | </a> |
| 59 | <?php |
| 60 | } |
| 61 | |
| 62 | function tab_content(){ |
| 63 | ?> |
| 64 | <div class="alert bg-dark opacity-75 text-light mt-4"> |
| 65 | <strong>Available in PRO</strong> |
| 66 | Using this you can set day or date specific order limit |
| 67 | </div> |
| 68 | <h1>Setting Day-specific order limit</h1> |
| 69 | <img src="<?php echo esc_url( PISOL_DTT_URL ); ?>admin/img/day-limit.png" class="img-fluid"> |
| 70 | <h1>Setting Date specific order limit</h1> |
| 71 | <img src="<?php echo esc_url( PISOL_DTT_URL ); ?>admin/img/date-limit.png" class="img-fluid"> |
| 72 | <?php |
| 73 | } |
| 74 | |
| 75 | } |
| 76 | |
| 77 | new pisol_dtt_option_order_limit(); |
| 78 |