Changeset 3002249
- Timestamp:
- 11/27/2023 03:28:25 PM (2 years ago)
- Location:
- eber/trunk
- Files:
-
- 5 edited
-
index.php (modified) (1 diff)
-
init/eber_woo.php (modified) (2 diffs)
-
init/menu.php (modified) (3 diffs)
-
layout/index.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
eber/trunk/index.php
r2973272 r3002249 5 5 Description: Eber is a smart member system comes with comprehensive loyalty & rewards system, marketing and analytic tool. 6 6 Author: Eber 7 Version: 3. 27 Version: 3.3 8 8 Author URI: https://eber.co 9 9 License: GPLv2 or later -
eber/trunk/init/eber_woo.php
r2973272 r3002249 56 56 else 57 57 { 58 if($order->get_status() == 'completed') 58 $adjust_point = get_option('adjust_point_when','order_completed'); 59 if(($adjust_point == 'order_completed' && $order->get_status() == 'completed') || ($adjust_point == 'after_payment' && $order->get_status() == get_option('issue_point_when','processing'))) 59 60 { 60 61 $result = $api->setData($post_data) … … 218 219 else 219 220 { 220 $result = $api->setData($post_data) 221 ->setQueue() 222 ->requireAuth($api_key) 223 ->post('/v5/point/ecom'); 224 225 if (!$result->isFailure()) 226 { 227 $return_api = $result->data; 228 $time = current_time('mysql'); 229 230 $data = array( 231 'comment_post_ID' => $order_id, 232 'comment_author' => $user->user_login, 233 'comment_author_email' => $user->user_email, 234 'comment_author_url' => '', 235 'comment_content' => 'Eber Success : Added '.$return_api['points'].' Points', 236 'comment_type' => 'order_note', 237 'comment_parent' => 0, 238 'user_id' => $user->ID, 239 'comment_author_IP' => '', 240 'comment_agent' => 'Eber', 241 'comment_date' => $time, 242 'comment_approved' => 1, 243 ); 244 wp_insert_comment($data); 245 } 246 else 247 { 248 249 $time = current_time('mysql'); 250 $data = array( 251 'comment_post_ID' => $order_id, 252 'comment_author' => $user->user_login, 253 'comment_author_email' => $user->user_email, 254 'comment_author_url' => '', 255 'comment_content' => 'Eber Error : '.$result->getErrorString(), 256 'comment_type' => 'order_note', 257 'comment_parent' => 0, 258 'user_id' => $user->ID, 259 'comment_author_IP' => '', 260 'comment_agent' => 'Eber', 261 'comment_date' => $time, 262 'comment_approved' => 1, 263 ); 264 wp_insert_comment($data); 265 } 221 $adjust_point = get_option('adjust_point_when','order_completed'); 222 if(($adjust_point == 'after_payment' && $order->get_status() == get_option('issue_point_when','processing'))) 223 { 224 $result = $api->setData($post_data) 225 ->setQueue() 226 ->requireAuth($api_key) 227 ->post('/v5/point/ecom'); 228 229 if (!$result->isFailure()) 230 { 231 $return_api = $result->data; 232 $time = current_time('mysql'); 233 234 $data = array( 235 'comment_post_ID' => $order_id, 236 'comment_author' => $user->user_login, 237 'comment_author_email' => $user->user_email, 238 'comment_author_url' => '', 239 'comment_content' => 'Eber Success : Added '.$return_api['points'].' Points', 240 'comment_type' => 'order_note', 241 'comment_parent' => 0, 242 'user_id' => $user->ID, 243 'comment_author_IP' => '', 244 'comment_agent' => 'Eber', 245 'comment_date' => $time, 246 'comment_approved' => 1, 247 ); 248 wp_insert_comment($data); 249 } 250 else 251 { 252 253 $time = current_time('mysql'); 254 $data = array( 255 'comment_post_ID' => $order_id, 256 'comment_author' => $user->user_login, 257 'comment_author_email' => $user->user_email, 258 'comment_author_url' => '', 259 'comment_content' => 'Eber Error : '.$result->getErrorString(), 260 'comment_type' => 'order_note', 261 'comment_parent' => 0, 262 'user_id' => $user->ID, 263 'comment_author_IP' => '', 264 'comment_agent' => 'Eber', 265 'comment_date' => $time, 266 'comment_approved' => 1, 267 ); 268 wp_insert_comment($data); 269 } 270 } 266 271 } 267 272 -
eber/trunk/init/menu.php
r2855283 r3002249 25 25 $eber_custom_signup_url = get_option('eber_custom_signup_url',''); 26 26 $adjust_point_when = get_option('adjust_point_when','order_completed'); 27 $issue_point_when = get_option('issue_point_when','processing'); 27 28 $eber_welcome_email = get_option('eber_welcome_email',false); 28 29 $exclude_tax = get_option('exclude_tax',true); … … 41 42 $eber_custom_link = (isset($_POST['eber_custom_link'])); 42 43 $eber_welcome_email = (isset($_POST['eber_welcome_email'])); 43 44 44 45 $exclude_tax = (isset($_POST['exclude_tax'])); 45 46 $exclude_shipping = (isset($_POST['exclude_shipping'])); … … 174 175 { 175 176 update_option('exclude_shipping',false); 177 } 178 if(isset($_POST['issue_point_when'])) 179 { 180 update_option('issue_point_when',sanitize_text_field($_POST['issue_point_when'])); 181 $issue_point_when = sanitize_text_field($_POST['issue_point_when']); 176 182 } 177 183 -
eber/trunk/layout/index.php
r2328520 r3002249 1 1 <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 2 $order_statuses = array( 3 'pending' => _x( 'Pending payment', 'Order status', 'woocommerce' ), 4 'processing' => _x( 'Processing', 'Order status', 'woocommerce' ), 5 'on-hold' => _x( 'On hold', 'Order status', 'woocommerce' ), 6 'completed' => _x( 'Completed', 'Order status', 'woocommerce' ), 7 'cancelled' => _x( 'Cancelled', 'Order status', 'woocommerce' ), 8 'refunded' => _x( 'Refunded', 'Order status', 'woocommerce' ), 9 'failed' => _x( 'Failed', 'Order status', 'woocommerce' ), 10 ); 2 11 ?> 3 12 <div class="wrap"> … … 30 39 { ?> 31 40 <tr> 32 <th scope="row"><label for="adjust_point"> AdjustPoint When </label></th>41 <th scope="row"><label for="adjust_point">Issue Point When </label></th> 33 42 <td><select name="adjust_point_when" > 34 43 <option value="order_completed" <?php echo ($adjust_point_when == 'order_completed')?'selected':''; ?>>Order Completed</option> … … 36 45 </select> 37 46 </td> 47 </tr> 48 <tr> 49 <tr id="tr_issue_point_when"> 50 <th scope="row"><label for="issue_point">Status to Issue point </label></th> 51 <td><select name="issue_point_when" > 52 <?php 53 foreach($order_statuses as $key=>$status) 54 {?> 55 <option value="<?php echo $key;?>" <?php echo ($issue_point_when == $key)?'selected':''; ?> ><?php echo $status ;?></option> 56 <?php } 57 ?> 58 </select> 59 </td> 60 </tr> 38 61 </tr> 39 62 <?php } … … 157 180 </form> 158 181 <script type="text/javascript"> 182 function changeAdjustPoint() 183 { 184 if(jQuery("select[name='adjust_point_when']").val() == 'after_payment') 185 { 186 jQuery("#tr_issue_point_when").show(); 187 } 188 else 189 { 190 jQuery("#tr_issue_point_when").hide(); 191 } 192 } 159 193 jQuery(document).ready(function(){ 194 changeAdjustPoint(); 195 jQuery("select[name='adjust_point_when']").on('change',function(){ 196 changeAdjustPoint(); 197 }); 160 198 jQuery("input[name='eber_custom_link']").click(function(){ 161 199 if(jQuery("input[name='eber_custom_link']").is(':checked')) … … 169 207 }); 170 208 }); 209 171 210 </script> -
eber/trunk/readme.txt
r2973272 r3002249 90 90 = 3.2 = 91 91 update fix problem with Woo payment 92 = 3.3 = 93 update settings to change status for after payment 92 94 93 95
Note: See TracChangeset
for help on using the changeset viewer.