Changeset 2694463
- Timestamp:
- 03/15/2022 08:08:48 PM (4 years ago)
- Location:
- autopopulate-checkout-for-woocommerce/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/class-autopopulate-checkout-woo-admin.php (modified) (2 diffs)
-
autopopulate-checkout-woo.php (modified) (2 diffs)
-
includes/class-autopopulate-checkout-woo.php (modified) (1 diff)
-
public/class-autopopulate-checkout-woo-public.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
autopopulate-checkout-for-woocommerce/trunk/README.txt
r2687864 r2694463 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.9.1 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 45 46 46 == Changelog == 47 = 1.0.7 = 48 Added Plex Call Center 47 49 = 1.0.6 = 48 50 Fixed bugs with Revcent integration -
autopopulate-checkout-for-woocommerce/trunk/admin/class-autopopulate-checkout-woo-admin.php
r2687864 r2694463 191 191 ); 192 192 193 193 add_settings_field( 194 'add-prospect-plex', 195 apply_filters( $this->plugin_name . 'label-add-prospect-plex', esc_html__('Enable Send Prospect to Plex Call Center ',$this->plugin_name) ), 196 array( $this, 'field_select' ), 197 $this->plugin_name, 198 $this->plugin_name . '-messages', 199 array( 200 'description' => 'Enable Plex Call Center', 201 'id' => 'add-prospect-plex', 202 'value' => '', 203 ) 204 ); 205 206 add_settings_field( 207 'plex-account-id', 208 apply_filters( $this->plugin_name . 'label-plex-account-id', esc_html__('Plex Account Id ',$this->plugin_name) ), 209 array( $this, 'field_text' ), 210 $this->plugin_name, 211 $this->plugin_name . '-messages', 212 array( 213 'description' => 'Plex Account Id', 214 'id' => 'plex-account-id', 215 'value' => '', 216 ) 217 ); 218 219 add_settings_field( 220 'plex-key', 221 apply_filters( $this->plugin_name . 'label-plex-key', esc_html__('Plex Key',$this->plugin_name) ), 222 array( $this, 'field_text' ), 223 $this->plugin_name, 224 $this->plugin_name . '-messages', 225 array( 226 'description' => 'Plex Key', 227 'id' => 'plex-key', 228 'value' => '', 229 ) 230 ); 231 232 add_settings_field( 233 'plex-list-id', 234 apply_filters( $this->plugin_name . 'label-plex-list-id', esc_html__(' Plex List Id ',$this->plugin_name) ), 235 array( $this, 'field_text' ), 236 $this->plugin_name, 237 $this->plugin_name . '-messages', 238 array( 239 'description' => 'Plex List Id', 240 'id' => 'plex-list-id', 241 'value' => '', 242 ) 243 ); 194 244 } 195 245 … … 339 389 340 390 $options[] = array('add-prospect-revcent','select','Enable Revcent'); 391 $options[] = array('add-prospect-plex','select','Enable Plex Call Center'); 392 $options[] = array('plex-account-id','text','Plex Account Id'); 393 $options[] = array('plex-key','text','Plex Key'); 394 $options[] = array('plex-list-id','text','Plex List Id'); 395 341 396 342 397 return $options; -
autopopulate-checkout-for-woocommerce/trunk/autopopulate-checkout-woo.php
r2687864 r2694463 17 17 * Plugin URI: https://www.wpconcierges.com/plugins/autopopulate-checkout-woo/ 18 18 * Description: Pass in values for shipping, billing, to any page of your site and the plugin will create a customer session that is used on the Woocommerce Checkout page. 19 * Version: 1.0. 619 * Version: 1.0.7 20 20 * Author: WpConcierges 21 21 * Author URI: https://www.wpconcierges.com/plugins/ … … 38 38 * Rename this for your plugin and update it as you release new versions. 39 39 */ 40 define( 'AUTOPOPULATE_CHECKOUT_WOO_VERSION', '1.0. 6' );40 define( 'AUTOPOPULATE_CHECKOUT_WOO_VERSION', '1.0.7' ); 41 41 42 42 /** -
autopopulate-checkout-for-woocommerce/trunk/includes/class-autopopulate-checkout-woo.php
r2687864 r2694463 71 71 $this->version = AUTOPOPULATE_CHECKOUT_WOO_VERSION; 72 72 } else { 73 $this->version = '1.0. 6';73 $this->version = '1.0.7'; 74 74 } 75 75 $this->plugin_name = $this->autopopulate_checkout_woo = 'autopopulate-checkout-woo'; -
autopopulate-checkout-for-woocommerce/trunk/public/class-autopopulate-checkout-woo-public.php
r2687864 r2694463 58 58 $this->plugin_name = $autopopulate_checkout_woo; 59 59 $this->version = $version; 60 $this->plugin_options = get_option($this->plugin_name."-options",array());60 $this->plugin_options = get_option($this->plugin_name."-options",array()); 61 61 $this->revcent_url = 'https://api.revcent.com/v1'; 62 $this->plex_url = 'https://api.connectdataleads.com/api/lead_handler.php'; 62 63 } 63 64 … … 287 288 $this->add_customer_to_revcent(); 288 289 } 290 291 if($this->plugin_options['add-prospect-plex']=="yes"){ 292 $this->add_customer_to_plex(); 293 } 289 294 } 290 295 291 private function add_customer_to_revcent(){ 296 private function add_customer_to_plex(){ 297 298 299 $account_id = $this->plugin_options['plex-account-id']; 300 $key = $this->plugin_options['plex-key']; 301 $list_id = $this->plugin_options['plex-list-id']; 302 303 $customer = $this->create_plex_prospect(); 304 $customer['account_id']=$account_id; 305 $customer['key']=$key; 306 $customer['list_id']=$list_id; 307 308 309 $response = wp_remote_post($this->plex_url, array( 310 'method' => 'POST', 311 'body' => http_build_query($customer), 312 'timeout' => 90, 313 'sslverify' => false, 314 )); 315 316 $this->logger(print_r($response,true)); 317 318 319 } 320 321 private function add_customer_to_revcent(){ 292 322 293 323 if(class_exists("revcent_payments")){ … … 304 334 305 335 } 306 336 337 307 338 private function send_revcent_customer(){ 308 339 $payload_rq = $this->create_revcent_customer(); … … 430 461 431 462 } 463 464 private function create_plex_prospect(){ 465 global $woocommerce; 466 467 $customer =array(); 468 469 470 471 $first_name =""; 472 $last_name = ""; 473 $address_line_1 = ""; 474 $address_line_2 = ""; 475 $city =""; 476 $state =""; 477 $zip = ""; 478 $country = ""; 479 $email =""; 480 $phone = ""; 481 482 if(!is_null($woocommerce->customer->get_billing_first_name())) 483 $first_name = $woocommerce->customer->get_billing_first_name(); 484 485 if(!is_null($woocommerce->customer->get_billing_last_name())) 486 $last_name = $woocommerce->customer->get_billing_last_name(); 487 488 if(!is_null($woocommerce->customer->get_billing_address_1())) 489 $address_line_1 = $woocommerce->customer->get_billing_address_1(); 490 491 if(!is_null( $woocommerce->customer->get_billing_address_2())) 492 $address_line_2 = $woocommerce->customer->get_billing_address_2(); 493 494 if(!is_null($woocommerce->customer->get_billing_city())) 495 $city = $woocommerce->customer->get_billing_city(); 496 497 if(!is_null($woocommerce->customer->get_billing_state())) 498 $state = $woocommerce->customer->get_billing_state(); 499 500 if(!is_null($woocommerce->customer->get_billing_postcode())) 501 $zip = $woocommerce->customer->get_billing_postcode(); 502 503 if(!is_null($woocommerce->customer->get_billing_country())) 504 $country = $woocommerce->customer->get_billing_country(); 505 506 if(!is_null($woocommerce->customer->get_shipping_company())) 507 $company =$woocommerce->customer->get_shipping_company(); 508 509 if(!is_null($woocommerce->customer->get_billing_email())) 510 $email =$woocommerce->customer->get_billing_email(); 511 512 if(!is_null($woocommerce->customer->get_billing_phone())) 513 $phone =$woocommerce->customer->get_billing_phone(); 514 515 516 $customer = array( 517 "shipping_first_name" => $first_name, 518 "shipping_last_name" => $last_name, 519 "shipping_address_1" => $address_line_1, 520 "shipping_address_2" => $address_line_2, 521 "shipping_city_town" => $city, 522 "shipping_state_province" => $state, 523 "shipping_zip_postcode" => $zip, 524 "shipping_country_code" => $country, 525 "phone_1" => $phone, 526 "email" => $email 527 ); 528 529 return $customer; 530 531 } 532 533 protected function logger($data){ 534 global $woocommerce; 535 if(!is_null($woocommerce)){ 536 $logger = new WC_Logger(); 537 $logger->add('autopopulate-checkout-woo', $data); 538 } 539 } 540 432 541 }
Note: See TracChangeset
for help on using the changeset viewer.