css
9 months ago
img
9 months ago
js
9 months ago
partials
9 months ago
class-adv-order-filter.php
9 months ago
class-analytics.php
9 months ago
class-order-tip-promotion.php
9 months ago
class-pi-dtt-labels.php
9 months ago
class-pi-dtt-order-table.php
9 months ago
conflict-fixer.php
9 months ago
menu.php
9 months ago
options-addons.php
9 months ago
options-date.php
9 months ago
options-limit.php
9 months ago
options-pickup.php
9 months ago
options-time-slot.php
9 months ago
options-time.php
9 months ago
options.php
9 months ago
options-pickup.php
120 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'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Pickup locations','pisol-dtt'), 'type'=>'setting_category', 'links' => [ |
| 24 | [ |
| 25 | "name" => "Read more about this", |
| 26 | "url" => "https://www.piwebsolution.com/user-documentation/#Pickup_Location_Settings" |
| 27 | ] |
| 28 | ]), |
| 29 | |
| 30 | 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'), |
| 31 | |
| 32 | 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'), |
| 33 | ); |
| 34 | |
| 35 | |
| 36 | if($this->this_tab == $this->active_tab){ |
| 37 | add_action('pisol_dtt_tab_content', array($this,'tab_content')); |
| 38 | } |
| 39 | |
| 40 | add_action('pisol_dtt_tab', array($this,'tab'),4); |
| 41 | |
| 42 | |
| 43 | $this->register_settings(); |
| 44 | |
| 45 | if(PISOL_DTT_FREE_RESET_SETTING){ |
| 46 | $this->delete_settings(); |
| 47 | } |
| 48 | |
| 49 | } |
| 50 | |
| 51 | function delete_settings(){ |
| 52 | foreach($this->settings as $setting){ |
| 53 | delete_option( $setting['field'] ); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | function register_settings(){ |
| 58 | |
| 59 | foreach($this->settings as $setting){ |
| 60 | register_setting( $this->setting_key, $setting['field']); |
| 61 | } |
| 62 | |
| 63 | } |
| 64 | |
| 65 | function tab(){ |
| 66 | $page = sanitize_text_field(filter_input( INPUT_GET, 'page')); |
| 67 | $this->tab_name = __('Pickup Locations','pisol-dtt'); |
| 68 | ?> |
| 69 | <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 ) ); ?>"> |
| 70 | <span class="dashicons dashicons-location"></span> <?php echo esc_html($this->tab_name); ?> |
| 71 | </a> |
| 72 | <?php |
| 73 | } |
| 74 | |
| 75 | function tab_content(){ |
| 76 | ?> |
| 77 | <form method="post" action="options.php" class="pisol-setting-form"> |
| 78 | <?php settings_fields( $this->setting_key ); ?> |
| 79 | <?php |
| 80 | foreach($this->settings as $setting){ |
| 81 | new pisol_class_form($setting, $this->setting_key); |
| 82 | } |
| 83 | ?> |
| 84 | |
| 85 | <input type="submit" name="submit" id="submit" class="btn btn-primary btn-lg my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>"> |
| 86 | </form> |
| 87 | <div class="alert alert-info my-3 text-center"> |
| 88 | <h2 class="h5">Pro version allows you to add <i><u>Unlimited</u></i> number of pickup locations<h2> |
| 89 | <a class="btn btn-primary btn-lg" href="<?php echo esc_url( PISOL_DTT_BUY_URL ); ?>" target="_blank">Click to Buy Now</a> |
| 90 | </div> |
| 91 | <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> |
| 92 | <div class="border p-2 my-3"> |
| 93 | <div class="row align-items-center"> |
| 94 | <div class="col-12 col-md-5"> |
| 95 | <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> |
| 96 | </div> |
| 97 | <div class="col-12 col-md-7"> |
| 98 | <h3>Different date time for Different pickup stores and Different delivery areas PRO (Addon for pro plugin)</h3> |
| 99 | <ul> |
| 100 | <li>Offer different Time for different pickup stores</li> |
| 101 | <li>Set different working days for different pickup stores</li> |
| 102 | <li>Offer different Time for different delivery zones ( WooCommerce shipping zone )</li> |
| 103 | </ul> |
| 104 | <div class="py-2 text-right"> |
| 105 | <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> |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | </div> |
| 110 | <?php |
| 111 | } |
| 112 | |
| 113 | |
| 114 | } |
| 115 | |
| 116 | add_action('init', function(){ |
| 117 | /* if we have pro version setting for time tab then we can disable this */ |
| 118 | new pisol_dtt_option_pickup_location(); |
| 119 | }); |
| 120 |