PluginProbe ʕ •ᴥ•ʔ
PiWeb Product Enquiry or product catalog for WooCommerce / 2.2.33.34
PiWeb Product Enquiry or product catalog for WooCommerce v2.2.33.34
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-enquiry.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-enquiry.php
133 lines
1 <?php
2
3 class Pi_Eqw_Enquiry{
4
5 public $plugin_name;
6 public $version;
7 public $menu;
8 public $enquiry_type;
9
10 function __construct($plugin_name , $version){
11 $this->plugin_name = $plugin_name;
12 $this->version = $version;
13
14 $this->enquiry_type = 'pisol_enquiry';
15
16 add_action( 'init', array($this, 'create_enquiry_type') );
17 add_action( 'init', array($this, 'remove_post_type_title') );
18
19 add_action( 'add_meta_boxes', array($this,'user_detail') );
20
21 add_filter( 'manage_edit-pisol_enquiry_columns', array($this,'columnsToList') ) ;
22
23 add_action( 'manage_pisol_enquiry_posts_custom_column', array($this,'columnsContent'), 10, 2 );
24 }
25
26 function create_enquiry_type() {
27 register_post_type( $this->enquiry_type,
28 array(
29 'labels' => array(
30 'name' => __( 'Enquiries' ),
31 'singular_name' => __( 'Enquiry' ),
32 'add_new_item' =>__('Enquiry')
33 ),
34 'public' => false,
35 'exclude_from_search' => true,
36 'publicaly_queryable' => false,
37 'show_ui'=>true,
38 'rewrite'=>false,
39 'show_in_nav_menus' => false,
40 'query_var' => false,
41 'has_archive' => false,
42 'supports'=>array('title'),
43 'menu_icon'=>plugins_url( 'enquiry-quotation-for-woocommerce/admin/img/pi.svg' ),
44 /** this hides add post option */
45 'capability_type' => 'post',
46 'capabilities' => array(
47 'create_posts' => 'do_not_allow'
48 ),
49 'map_meta_cap' => true,
50 )
51 );
52 }
53
54 function remove_post_type_title() {
55 remove_post_type_support( 'pisol_enquiry', 'title' );
56 remove_post_type_support( 'pisol_enquiry', 'slugdiv' );
57 }
58
59 function user_detail(){
60 add_meta_box(
61 'pisol_enquiry_detail',
62 __( 'Enquiry Detail'),
63 array($this,'enquiry_detail'),
64 $this->enquiry_type
65 );
66 }
67
68 function enquiry_detail($enquiry){
69 include_once('partials/enquiry_detail.php');
70 }
71
72 function variation_detail($variation_detail){
73 $attributes_group = explode(',', $variation_detail);
74 if(is_array($attributes_group) && count($attributes_group) > 0){
75 foreach($attributes_group as $attribute){
76 if($attribute != ""){
77 $pair = explode('|',$attribute);
78 echo isset($pair[0]) ? '<strong>'.esc_html($pair[0]).'</strong> : ' : "";
79 echo isset($pair[1]) ? '<span>'.esc_html($pair[0]).'</span><br>' : "";
80 }
81 }
82 }
83 }
84
85 function columnsToList( $columns ) {
86
87 $columns = array(
88 'cb' => '<input type="checkbox" />',
89 'id' => __( 'Enq no.', 'pisol-enquiry-quotation-woocommerce' ),
90 'title' => __( 'Name', 'pisol-enquiry-quotation-woocommerce' ),
91 'pi_email' => __( 'Email', 'pisol-enquiry-quotation-woocommerce' ),
92 'pi_phone' => __( 'Phone', 'pisol-enquiry-quotation-woocommerce' ),
93 'pi_subject' => __( 'Subject', 'pisol-enquiry-quotation-woocommerce' ),
94 'pi_message' => __( 'Message', 'pisol-enquiry-quotation-woocommerce' ),
95 'date' => __( 'Date', 'pisol-enquiry-quotation-woocommerce' )
96 );
97
98 return $columns;
99 }
100
101 function columnsContent( $column, $post_id ) {
102 global $post;
103
104 switch( $column ) {
105 case 'id' :
106 echo '#'.esc_html( $post_id );
107 break;
108
109 case 'pi_email' :
110 $pi_email = get_post_meta( $post_id, 'pi_email', true );
111 echo esc_html($pi_email);
112 break;
113
114 case 'pi_phone' :
115 $pi_phone = get_post_meta( $post_id, 'pi_phone', true );
116 echo esc_html($pi_phone);
117 break;
118
119 case 'pi_subject' :
120 $pi_subject = get_post_meta( $post_id, 'pi_subject', true );
121 echo esc_html($pi_subject);
122 break;
123
124 case 'pi_message' :
125 $pi_message = get_post_meta( $post_id, 'pi_message', true );
126 echo esc_html($pi_message);
127 break;
128 }
129 }
130
131 }
132
133 new Pi_Eqw_Enquiry($this->plugin_name, $this->version);