css
2 years ago
img
2 years ago
js
2 years ago
class-adv-order-filter.php
2 years ago
class-pi-dtt-labels.php
2 years ago
class-pi-dtt-order-table.php
2 years ago
conflict-fixer.php
2 years ago
menu.php
2 years ago
options-addons.php
2 years ago
options-date.php
2 years ago
options-limit.php
2 years ago
options-pickup.php
2 years ago
options-time-slot.php
2 years ago
options-time.php
2 years ago
options.php
2 years ago
options-pickup.php
109 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 | ?> |
| 61 | <a class=" pi-side-menu <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?>" href="<?php echo admin_url( 'admin.php?page='.$page.'&tab='.$this->this_tab ); ?>"> |
| 62 | <span class="dashicons dashicons-location"></span> <?php _e( $this->tab_name, 'pisol-dtt' ); ?> |
| 63 | </a> |
| 64 | <?php |
| 65 | } |
| 66 | |
| 67 | function tab_content(){ |
| 68 | ?> |
| 69 | <form method="post" action="options.php" class="pisol-setting-form"> |
| 70 | <?php settings_fields( $this->setting_key ); ?> |
| 71 | <?php |
| 72 | foreach($this->settings as $setting){ |
| 73 | new pisol_class_form($setting, $this->setting_key); |
| 74 | } |
| 75 | ?> |
| 76 | <div class="alert alert-info my-3 text-center"> |
| 77 | <h2 class="h5">Pro version allows you to add <i><u>Unlimited</u></i> number of pickup locations<h2> |
| 78 | <a class="btn btn-primary btn-lg" href="<?php echo PISOL_DTT_BUY_URL; ?>" target="_blank">Click to Buy Now</a> |
| 79 | </div> |
| 80 | <input type="submit" name="submit" id="submit" class="btn btn-primary btn-lg my-3" value="<?php echo __('Save Changes','pisol-dtt'); ?>"> |
| 81 | </form> |
| 82 | |
| 83 | <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> |
| 84 | <div class="border p-2 my-3"> |
| 85 | <div class="row align-items-center"> |
| 86 | <div class="col-12 col-md-5"> |
| 87 | <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> |
| 88 | </div> |
| 89 | <div class="col-12 col-md-7"> |
| 90 | <h3>Different date time for Different pickup stores and Different delivery areas PRO (Addon for pro plugin)</h3> |
| 91 | <ul> |
| 92 | <li>Offer different Time for different pickup stores</li> |
| 93 | <li>Set different working days for different pickup stores</li> |
| 94 | <li>Offer different Time for different delivery zones ( WooCommerce shipping zone )</li> |
| 95 | </ul> |
| 96 | <div class="py-2 text-right"> |
| 97 | <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> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | </div> |
| 102 | <?php |
| 103 | } |
| 104 | |
| 105 | |
| 106 | } |
| 107 | |
| 108 | /* if we have pro version setting for time tab then we can disable this */ |
| 109 | new pisol_dtt_option_pickup_location(); |