Changeset 2996245
- Timestamp:
- 11/15/2023 09:21:11 AM (2 years ago)
- Location:
- agreeme-checkboxes-for-woocommerce
- Files:
-
- 29 added
- 8 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/agree-me-woocommerce.php (added)
-
tags/1.1.0/css (added)
-
tags/1.1.0/inc (added)
-
tags/1.1.0/inc/agrwc-functions.php (added)
-
tags/1.1.0/inc/classes (added)
-
tags/1.1.0/inc/classes/agrwc-cbx-list-table.php (added)
-
tags/1.1.0/inc/classes/agrwc-cbx.php (added)
-
tags/1.1.0/inc/classes/agrwc-cbxs.php (added)
-
tags/1.1.0/inc/classes/agrwc-compatibility.php (added)
-
tags/1.1.0/inc/classes/agrwc-frontend.php (added)
-
tags/1.1.0/inc/classes/agrwc-install.php (added)
-
tags/1.1.0/inc/classes/agrwc-main.php (added)
-
tags/1.1.0/inc/classes/agrwc-orderdisplay.php (added)
-
tags/1.1.0/inc/classes/agrwc-thirdparty.php (added)
-
tags/1.1.0/inc/classes/error_log (added)
-
tags/1.1.0/inc/options (added)
-
tags/1.1.0/inc/options/agrwc-settings-cbx.php (added)
-
tags/1.1.0/inc/options/view (added)
-
tags/1.1.0/inc/options/view/admin-page-cbx.php (added)
-
tags/1.1.0/js (added)
-
tags/1.1.0/js/agrwc-cbx-backend.js (added)
-
tags/1.1.0/js/agrwc-cbx.js (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/agreeme-checkbox-for-woocommerce-es_ES.mo (added)
-
tags/1.1.0/languages/agreeme-checkbox-for-woocommerce-es_ES.po (added)
-
tags/1.1.0/languages/agreeme-checkbox-for-woocommerce.pot (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/todo.txt (added)
-
trunk/agree-me-woocommerce.php (modified) (3 diffs)
-
trunk/inc/agrwc-functions.php (modified) (2 diffs)
-
trunk/inc/classes/agrwc-compatibility.php (modified) (4 diffs)
-
trunk/inc/classes/agrwc-frontend.php (modified) (23 diffs)
-
trunk/inc/classes/agrwc-main.php (modified) (1 diff)
-
trunk/inc/classes/agrwc-orderdisplay.php (modified) (2 diffs)
-
trunk/inc/classes/agrwc-thirdparty.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
agreeme-checkboxes-for-woocommerce/trunk/agree-me-woocommerce.php
r2916150 r2996245 4 4 Plugin URI: https:///agreeme-checkbox-for-woocommerce/ 5 5 Description: Add checkbox fields to WooCommerce pages. 6 Version: 1. 0.96 Version: 1.1.0 7 7 Author: Amin Y 8 8 Author URI: https://qcompsolutions.com … … 10 10 Domain Path: /languages 11 11 Copyright: © 2022 Qcompsolutions.com 12 WC tested up to: 6. 2.212 WC tested up to: 6.4.1 13 13 License: GNU General Public License v3.0 14 14 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 36 36 define( 'AGRWC_NO', __( 'No', 'agreeme-checkbox-for-woocommerce' ) ); 37 37 38 //HPOS COMPATIBLE CODE 39 add_action( 'before_woocommerce_init', function() { 40 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 41 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 42 } 43 } ); 38 44 39 45 -
agreeme-checkboxes-for-woocommerce/trunk/inc/agrwc-functions.php
r2775581 r2996245 3 3 * Agreeme Checkboxes for WooCommerce - Functions 4 4 * 5 * @version 1.0. 25 * @version 1.0.9 6 6 * @since 1.0.0 7 7 * @author Amin Yasser. 8 8 */ 9 use Automattic\WooCommerce\Utilities\OrderUtil; //HPOS 9 10 10 11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 19 20 */ 20 21 function agrwc_update_orderfields_data( $order_id, $fields_data ) { 22 //HPOS 23 if ( method_exists("OrderUtil","custom_orders_table_usage_is_enabled") && OrderUtil::custom_orders_table_usage_is_enabled() ) { 24 // HPOS usage is enabled. 25 26 $order = wc_get_order( $order_id ); 27 $order->update_meta_data( '_' . AGR_WC_ID . '_data', $fields_data ); 28 $order->save(); 29 /// 30 }else{ 21 31 update_post_meta( $order_id, '_' . AGR_WC_ID . '_data', $fields_data ); 32 } 22 33 } 23 34 } -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-compatibility.php
r2884163 r2996245 7 7 * @author Amin Yasser. 8 8 */ 9 use Automattic\WooCommerce\Utilities\OrderUtil; //HPOS 9 10 10 11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 57 58 } 58 59 60 61 62 63 /////AMIN WC3 HPOS 64 if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { 65 // HPOS usage is enabled. 66 67 68 $meta_data_obj = $order->get_meta_data() ; 69 foreach( $order->get_meta_data() as $meta_data_obj ) { 70 $meta_data_array = $meta_data_obj->get_data(); 71 $key = $meta_data_array['key']; // The meta key 72 $val = $meta_data_array['value']; // The meta value 73 74 if(strstr($key,"argwc_")) 75 { 76 $keysarr=explode("_argwc_",$key); 77 78 if(in_array(trim($keysarr[1]),$show_cbx)) 79 { 80 $meta_key='Agree-'.$id; 81 $meta_value=$cbx->get_label()."-".$val_arr[$_SESSION['agrwc'][$id]]; 82 $order->{$meta_key} = $meta_value; 83 84 85 } 86 87 } 88 89 } 90 91 /////AMIN WC3 HPOS $meta_data_obj = $order->get_meta_data() ; 92 } else { 93 // Traditional CPT-based orders are in use. 94 95 59 96 $custom_field_value = get_post_meta( $order->id ); 97 98 60 99 foreach($custom_field_value as $key=>$val) 61 100 { … … 79 118 80 119 81 120 } 82 121 83 122 … … 86 125 return $order; 87 126 } 88 89 127 /** 90 128 * add_custom_fields_to_store_exporter. -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-frontend.php
r2883996 r2996245 7 7 * @author Amin Yasser. 8 8 */ 9 use Automattic\WooCommerce\Utilities\OrderUtil; //HPOS 10 9 11 if (!defined('ABSPATH')) exit; // Exit if accessed directly 10 12 if (!class_exists('agrwc_Frontend')): … … 23 25 $enabled = get_option('agrwc_enabled'); 24 26 if (!$enabled || $enabled == "no") return false; 25 27 if (session_status() == PHP_SESSION_NONE) { 28 29 30 31 session_start(); 32 } 33 26 34 27 35 $this->checkoutpage_locations['after_customer_notes']='woocommerce_after_order_notes'; … … 46 54 add_action('woocommerce_review_order_before_submit', array($this, 'addto_checkout_page'), PHP_INT_MAX); 47 55 48 add_action('woocommerce_thankyou', array($this, 'order_completed'), PHP_INT_MAX);49 add_action('woocommerce_checkout_update_order_meta', array($this, 'update_agree_checkbox_fields_order_meta'));56 add_action('woocommerce_thankyou', array($this, 'order_completed'), PHP_INT_MAX); 57 add_action('woocommerce_checkout_update_order_meta', array($this, 'update_agree_checkbox_fields_order_meta')); 50 58 add_action('woocommerce_cart_calculate_fees', array($this, 'add_fees'), PHP_INT_MAX); 51 59 add_action('admin_enqueue_scripts', array($this, 'admin_enqueue'), PHP_INT_MAX); … … 55 63 add_action('wp_footer', array($this, 'load_jsscripts')); 56 64 /// $this->load_jsscripts(); 57 65 66 add_action( 'woocommerce_admin_order_data_after_order_details', array( $this, 'add_agrwc_meta_admin_order' ), PHP_INT_MAX ); 67 68 add_action( 'woocommerce_email_after_order_table', array( $this, 'add_agrwc_meta_to_emails' ), PHP_INT_MAX ); 69 58 70 } 59 71 … … 80 92 */ 81 93 public function order_completed($order_id) { 82 if ( ! session_id() ) { 83 session_start(); 84 } 94 85 95 if(isset($_SESSION['agrwc'])) 86 96 { … … 91 101 public function agrwc_post() { 92 102 if (isset($_POST['action']) == 'agrwc_post') { 93 if ( ! session_id() ) { 94 session_start(); 95 } 103 96 104 $cbxs = AGRWC_CBX::get_cbxs(); 97 105 //loop through all... … … 114 122 $cbxs = AGRWC_CBX::get_cbxs(); 115 123 116 if ( ! session_id() ) { 117 session_start(); 118 } 124 119 125 //loop through all... 120 126 foreach ($cbxs as $id => $cbx) { … … 127 133 //get the product id match if not return... 128 134 $l_products = $cbx->get_limit_products(); 135 136 $l_cats = $cbx->get_limit_categories(); 137 138 129 139 if ($cbx->get_reqalert()) $alertmsg = $cbx->get_reqalert(); 130 140 //$l_products= explode(",",$cbx->get_limit_products()); … … 138 148 } 139 149 } else $match_product = true; 140 if (($match_product) && ($cbx->get_required() == 'yes') && (!isset($_REQUEST[$id]) && !isset($_POST[$id]))) { 150 151 152 153 154 155 156 157 158 if (($match_product) && ($cbx->get_required() == 'yes') && (!isset($_REQUEST[$id]) ) && isset($_REQUEST[$id."_"] )) { 141 159 142 160 … … 176 194 //loop through all... 177 195 178 if ( ! session_id() ) { 179 session_start(); 180 } 196 181 197 foreach ($cbxs as $id => $cbx) { 182 198 //get location of each...and proceed further if matches … … 208 224 $product_id = $line_item[ 'product_id' ]; 209 225 210 if ( ! session_id() ) { 211 session_start(); 212 } 226 213 227 $passed = true; 214 228 //loop through all required applicable checkboxes... … … 297 311 if ($match_product) { 298 312 woocommerce_form_field($id, array('type' => 'checkbox', 'class' => array('form-row privacy', $reqclass), 'label_class' => array('woocommerce-form__label checkbox'), 'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox agrwc-cbx', $reqclass), 'required' => $req, 'label' => $cbx->get_label(),), $checked); 313 299 314 $this->sdata[$id] = esc_js($cbx->get_reqalert()); 315 316 300 317 } 301 318 } … … 306 323 $cbxs = AGRWC_CBX::get_cbxs(); 307 324 //loop through all the checkboxes... 308 if ( ! session_id() ) { 309 session_start(); 310 } 325 326 311 327 foreach ($cbxs as $id => $cbx) { 312 328 //get location of each...and proceed further if matches … … 392 408 $checkoutpage_locations['after_terms_conditions']='woocommerce_checkout_after_terms_conditions'; 393 409 $checkoutpage_locations['before_submit']='woocommerce_review_order_before_submit'; 394 if ( ! session_id() ) { 395 session_start(); 396 } 410 397 411 $cbxs = AGRWC_CBX::get_cbxs(); 398 412 //loop through all... … … 400 414 //get location of each...and proceed further if matches 401 415 $location_arr = $cbx->get_locations(); 416 417 418 402 419 if (in_array(3, $location_arr)) //product page addtocart button 403 420 { 404 421 $clocation = $cbx->get_clocation(); 405 406 422 407 423 408 424 if($checkoutpage_locations[$clocation]==$called_action_hook) 409 425 { 426 427 410 428 //get the product id match if not return... 411 429 //get the product id match if not return... … … 416 434 if (is_array($l_products) && count($l_products)) { 417 435 $match_product = false; 436 437 418 438 foreach (WC()->cart->get_cart() as $cart_item_key => $values) { 419 439 if (in_array($values['product_id'], $l_products)) $match_product = true; … … 423 443 $l_ordertotal = $cbx->get_limit_ordertotal(); 424 444 if ($l_ordertotal) { 445 425 446 $conditionx = $cbx->get_conditionx(); 426 447 $match_product = false; 427 448 $ordertotal = WC()->cart->get_cart_contents_total(); 449 428 450 switch ($conditionx) { 429 451 case "<": … … 431 453 break; 432 454 case ">": 433 if ($ordertotal < $l_ordertotal) $match_product = true; 455 456 if ($ordertotal > $l_ordertotal) $match_product = true; 434 457 break; 435 458 } 436 459 } 460 461 462 437 463 if ($match_product) { 464 438 465 if ($cbx->get_required() == 'yes') { 439 466 $req = true; … … 449 476 450 477 woocommerce_form_field($id, array('type' => 'checkbox', 'class' => array('form-row privacy', $reqclass), 'label_class' => array('woocommerce-form__label checkbox'), 'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox agrwc-cbx', $reqclass), 'required' => $req, 'label' => $cbx->get_label(),), $checked); 478 woocommerce_form_field($id."_", array('type' => 'hidden'), '1'); 451 479 $this->sdata[$id] = esc_js($cbx->get_reqalert()); 452 480 } … … 465 493 $fees_to_add = array(); 466 494 467 if ( ! session_id() ) { 468 session_start(); 469 } 495 470 496 //get the checkboxes as array of cbx objects 471 497 $cbxs = AGRWC_CBX::get_cbxs(); … … 491 517 } 492 518 } 519 520 521 public function add_agrwc_meta_admin_order( $order ){ 522 523 524 $cbxs = AGRWC_CBX::get_cbxs(); 525 $show_cbx=array(); 526 //loop through all... 527 528 foreach($cbxs as $id=>$cbx) 529 { 530 $location_arr=$cbx->get_olocations(); 531 532 if(in_array(1,$location_arr)) //product page addtocart button 533 { 534 $show_cbx[]=$id; 535 } 536 537 } 538 539 ?> 540 <br class="clear" /> 541 <h4><?php echo __( 'Agree to', 'agreeme-checkbox-for-woocommerce' );?> </h4> 542 <?php 543 544 545 546 if ( method_exists('Automattic\WooCommerce\Utilities\OrderUtil','custom_orders_table_usage_is_enabled') && OrderUtil::custom_orders_table_usage_is_enabled() ) { 547 // HPOS usage is enabled. 548 549 550 /////AMIN WC3 HPOS $meta_data_obj = $order->get_meta_data() ; 551 foreach( $order->get_meta_data() as $meta_data_obj ) { 552 553 554 $meta_data_array = $meta_data_obj->get_data(); 555 556 557 $key = $meta_data_array['key']; // The meta key 558 $value = $meta_data_array['value']; // The meta value 559 560 561 562 if(strstr($key,"agrwc_")) 563 { 564 565 566 567 $keysarr=explode("_agrwc_",$key); 568 569 if(!in_array($keysarr[1],$show_cbx))continue; 570 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),); 571 572 ?> 573 <div class="custom_field"> 574 <p> <?php echo esc_html($keysarr[1]) . ' : ' . wp_kses($value,$allowed_html) . '<br/>'; ?></p> 575 </div> 576 577 578 <?php 579 } 580 581 } 582 583 } else { 584 585 586 587 $custom_field_value = get_post_meta( $order->get_id() ); 588 589 foreach($custom_field_value as $key=>$val) 590 { 591 592 if(strstr($key,"agrwc_")) 593 { 594 $keysarr=explode("_agrwc_",$key); 595 596 if(!in_array($keysarr[1],$show_cbx))continue; 597 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),); 598 599 ?> 600 <div class="custom_field"> 601 <p> <?php echo esc_html($keysarr[1]) . ' : ' . wp_kses($val[0],$allowed_html) . '<br/>'; ?></p> 602 </div> 603 604 605 <?php 606 } 607 } 608 609 } 610 611 } 612 613 public function add_agrwc_meta_to_emails( $order ){ 614 615 616 $cbxs = AGRWC_CBX::get_cbxs(); 617 $show_cbx=array(); 618 //loop through all... 619 620 foreach($cbxs as $id=>$cbx) 621 { 622 $location_arr=$cbx->get_olocations(); 623 624 //if(in_array(2,$location_arr)) //product page addtocart button 625 //{ 626 $show_cbx[]=$id; 627 //} 628 629 } 630 631 $op =''; 632 633 634 /////AMIN WC3 HPOS 635 if ( method_exists('Automattic\WooCommerce\Utilities\OrderUtil',"custom_orders_table_usage_is_enabled") && OrderUtil::custom_orders_table_usage_is_enabled() ) { 636 // HPOS usage is enabled. 637 638 639 640 $meta_data_obj = $order->get_meta_data() ; 641 foreach( $order->get_meta_data() as $meta_data_obj ) { 642 $meta_data_array = $meta_data_obj->get_data(); 643 $key = $meta_data_array['key']; // The meta key 644 $val = $meta_data_array['value']; // The meta value 645 if(strstr($key,"agrwc_")) 646 { 647 $keysarr=explode("_agrwc_",$key); 648 649 if(!in_array($keysarr[1],$show_cbx))continue; 650 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),); 651 652 $op .=' <div class="custom_field"><p>'. wp_kses($val,$allowed_html) . '<br/></p> </div>'; 653 654 } 655 656 } 657 658 /////AMIN WC3 HPOS $meta_data_obj = $order->get_meta_data() ; 659 } else { 660 // Traditional CPT-based orders are in use. 661 662 $custom_field_value = get_post_meta( $order->get_id() ); 663 664 665 foreach($custom_field_value as $key=>$val) 666 { 667 668 if(strstr($key,"agrwc_")) 669 { 670 671 $keysarr=explode("_agrwc_",$key); 672 673 if(in_array(trim($keysarr[1]),$show_cbx)) 674 { 675 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),); 676 677 $op .=' <div class="custom_field"><p>'. wp_kses($val[0],$allowed_html) . '<br/></p> </div>'; 678 679 680 681 } 682 } 683 } 684 } 685 686 687 688 689 690 691 if($op) echo '<br class="clear" /><h4>'.__( 'Agree to:', 'agreeme-checkbox-for-woocommerce' ).' </h4>'.$op; 692 693 } 694 695 696 493 697 /** 494 698 * update_custom_checkout_fields_order_meta. … … 498 702 * @todo 499 703 */ 500 function update_agree_checkbox_fields_order_meta($order_id) { 704 public function update_agree_checkbox_fields_order_meta($order_id) { 705 706 remove_action('woocommerce_checkout_update_order_meta', array($this, 'update_agree_checkbox_fields_order_meta')); 707 708 501 709 $fields_data = array(); 502 710 $val_arr[0] = AGRWC_NO; … … 508 716 //loop through all... 509 717 $ix = 0; 510 if ( ! session_id() ) { 511 session_start(); 512 } 718 $order_updated=0; 719 $order = wc_get_order( $order_id ); 513 720 foreach ($cbxs as $id => $cbx) { 721 514 722 $ix++; 515 723 if (isset($_SESSION['agrwc'][$id])) { 724 725 726 727 728 729 if ( method_exists('Automattic\WooCommerce\Utilities\OrderUtil',"custom_orders_table_usage_is_enabled") && OrderUtil::custom_orders_table_usage_is_enabled() ) { 730 // HPOS usage is enabled. 731 732 733 734 735 //HPOS 736 $order_updated=1; 737 $order->update_meta_data('_agrwc_' . $id, $cbx->get_label() . " - " . $val_arr[(int)$_SESSION['agrwc'][$id]] ); /// 738 739 740 }else 516 741 update_post_meta($order_id, '_agrwc_' . $id, $cbx->get_label() . " - " . $val_arr[(int)$_SESSION['agrwc'][$id]]); 517 742 } 743 518 744 } 745 if($order_updated){"Order saved"; $order->save(); 746 } 747 748 749 add_action('woocommerce_checkout_update_order_meta', array($this, 'update_agree_checkbox_fields_order_meta')); 750 751 752 519 753 } 520 754 } -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-main.php
r2775581 r2996245 25 25 require_once( 'agrwc-cbxs.php' ); 26 26 //if ( is_front_page() ){ 27 require_once( 'agrwc-frontend.php' );27 require_once( 'agrwc-frontend.php' ); 28 28 //} 29 29 // require_once( 'agrwc-scripts.php' ); 30 require_once( 'agrwc-orderdisplay.php' );30 //require_once( 'agrwc-orderdisplay.php' ); 31 31 32 32 } -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-orderdisplay.php
r2835845 r2996245 22 22 function __construct() { 23 23 24 add_action( 'woocommerce_admin_order_data_after_order_details', array( $this, 'add_agrwc_meta_admin_order' ), PHP_INT_MAX );24 ///add_action( 'woocommerce_admin_order_data_after_order_details', array( $this, 'add_agrwc_meta_admin_order' ), PHP_INT_MAX ); 25 25 26 add_action( 'woocommerce_email_after_order_table', array( $this, 'add_agrwc_meta_to_emails' ), PHP_INT_MAX, 2 ); 27 if ( 'yes' === agrwc_get_option( 'add_to_order_received', 'yes' ) ) { 28 ///add_action( 'woocommerce_order_details_after_order_table', array( $this, 'add_custom_fields_to_view_order_and_thankyou_pages' ), PHP_INT_MAX ); 29 } 26 ///add_action( 'woocommerce_email_after_order_table', array( $this, 'add_agrwc_meta_to_emails' ), PHP_INT_MAX ); 27 30 28 } 31 29 32 30 33 31 34 function add_agrwc_meta_admin_order( $order ){35 32 36 37 $cbxs = AGRWC_CBX::get_cbxs();38 $show_cbx=array();39 //loop through all...40 41 foreach($cbxs as $id=>$cbx)42 {43 $location_arr=$cbx->get_olocations();44 45 if(in_array(1,$location_arr)) //product page addtocart button46 {47 $show_cbx[]=$id;48 }49 50 }51 52 ?>53 <br class="clear" />54 <h4><?php echo __( 'Agree to', 'agreeme-checkbox-for-woocommerce' );?> </h4>55 <?php56 /*57 * get all the meta data values we need58 */59 $custom_field_value = get_post_meta( $order->get_id() );60 61 foreach($custom_field_value as $key=>$val)62 {63 64 if(strstr($key,"agrwc_"))65 {66 $keysarr=explode("_agrwc_",$key);67 68 if(!in_array($keysarr[1],$show_cbx))continue;69 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),);70 71 ?>72 <div class="custom_field">73 <p> <?php echo esc_html($keysarr[1]) . ' : ' . wp_kses($val[0],$allowed_html) . '<br/>'; ?></p>74 </div>75 76 77 <?php78 }79 }80 }81 82 function add_agrwc_meta_to_emails( $order ){83 84 85 $cbxs = AGRWC_CBX::get_cbxs();86 $show_cbx=array();87 //loop through all...88 89 foreach($cbxs as $id=>$cbx)90 {91 $location_arr=$cbx->get_olocations();92 93 //if(in_array(2,$location_arr)) //product page addtocart button94 //{95 $show_cbx[]=$id;96 //}97 98 }99 100 $op ='';101 102 /*103 * get all the meta data values we need104 */105 $custom_field_value = get_post_meta( $order->get_id() );106 107 108 foreach($custom_field_value as $key=>$val)109 {110 111 if(strstr($key,"agrwc_"))112 {113 114 $keysarr=explode("_agrwc_",$key);115 116 if(in_array(trim($keysarr[1]),$show_cbx))117 {118 $allowed_html = array('a' => array('href' => array(),), 'br' => array(),);119 120 $op .=' <div class="custom_field"><p>'. wp_kses($val[0],$allowed_html) . '<br/></p> </div>';121 122 123 124 }125 }126 }127 128 129 if($op) echo '<br class="clear" /><h4>'.__( 'Agree to:', 'agreeme-checkbox-for-woocommerce' ).' </h4>'.$op;130 131 }132 33 133 34 … … 140 41 * @since 1.0.0 141 42 */ 142 function get_order_id( $_order ) {43 public function get_order_id( $_order ) { 143 44 if ( ! $_order || ! is_object( $_order ) ) { 144 45 return 0; -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-thirdparty.php
r2775581 r2996245 23 23 function __construct() { 24 24 // "WooCommerce – Store Exporter" plugin - https://wordpress.org/plugins/woocommerce-exporter/ 25 add_filter( 'woo_ce_order_fields', array( $this, 'add_custom_fields_to_store_exporter' ) );26 add_filter( 'woo_ce_order', array( $this, 'add_custom_fields_to_store_exporter_order' ), PHP_INT_MAX, 2 );25 //add_filter( 'woo_ce_order_fields', array( $this, 'add_custom_fields_to_store_exporter' ) ); 26 //add_filter( 'woo_ce_order', array( $this, 'add_custom_fields_to_store_exporter_order' ), PHP_INT_MAX, 2 ); 27 27 } 28 28 -
agreeme-checkboxes-for-woocommerce/trunk/readme.txt
r2916150 r2996245 3 3 Tags: woocommerce, checkout, woo commerce 4 4 Requires at least: 5.0 5 Tested up to: 6. 2.26 Stable tag: 1. 0.95 Tested up to: 6.4.1 6 Stable tag: 1.1.0 7 7 License: GNU General Public License v3.0 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 26 26 * Required Field to be proceed further. 27 27 * Optionally add Custom fee to the order total if customer agrees. 28 * Store agreement details as Order meta and display those in admin Order details page and order confirmation emails .28 * Store agreement details as Order meta and display those in admin Order details page and order confirmation emails(HPOS Support). 29 29 30 30
Note: See TracChangeset
for help on using the changeset viewer.