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