Changeset 2651450
- Timestamp:
- 12/31/2021 07:09:55 PM (4 years ago)
- Location:
- agecheckernet
- Files:
-
- 4 added
- 3 edited
-
tags/1.8.0 (added)
-
tags/1.8.0/agechecker.php (added)
-
tags/1.8.0/class-wc-integration-agechecker-integration.php (added)
-
tags/1.8.0/readme.txt (added)
-
trunk/agechecker.php (modified) (1 diff)
-
trunk/class-wc-integration-agechecker-integration.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
agecheckernet/trunk/agechecker.php
r2636643 r2651450 4 4 Plugin URI: https://agechecker.net 5 5 Description: AgeChecker.Net seamlessly and securely verifies the age of your customers directly on your website during the checkout process. Keep your site up to date on the latest age regulations for your industry while ensuring that purchasing is frustration-free for your site users. 6 Version: 1. 7.36 Version: 1.8.0 7 7 Author: AgeChecker.Net 8 8 Author URI: https://agechecker.net -
agecheckernet/trunk/class-wc-integration-agechecker-integration.php
r2636643 r2651450 59 59 $this->groups_mode = $this->get_option('groups_mode'); 60 60 $this->excluded_shipping = $this->get_option('excluded_shipping'); 61 $this->excluded_payment = $this->get_option('excluded_payment'); 61 62 $this->page = $this->get_option('page'); 62 63 $this->enable_all = $this->get_option('enable_all'); … … 148 149 'default' => '', 149 150 'list' => 'shipping_methods', 151 'desc_tip' => false, 152 ), 153 'excluded_payment' => array( 154 'title' => 'Exclude Payment Methods', 155 'type' => 'listbox', 156 'default' => '', 157 'list' => 'payment_methods', 150 158 'desc_tip' => false, 151 159 ), … … 428 436 } 429 437 438 $payment_methods = WC()->payment_gateways->payment_gateways(); 439 430 440 ob_start(); 431 441 … … 472 482 foreach ($shipping_methods as $c) { 473 483 echo '<option value="' . $c . '">' . $c . '</option>'; 484 } 485 } else if($data['list'] == "payment_methods") { 486 foreach ($payment_methods as $c) { 487 echo '<option value="' . $c->id . '">' . $c->title . ' (' . $c->id . ') </option>'; 474 488 } 475 489 } … … 771 785 772 786 public function validate_order() { 773 if ($this->workflow_type != "before_payment" || $this->is_excluded(false) || $this->is_shipping_excluded() ) {787 if ($this->workflow_type != "before_payment" || $this->is_excluded(false) || $this->is_shipping_excluded() || $this->is_payment_excluded()) { 774 788 return true; 775 789 } … … 923 937 } 924 938 939 public function validate_excluded_payment_field($key) { 940 $value = $_POST["payment_methodsListData"]; 941 if (!isset($value)) { 942 ?> 943 <div class="error notice"> 944 <p><strong>Invalid payment fields.</strong></p> 945 </div> 946 <?php 947 } 948 949 return $value; 950 } 951 925 952 public function validate_category_apikeys_field($key) { 926 953 $value = $_POST["categoryApiKeysListData"]; … … 1147 1174 (function(w,d) { 1148 1175 <?php echo $this->before_script; ?> 1176 1149 1177 var config={key:'<?php echo $this->get_api_key(false); ?>',element:'<?php echo $this->element; ?>',name:'<?php echo esc_html($this->store_name); ?>',<?php echo $this->client_config; ?>}; 1150 1151 1178 <?php 1152 if($this->excluded_shipping != '') { 1179 $shipping_excluded = $this->excluded_shipping != ''; 1180 $payment_excluded = $this->excluded_payment != ''; 1181 if($shipping_excluded || $payment_excluded) { 1153 1182 ?> 1183 1154 1184 if(config.platform_features && config.platform_features.woocommerce) { 1155 config.platform_features.woocommerce.shipping_methods = "<?php echo $this->excluded_shipping ?>".split(","); 1185 <?php 1186 if($shipping_excluded) { 1187 echo "config.platform_features.woocommerce.shipping_methods = \"". $this->excluded_shipping . "\".split(\",\");"; 1188 } 1189 ?> 1190 1191 <?php 1192 if($payment_excluded) { 1193 echo "config.platform_features.woocommerce.payment_methods = \"". $this->excluded_payment . "\".split(\",\");"; 1194 } 1195 ?> 1196 1156 1197 } else { 1157 1198 config.platform_features = { 1158 1199 woocommerce: { 1159 shipping_methods: "<?php echo $this->excluded_shipping ?>".split(",") 1200 <?php 1201 if($shipping_excluded) { 1202 echo "shipping_methods: \"". $this->excluded_shipping ."\".split(\",\"),"; 1203 } 1204 ?> 1205 1206 <?php 1207 if($payment_excluded) { 1208 echo "payment_methods: \"". $this->excluded_payment ."\".split(\",\"),"; 1209 } 1210 ?> 1211 1160 1212 } 1161 1213 }; … … 1233 1285 $order = new WC_Order($order_id); 1234 1286 1235 if ($this->is_excluded($order->get_items()) || $this->is_shipping_excluded() ) {1287 if ($this->is_excluded($order->get_items()) || $this->is_shipping_excluded() || $this->is_payment_excluded()) { 1236 1288 return; 1237 1289 } … … 1266 1318 return true; 1267 1319 } 1320 } 1321 } 1322 } 1323 } 1324 1325 return false; 1326 } 1327 1328 public function is_payment_excluded() { 1329 $excluded_payment_methods = explode(",", $this->excluded_payment); 1330 1331 if (!(sizeof($excluded_payment_methods) == 1 && $excluded_payment_methods[0] == "")) { 1332 $chosen_method = WC()->session->get('chosen_payment_method'); 1333 if($chosen_method) { 1334 foreach ($excluded_payment_methods as $c) { 1335 if ($chosen_method == $c) { 1336 return true; 1268 1337 } 1269 1338 } -
agecheckernet/trunk/readme.txt
r2636643 r2651450 4 4 Requires at least: 4.4 5 5 Tested up to: 5.8 6 Stable tag: 1. 7.36 Stable tag: 1.8.0 7 7 8 8 AgeChecker.Net seamlessly and securely verifies the age of your customers directly on your website during the checkout process. … … 62 62 63 63 == Changelog == 64 65 = 1.8.0 = 66 *Release Date - 31 December 2021* 67 68 * Added ability to exclude payment methods from age verification 64 69 65 70 = 1.7.3 =
Note: See TracChangeset
for help on using the changeset viewer.