css
1 year ago
img
1 year ago
js
1 year ago
partials
1 year ago
class-adv-order-filter.php
1 year ago
class-order-tip-promotion.php
1 year ago
class-pi-dtt-labels.php
1 year ago
class-pi-dtt-order-table.php
1 year ago
conflict-fixer.php
1 year ago
menu.php
1 year ago
options-addons.php
1 year ago
options-date.php
1 year ago
options-limit.php
1 year ago
options-pickup.php
1 year ago
options-time-slot.php
1 year ago
options-time.php
1 year ago
options.php
1 year ago
options-pickup.php
113 lines
| 1 | <?php |
| 2 | |
| 3 | class pisol_dtt_option_pickup_location{ |
| 4 | |
| 5 | private $settings = array(); |
| 6 | |
| 7 | private $active_tab; |
| 8 | |
| 9 | private $this_tab = 'pickup_location'; |
| 10 | |
| 11 | private $tab_name = "Pickup Locations"; |
| 12 | |
| 13 | private $setting_key = 'pisol_dtt_pickup_location'; |
| 14 | |
| 15 | public $tab; |
| 16 | |
| 17 | function __construct(){ |
| 18 | |
| 19 | $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab')); |
| 20 | $this->active_tab = $this->tab != "" ? $this->tab : 'default'; |
| 21 | |
| 22 | $this->settings = array( |
| 23 | array('field'=>'pi_pickup_address_1', 'label'=>__('Pickup location one','pisol-dtt'),'desc'=>__('Type your pickup address in this text box','pisol-dtt'), 'type'=>'textarea'), |
| 24 | |
| 25 | array('field'=>'pi_pickup_address_2', 'label'=>__('Pickup location two','pisol-dtt'),'desc'=>__('Type your pickup address in this text box','pisol-dtt'), 'type'=>'textarea'), |
| 26 | ); |
| 27 | |
| 28 | |
| 29 | if($this->this_tab == $this->active_tab){ |
| 30 | add_action('pisol_dtt_tab_content', array($this,'tab_content')); |
| 31 | } |
| 32 | |
| 33 | add_action('pisol_dtt_tab', array($this,'tab'),4); |
| 34 | |
| 35 | |
| 36 | $this->register_settings(); |
| 37 | |
| 38 | if(PISOL_DTT_FREE_RESET_SETTING){ |
| 39 | $this->delete_settings(); |
| 40 | } |
| 41 | |
| 42 | } |
| 43 | |
| 44 | function delete_settings(){ |
| 45 | foreach($this->settings as $setting){ |
| 46 | delete_option( $setting['field'] ); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | function register_settings(){ |
| 51 | |
| 52 | foreach($this->settings as $setting){ |
| 53 | register_setting( $this->setting_key, $setting['field']); |
| 54 | } |
| 55 | |
| 56 | } |
| 57 | |
| 58 | function tab(){ |
| 59 | $page = sanitize_text_field(filter_input( INPUT_GET, 'page')); |
| 60 | $this->tab_name = __('Pickup Locations','pisol-dtt'); |
| 61 | ?> |
| 62 | <a class=" pi-side-menu <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?>" href="<?php echo esc_url( admin_url( 'admin.php?page='.$page.'&tab='.$this->this_tab ) ); ?>"> |
| 63 | <span class="dashicons dashicons-location"></span> <?php echo esc_html($this->tab_name); ?> |
| 64 | </a> |
| 65 | <?php |
| 66 | } |
| 67 | |
| 68 | function tab_content(){ |
| 69 | ?> |
| 70 | <form method="post" action="options.php" class="pisol-setting-form"> |
| 71 | <?php settings_fields( $this->setting_key ); ?> |
| 72 | <?php |
| 73 | foreach($this->settings as $setting){ |
| 74 | new pisol_class_form($setting, $this->setting_key); |
| 75 | } |
| 76 | ?> |
| 77 | <div class="alert alert-info my-3 text-center"> |
| 78 | <h2 class="h5">Pro version allows you to add <i><u>Unlimited</u></i> number of pickup locations<h2> |
| 79 | <a class="btn btn-primary btn-lg" href="<?php echo esc_url( PISOL_DTT_BUY_URL ); ?>" target="_blank">Click to Buy Now</a> |
| 80 | </div> |
| 81 | <input type="submit" name="submit" id="submit" class="btn btn-primary btn-lg my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>"> |
| 82 | </form> |
| 83 | |
| 84 | <p>The below addon allows you to offer different date and time for different pickup location or delivery zone. This addon works along with the PRO version only and has to be purchased separately (it is not part of the core Order date and time PRO)</p> |
| 85 | <div class="border p-2 my-3"> |
| 86 | <div class="row align-items-center"> |
| 87 | <div class="col-12 col-md-5"> |
| 88 | <iframe style="width:100%; height:230px;" src="https://www.youtube.com/embed/4lJdvR_s6gc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe> |
| 89 | </div> |
| 90 | <div class="col-12 col-md-7"> |
| 91 | <h3>Different date time for Different pickup stores and Different delivery areas PRO (Addon for pro plugin)</h3> |
| 92 | <ul> |
| 93 | <li>Offer different Time for different pickup stores</li> |
| 94 | <li>Set different working days for different pickup stores</li> |
| 95 | <li>Offer different Time for different delivery zones ( WooCommerce shipping zone )</li> |
| 96 | </ul> |
| 97 | <div class="py-2 text-right"> |
| 98 | <a class="btn btn-md btn-primary" href="https://www.piwebsolution.com/cart/?add-to-cart=6068&variation_id=6069" target="_blank">Buy Now</a> |
| 99 | </div> |
| 100 | </div> |
| 101 | </div> |
| 102 | </div> |
| 103 | <?php |
| 104 | } |
| 105 | |
| 106 | |
| 107 | } |
| 108 | |
| 109 | add_action('init', function(){ |
| 110 | /* if we have pro version setting for time tab then we can disable this */ |
| 111 | new pisol_dtt_option_pickup_location(); |
| 112 | }); |
| 113 |