PluginProbe ʕ •ᴥ•ʔ
PiWeb Product Enquiry or product catalog for WooCommerce / 2.2.33.49
PiWeb Product Enquiry or product catalog for WooCommerce v2.2.33.49
2.2.34.43 2.2.34.42 2.2.34.41 2.2.34.40 2.2.34.39 trunk 2.2.22 2.2.26 2.2.33.16 2.2.33.17 2.2.33.19 2.2.33.20 2.2.33.21 2.2.33.22 2.2.33.23 2.2.33.24 2.2.33.26 2.2.33.27 2.2.33.29 2.2.33.30 2.2.33.31 2.2.33.32 2.2.33.33 2.2.33.34 2.2.33.36 2.2.33.37 2.2.33.39 2.2.33.40 2.2.33.41 2.2.33.42 2.2.33.43 2.2.33.44 2.2.33.46 2.2.33.47 2.2.33.49 2.2.34.0 2.2.34.1 2.2.34.10 2.2.34.11 2.2.34.12 2.2.34.13 2.2.34.14 2.2.34.16 2.2.34.17 2.2.34.19 2.2.34.2 2.2.34.20 2.2.34.21 2.2.34.22 2.2.34.23 2.2.34.24 2.2.34.26 2.2.34.27 2.2.34.29 2.2.34.3 2.2.34.30 2.2.34.31 2.2.34.32 2.2.34.33 2.2.34.34 2.2.34.36 2.2.34.37 2.2.34.4 2.2.34.6 2.2.34.7 2.2.34.9
enquiry-quotation-for-woocommerce / admin / class-eqw-cart.php
enquiry-quotation-for-woocommerce / admin Last commit date
css 1 year ago img 1 year ago js 1 year ago partials 1 year ago class-eqw-advance.php 1 year ago class-eqw-cart.php 1 year ago class-eqw-email.php 1 year ago class-eqw-enquiry.php 1 year ago class-eqw-form-control.php 1 year ago class-eqw-menu.php 1 year ago class-eqw-option.php 1 year ago class-eqw-product-options.php 1 year ago class-pisol-enquiry-quotation-woocommerce-admin.php 1 year ago index.php 1 year ago plugins.php 1 year ago
class-eqw-cart.php
98 lines
1 <?php
2
3 class Class_Pi_Eqw_Cart{
4
5 public $plugin_name;
6
7 private $settings = array();
8
9 private $active_tab;
10
11 private $this_tab = 'cart';
12
13 private $tab_name = "Dynamic Cart (PRO)";
14
15 private $setting_key = 'pi_eqw_cart_setting';
16 public $tab;
17
18 function __construct($plugin_name){
19 $this->plugin_name = $plugin_name;
20
21 $this->settings = array(
22
23 array('field'=>'pi_eqw_enable_cart', 'label'=>__('Enable cart icon','pisol-enquiry-quotation-woocommerce'),'type'=>'switch', 'default'=>1, 'desc'=>__('This will show a dynamically updating cart button on each page in the corner','pisol-enquiry-quotation-woocommerce'), 'pro'=>true),
24
25 array('field'=>'pi_eqw_use_shortcode', 'label'=>__('Insert icon using Short code [enquiry_cart_icon]','pisol-enquiry-quotation-woocommerce'),'type'=>'switch', 'default'=>0, 'desc'=>__('This will allow you to insert the icon using shortcode [enquiry_cart_icon], when you enable this auto insertion will be disabled','pisol-enquiry-quotation-woocommerce'), 'pro'=>true),
26
27 array('field'=>'pisol_eqw_cart_img', 'type'=>'image','label'=>__('Dynamic Cart icon','pisol-enquiry-quotation-woocommerce'),'desc'=>__('Dynamic Cart icon','pisol-enquiry-quotation-woocommerce'),'pro'=>true),
28 );
29
30 $this->active_tab = (isset($_GET['tab'])) ? sanitize_text_field($_GET['tab']) : 'default';
31
32 if($this->this_tab == $this->active_tab){
33 add_action($this->plugin_name.'_tab_content', array($this,'tab_content'));
34 }
35
36
37 add_action($this->plugin_name.'_tab', array($this,'tab'),4);
38
39
40 $this->register_settings();
41
42 if(PI_EQW_DELETE_SETTING){
43 $this->delete_settings();
44 }
45 }
46
47 function pages(){
48 $pages = array(0 => 'Select page for Enquiry cart');
49 $obj = get_pages();
50 foreach($obj as $page){
51 $pages[$page->ID] = $page->post_title;
52 }
53 return $pages;
54
55 }
56
57
58 function delete_settings(){
59 foreach($this->settings as $setting){
60 delete_option( $setting['field'] );
61 }
62 }
63
64 function register_settings(){
65
66 foreach($this->settings as $setting){
67 register_setting( $this->setting_key, $setting['field']);
68 }
69
70 }
71
72 function tab(){
73 $this->tab_name = __('Dynamic Cart (PRO)','pisol-enquiry-quotation-woocommerce');
74 ?>
75 <a class="hide-pro px-3 text-light d-flex align-items-center border-left border-right <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?>" href="<?php echo esc_url( admin_url( 'admin.php?page='.sanitize_text_field($_GET['page']).'&tab='.$this->this_tab ) ); ?>">
76 <?php echo esc_html( $this->tab_name); ?>
77 </a>
78 <?php
79 }
80
81 function tab_content(){
82
83 ?>
84 <form method="post" action="options.php" class="pisol-setting-form">
85 <?php settings_fields( $this->setting_key ); ?>
86 <?php
87 foreach($this->settings as $setting){
88 new pisol_class_form_eqw($setting, $this->setting_key);
89 }
90 ?>
91 <input type="submit" class="mt-3 btn btn-primary btn-sm" value="Save Option" />
92 </form>
93 <?php
94 }
95
96
97 }
98