Changeset 3203935
- Timestamp:
- 12/07/2024 06:02:09 AM (16 months ago)
- Location:
- agreeme-checkboxes-for-woocommerce
- Files:
-
- 28 added
- 7 edited
-
tags/1.1.3 (added)
-
tags/1.1.3/agree-me-woocommerce.php (added)
-
tags/1.1.3/css (added)
-
tags/1.1.3/inc (added)
-
tags/1.1.3/inc/agrwc-functions.php (added)
-
tags/1.1.3/inc/classes (added)
-
tags/1.1.3/inc/classes/agrwc-cbx-list-table.php (added)
-
tags/1.1.3/inc/classes/agrwc-cbx.php (added)
-
tags/1.1.3/inc/classes/agrwc-cbxs.php (added)
-
tags/1.1.3/inc/classes/agrwc-compatibility.php (added)
-
tags/1.1.3/inc/classes/agrwc-frontend.php (added)
-
tags/1.1.3/inc/classes/agrwc-install.php (added)
-
tags/1.1.3/inc/classes/agrwc-main.php (added)
-
tags/1.1.3/inc/classes/agrwc-orderdisplay.php (added)
-
tags/1.1.3/inc/classes/agrwc-thirdparty.php (added)
-
tags/1.1.3/inc/options (added)
-
tags/1.1.3/inc/options/agrwc-settings-cbx.php (added)
-
tags/1.1.3/inc/options/view (added)
-
tags/1.1.3/inc/options/view/admin-page-cbx.php (added)
-
tags/1.1.3/js (added)
-
tags/1.1.3/js/agrwc-cbx-backend.js (added)
-
tags/1.1.3/js/agrwc-cbx.js (added)
-
tags/1.1.3/languages (added)
-
tags/1.1.3/languages/agreeme-checkbox-for-woocommerce-es_ES.mo (added)
-
tags/1.1.3/languages/agreeme-checkbox-for-woocommerce-es_ES.po (added)
-
tags/1.1.3/languages/agreeme-checkbox-for-woocommerce.pot (added)
-
tags/1.1.3/readme.txt (added)
-
tags/1.1.3/todo.txt (added)
-
trunk/agree-me-woocommerce.php (modified) (1 diff)
-
trunk/inc/classes/agrwc-cbx.php (modified) (2 diffs)
-
trunk/inc/classes/agrwc-frontend.php (modified) (3 diffs)
-
trunk/inc/options/agrwc-settings-cbx.php (modified) (1 diff)
-
trunk/inc/options/view/admin-page-cbx.php (modified) (1 diff)
-
trunk/js/agrwc-cbx.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
agreeme-checkboxes-for-woocommerce/trunk/agree-me-woocommerce.php
r3140717 r3203935 4 4 Plugin URI: https:///agreeme-checkbox-for-woocommerce/ 5 5 Description: Add checkbox fields to WooCommerce pages. 6 Version: 1.1. 26 Version: 1.1.3 7 7 Author: Amin Y 8 8 Author URI: https://qcompsolutions.com -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-cbx.php
r2826299 r3203935 31 31 $this->locationnamearr[3] = __('Checkout Page', 'agreeme-checkbox-for-woocommerce'); 32 32 $this->locationnamearr[999] = __('', 'agreeme-checkbox-for-woocommerce'); 33 $this->data = wp_parse_args($data, array('cbx_id' => '', 'name' => '', 'products' => array(), 'locations' => array(), 'olocations' => array(),'clocation' => 'after_customer_notes', 'limit_categories' => array(), 'limit_products' => array(), 'limit_ordertotal' => '', 'conditionx' => '', 'value' => '1', 'label' => '','append_fee' => '0', 'required' => '1', 'reqalert' => '', 'add_fee' => 0, 'fee_text' => ''));33 $this->data = wp_parse_args($data, array('cbx_id' => '', 'name' => '', 'products' => array(), 'locations' => array(), 'olocations' => array(),'clocation' => 'after_customer_notes', 'limit_categories' => array(), 'limit_products' => array(), 'limit_ordertotal' => '', 'conditionx' => '', 'value' => '1', 'label' => '','append_fee' => '0', 'required' => '1','dchecked' => '0', 'reqalert' => '', 'add_fee' => 0, 'fee_text' => '')); 34 34 } 35 35 /** … … 137 137 * @param string $name Checkbox name. 138 138 */ 139 public function set_dchecked($required) { 140 $this->set_prop('dchecked', $required); 141 } 142 143 public function get_dchecked() { 144 return $this->get_prop('dchecked'); 145 } 146 139 147 public function set_required($required) { 140 148 $this->set_prop('required', $required); 141 149 } 150 151 142 152 public function get_reqalert() { 143 153 return $this->get_prop('reqalert'); -
agreeme-checkboxes-for-woocommerce/trunk/inc/classes/agrwc-frontend.php
r3140717 r3203935 319 319 if ($cbx->get_required() == 'yes') { 320 320 $req = true; 321 $reqclass = " required ";321 $reqclass = " requiredx "; 322 322 } else { 323 323 $req = false; 324 324 $reqclass = ''; 325 325 }; 326 326 $checked = 0; 327 if ($cbx->get_dchecked() == 'yes') $checked = 1; 327 328 if (isset(WC()->session) && WC()->session->get( 'agrwc-'.$id ))$checked = 1; 328 329 // if (isset($_SESSION[$id])) $checked = 1; 329 else $checked = 0;330 330 331 if ($match_product) { 331 332 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); … … 393 394 if ($cbx->get_required() == 'yes') { 394 395 $req = true; 395 $reqclass = " required ";396 $reqclass = " requiredx "; 396 397 } else { 397 398 $req = false; 398 399 $reqclass = ''; 399 400 }; 401 402 $checked = 0; 403 if ($cbx->get_dchecked() == 'yes') $checked = 1; 400 404 if (WC()->session->get( 'agrwc-'.$id ))$checked = 1; 401 405 // if (isset($_SESSION[$id])) $checked = 1; 402 else $checked = 0;406 403 407 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); 404 408 $this->sdata[$id] = esc_js($cbx->get_reqalert()); … … 500 504 if ($cbx->get_required() == 'yes') { 501 505 $req = true; 502 $reqclass = " required ";506 $reqclass = " requiredx "; 503 507 } else { 504 508 $req = false; 505 509 $reqclass = ''; 506 510 }; 507 if (WC()->session->get( 'agrwc-'.$id ))$checked = 1; 508 else $checked = 0; 511 512 $checked = 0; 513 if ($cbx->get_dchecked() == 'yes') $checked = 1; 514 if (WC()->session->get( 'agrwc-'.$id ))$checked = 1; 515 509 516 510 517 -
agreeme-checkboxes-for-woocommerce/trunk/inc/options/agrwc-settings-cbx.php
r2776386 r3203935 157 157 $postdata['label'] = wp_unslash($postdata['label']); //allow links in label 158 158 $postdata['required'] = isset($postdata['required']) ? 'yes' : 'no'; 159 $postdata['dchecked'] = isset($postdata['dchecked']) ? 'yes' : 'no'; 159 160 $postdata['append_fee'] = isset($postdata['append_fee']) ? 'yes' : 'no'; 160 161 if (!isset($postdata['limit_products'])) { -
agreeme-checkboxes-for-woocommerce/trunk/inc/options/view/admin-page-cbx.php
r2826299 r3203935 85 85 <td class="forminp forminp-text"> 86 86 <input name="required" id="required" type="checkbox" value="1" <?php if('yes'==$cbx->data['required'])echo "checked"; ?> />Yes/No 87 88 </td> 89 </tr> 90 91 <tr valign="top"> 92 <th scope="row" class="titledesc"> 93 <label for="name"><?php esc_html_e( 'Default Checked', 'agreeme-checkbox-for-woocommerce' ); ?></label> 94 <?php echo wp_kses_post( wc_help_tip( __( 'Default Checked or Unchecked', 'agreeme-checkbox-for-woocommerce' ) ) ); ?> 95 </th> 96 <td class="forminp forminp-text"> 97 <input name="dchecked" id="dchecked" type="checkbox" value="1" <?php if('yes'==$cbx->data['dchecked'])echo "checked"; ?> />Yes/No 87 98 88 99 </td> -
agreeme-checkboxes-for-woocommerce/trunk/js/agrwc-cbx.js
r2915308 r3203935 8 8 var hr = jQuery(this).attr('href'); 9 9 jQuery('.agrwc-cbx').each(function(index, obj) { 10 if (!jQuery(this).prop('checked') && jQuery(this).hasClass('required ')) {10 if (!jQuery(this).prop('checked') && jQuery(this).hasClass('requiredx')) { 11 11 var idx = jQuery(this).prop('id'); 12 12 if (AGRWC_VARS[idx]) alert(AGRWC_VARS[idx]); … … 35 35 var hasagrerr = 0; 36 36 jQuery('.agrwc-cbx').each(function(index, obj) { 37 if (!jQuery(this).prop('checked') && jQuery(this).hasClass('required ')) {37 if (!jQuery(this).prop('checked') && jQuery(this).hasClass('requiredx')) { 38 38 var idx = jQuery(this).prop('id'); 39 39 if (AGRWC_VARS[idx]) alert(AGRWC_VARS[idx]); -
agreeme-checkboxes-for-woocommerce/trunk/readme.txt
r3117104 r3203935 2 2 Contributors: oscomsupport 3 3 Tags: woocommerce, checkout, woo commerce 4 Requires at least: 5.05 Tested up to: 6. 4.36 Stable tag: 1.1. 24 Requires at least: 6.0 5 Tested up to: 6.7.1 6 Stable tag: 1.1.3 7 7 License: GNU General Public License v3.0 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 50 50 51 51 == Changelog == 52 = 1.1.3 = 53 Tested to WP 6.7.1 and added default checked option. 54 52 55 = 1.0.1 = 53 56 Changed to native WC session
Note: See TracChangeset
for help on using the changeset viewer.