Changeset 3440153
- Timestamp:
- 01/15/2026 08:55:23 AM (8 weeks ago)
- Location:
- roadcube
- Files:
-
- 5 edited
- 16 copied
-
tags/1.0.33 (copied) (copied from roadcube/trunk)
-
tags/1.0.33/assets/css/admin_style.css (copied) (copied from roadcube/trunk/assets/css/admin_style.css)
-
tags/1.0.33/assets/css/style.css (copied) (copied from roadcube/trunk/assets/css/style.css) (1 diff)
-
tags/1.0.33/assets/img (copied) (copied from roadcube/trunk/assets/img)
-
tags/1.0.33/assets/js/admin-translations.js (copied) (copied from roadcube/trunk/assets/js/admin-translations.js)
-
tags/1.0.33/assets/js/coupon_manager.js (copied) (copied from roadcube/trunk/assets/js/coupon_manager.js)
-
tags/1.0.33/assets/js/script.js (copied) (copied from roadcube/trunk/assets/js/script.js)
-
tags/1.0.33/core/api.php (copied) (copied from roadcube/trunk/core/api.php)
-
tags/1.0.33/core/create_product.php (copied) (copied from roadcube/trunk/core/create_product.php)
-
tags/1.0.33/core/history.php (copied) (copied from roadcube/trunk/core/history.php)
-
tags/1.0.33/core/settings.php (copied) (copied from roadcube/trunk/core/settings.php) (3 diffs)
-
tags/1.0.33/core/translations.php (copied) (copied from roadcube/trunk/core/translations.php)
-
tags/1.0.33/core/woocommerce.php (copied) (copied from roadcube/trunk/core/woocommerce.php) (3 diffs)
-
tags/1.0.33/readme.txt (copied) (copied from roadcube/trunk/readme.txt) (2 diffs)
-
tags/1.0.33/roadcube.php (copied) (copied from roadcube/trunk/roadcube.php) (2 diffs)
-
tags/1.0.33/templates/show_gifts.php (copied) (copied from roadcube/trunk/templates/show_gifts.php)
-
trunk/assets/css/style.css (modified) (1 diff)
-
trunk/core/settings.php (modified) (3 diffs)
-
trunk/core/woocommerce.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/roadcube.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
roadcube/tags/1.0.33/assets/css/style.css
r3426984 r3440153 309 309 color: black; 310 310 font-size: 18px; 311 } 312 .rc_pnts_prev .logout_pnts_msg { 313 background-color: #80808017; 314 padding: 10px; 315 border-radius: 10px; 311 316 } 312 317 .rc_pro_points { -
roadcube/tags/1.0.33/core/settings.php
r3426984 r3440153 109 109 if (isset($_POST['coupon_button_close_label'])) { 110 110 $sanitized_settings['coupon_button_close_label'] = sanitize_text_field($_POST['coupon_button_close_label']); 111 } 112 113 if (isset($_POST['earn_points_msg_logout'])) { 114 $sanitized_settings['earn_points_msg_logout'] = sanitize_text_field($_POST['earn_points_msg_logout']); 111 115 } 112 116 … … 358 362 <input type="text" name="coupon_button_close_label" id="coupon_button_close_label" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('coupon_button_close_label')); ?>"> 359 363 </td> 360 </tr> 364 </tr> 365 <tr> 366 <th><?php esc_html_e('Earn points message for non-logged-in customer','roadcube'); ?><p class="description">{POINTS} = reward points of an order</p></th> 367 <td> 368 <textarea rows="5" cols="20" name="earn_points_msg_logout" id="earn_points_msg_logout" placeholder="<?php esc_html_e('Ολοκλήρωσε την Παραγγελία σου και Κάνε Εγγραφή και Κέρδισε {POINTS} Πόντους για μελλοντική Έκπτωση','roadcube'); ?>"><?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('earn_points_msg_logout')); ?></textarea> 369 </td> 370 </tr> 361 371 <tr> 362 372 <th><?php esc_html_e('Terms acceptance label','roadcube'); ?></th> … … 398 408 <tr> 399 409 <th><?php esc_html_e('Conversion API Token','roadcube'); ?></th> 400 <td><input requiredplaceholder="<?php esc_html_e('Conversion API Token','roadcube'); ?>" type="text" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('conversion_api_token')); ?>" name="conversion_api_token"/></td>410 <td><input placeholder="<?php esc_html_e('Conversion API Token','roadcube'); ?>" type="text" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('conversion_api_token')); ?>" name="conversion_api_token"/></td> 401 411 </tr> 402 412 </table> -
roadcube/tags/1.0.33/core/woocommerce.php
r3426984 r3440153 474 474 'woocommerce/proceed-to-checkout-block', 475 475 'woocommerce/cart-accepted-payment-methods-block', 476 'woocommerce/checkout-order-summary-block', 476 477 ); 477 478 if ( in_array( $block['blockName'], $blocks ) ) { … … 493 494 // roadcube_user_coupons_waiting_list(); 494 495 } 496 497 add_action('roadcube_before_woocommerce/checkout-order-summary-block', 'roadcube_cart_loyalty_button'); 495 498 496 499 add_action('roadcube_after_woocommerce/cart-order-summary-coupon-form-block', 'roadcube_user_coupons_waiting_list'); … … 634 637 } 635 638 639 function roadcube_logout_points_prev() { 640 if(!is_user_logged_in()) { 641 $won_points = 0; 642 $trans_type = Roadcube_Coupon_Claimer::roadcube_get_setting('roadcube_create_transaction_settings') ?: 'amount'; 643 $subtotal = WC()->cart->get_subtotal() - WC()->cart->get_discount_total(); 644 $subtotal = floor($subtotal); 645 if ($trans_type == 'amount') { 646 $won_points += $subtotal; 647 } 648 else { 649 foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { 650 $product_id = $cart_item['product_id']; 651 $quantity = $cart_item['quantity']; 652 $product = wc_get_product( $product_id ); 653 $product_data = get_post_meta($product_id, 'roadcube_product_created_data', true); 654 if (isset($product_data['status']) && $product_data['status'] == 'success') { 655 $raw_price = floatval($product->get_price()); 656 $price = floor(floatval($product->get_price())); 657 $points = intval($product_data['data']['product']['reward_points']); 658 $won_points += $price * $points; 659 } else { 660 $points = 1; 661 $raw_price = floatval($product->get_price()); 662 $price = floor(floatval($product->get_price())); 663 $won_points += $price * $points; 664 } 665 } 666 } 667 668 if($won_points) { 669 $pnts_msg_option = Roadcube_Coupon_Claimer::roadcube_get_setting('earn_points_msg_logout'); 670 if (empty($pnts_msg_option)) { 671 $pnts_msg_option = 'Ολοκλήρωσε την Παραγγελία σου και Κάνε Εγγραφή και Κέρδισε {POINTS} Πόντους για μελλοντική Έκπτωση'; 672 } 673 674 $pnts_msg_option = str_replace('{POINTS}', $won_points, $pnts_msg_option); 675 echo "<div class='rc_pnts_prev'><p class='logout_pnts_msg'>".esc_html__($pnts_msg_option)."</p></div>"; 676 } 677 } 678 } 679 636 680 add_action( 'woocommerce_before_checkout_form', 'roadcube_add_param_to_session'); 637 681 -
roadcube/tags/1.0.33/readme.txt
r3430168 r3440153 3 3 Description: Provides loyalty benefits to the customers of RoadCube members 4 4 Tags: roadcube, woocommerce, loyalty, rewards 5 Version: 1.0.3 25 Version: 1.0.33 6 6 Requires at least: 5.2 7 7 Tested up to: 6.9 8 Stable tag: 1.0.3 28 Stable tag: 1.0.33 9 9 License: GPLv2 or later 10 10 Requires PHP: 7.2 … … 162 162 *Release Date - 31 December 2025* 163 163 * Fixed applied coupon remove from waiting, DOB required, saved order points 164 165 = 1.0.33 = 166 *Release Date - 15 January 2026* 167 * Added a message on cart and checkout about earning points in logout mode -
roadcube/tags/1.0.33/roadcube.php
r3430168 r3440153 5 5 * Description: Provides loyalty benefits to the customers of RoadCube members 6 6 * Tags: roadcube, woocommerce, loyalty, rewards 7 * Version: 1.0.3 27 * Version: 1.0.33 8 8 * Requires at least: 5.2 9 9 * Tested up to: 6.9 10 * Stable tag: 1.0.3 210 * Stable tag: 1.0.33 11 11 * License: GPLv2 or later 12 12 * Requires at least: 5.2 … … 66 66 } 67 67 function roadcube_loyalty_coupon_button_callback() { 68 // To display points message if customer is not logged in 69 roadcube_logout_points_prev(); 68 70 if (!is_user_logged_in()) 69 71 return ''; // Return nothing if the user is not logged in -
roadcube/trunk/assets/css/style.css
r3426984 r3440153 309 309 color: black; 310 310 font-size: 18px; 311 } 312 .rc_pnts_prev .logout_pnts_msg { 313 background-color: #80808017; 314 padding: 10px; 315 border-radius: 10px; 311 316 } 312 317 .rc_pro_points { -
roadcube/trunk/core/settings.php
r3426984 r3440153 109 109 if (isset($_POST['coupon_button_close_label'])) { 110 110 $sanitized_settings['coupon_button_close_label'] = sanitize_text_field($_POST['coupon_button_close_label']); 111 } 112 113 if (isset($_POST['earn_points_msg_logout'])) { 114 $sanitized_settings['earn_points_msg_logout'] = sanitize_text_field($_POST['earn_points_msg_logout']); 111 115 } 112 116 … … 358 362 <input type="text" name="coupon_button_close_label" id="coupon_button_close_label" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('coupon_button_close_label')); ?>"> 359 363 </td> 360 </tr> 364 </tr> 365 <tr> 366 <th><?php esc_html_e('Earn points message for non-logged-in customer','roadcube'); ?><p class="description">{POINTS} = reward points of an order</p></th> 367 <td> 368 <textarea rows="5" cols="20" name="earn_points_msg_logout" id="earn_points_msg_logout" placeholder="<?php esc_html_e('Ολοκλήρωσε την Παραγγελία σου και Κάνε Εγγραφή και Κέρδισε {POINTS} Πόντους για μελλοντική Έκπτωση','roadcube'); ?>"><?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('earn_points_msg_logout')); ?></textarea> 369 </td> 370 </tr> 361 371 <tr> 362 372 <th><?php esc_html_e('Terms acceptance label','roadcube'); ?></th> … … 398 408 <tr> 399 409 <th><?php esc_html_e('Conversion API Token','roadcube'); ?></th> 400 <td><input requiredplaceholder="<?php esc_html_e('Conversion API Token','roadcube'); ?>" type="text" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('conversion_api_token')); ?>" name="conversion_api_token"/></td>410 <td><input placeholder="<?php esc_html_e('Conversion API Token','roadcube'); ?>" type="text" value="<?php echo esc_attr(Roadcube_Coupon_Claimer::roadcube_get_setting('conversion_api_token')); ?>" name="conversion_api_token"/></td> 401 411 </tr> 402 412 </table> -
roadcube/trunk/core/woocommerce.php
r3426984 r3440153 474 474 'woocommerce/proceed-to-checkout-block', 475 475 'woocommerce/cart-accepted-payment-methods-block', 476 'woocommerce/checkout-order-summary-block', 476 477 ); 477 478 if ( in_array( $block['blockName'], $blocks ) ) { … … 493 494 // roadcube_user_coupons_waiting_list(); 494 495 } 496 497 add_action('roadcube_before_woocommerce/checkout-order-summary-block', 'roadcube_cart_loyalty_button'); 495 498 496 499 add_action('roadcube_after_woocommerce/cart-order-summary-coupon-form-block', 'roadcube_user_coupons_waiting_list'); … … 634 637 } 635 638 639 function roadcube_logout_points_prev() { 640 if(!is_user_logged_in()) { 641 $won_points = 0; 642 $trans_type = Roadcube_Coupon_Claimer::roadcube_get_setting('roadcube_create_transaction_settings') ?: 'amount'; 643 $subtotal = WC()->cart->get_subtotal() - WC()->cart->get_discount_total(); 644 $subtotal = floor($subtotal); 645 if ($trans_type == 'amount') { 646 $won_points += $subtotal; 647 } 648 else { 649 foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { 650 $product_id = $cart_item['product_id']; 651 $quantity = $cart_item['quantity']; 652 $product = wc_get_product( $product_id ); 653 $product_data = get_post_meta($product_id, 'roadcube_product_created_data', true); 654 if (isset($product_data['status']) && $product_data['status'] == 'success') { 655 $raw_price = floatval($product->get_price()); 656 $price = floor(floatval($product->get_price())); 657 $points = intval($product_data['data']['product']['reward_points']); 658 $won_points += $price * $points; 659 } else { 660 $points = 1; 661 $raw_price = floatval($product->get_price()); 662 $price = floor(floatval($product->get_price())); 663 $won_points += $price * $points; 664 } 665 } 666 } 667 668 if($won_points) { 669 $pnts_msg_option = Roadcube_Coupon_Claimer::roadcube_get_setting('earn_points_msg_logout'); 670 if (empty($pnts_msg_option)) { 671 $pnts_msg_option = 'Ολοκλήρωσε την Παραγγελία σου και Κάνε Εγγραφή και Κέρδισε {POINTS} Πόντους για μελλοντική Έκπτωση'; 672 } 673 674 $pnts_msg_option = str_replace('{POINTS}', $won_points, $pnts_msg_option); 675 echo "<div class='rc_pnts_prev'><p class='logout_pnts_msg'>".esc_html__($pnts_msg_option)."</p></div>"; 676 } 677 } 678 } 679 636 680 add_action( 'woocommerce_before_checkout_form', 'roadcube_add_param_to_session'); 637 681 -
roadcube/trunk/readme.txt
r3430168 r3440153 3 3 Description: Provides loyalty benefits to the customers of RoadCube members 4 4 Tags: roadcube, woocommerce, loyalty, rewards 5 Version: 1.0.3 25 Version: 1.0.33 6 6 Requires at least: 5.2 7 7 Tested up to: 6.9 8 Stable tag: 1.0.3 28 Stable tag: 1.0.33 9 9 License: GPLv2 or later 10 10 Requires PHP: 7.2 … … 162 162 *Release Date - 31 December 2025* 163 163 * Fixed applied coupon remove from waiting, DOB required, saved order points 164 165 = 1.0.33 = 166 *Release Date - 15 January 2026* 167 * Added a message on cart and checkout about earning points in logout mode -
roadcube/trunk/roadcube.php
r3430168 r3440153 5 5 * Description: Provides loyalty benefits to the customers of RoadCube members 6 6 * Tags: roadcube, woocommerce, loyalty, rewards 7 * Version: 1.0.3 27 * Version: 1.0.33 8 8 * Requires at least: 5.2 9 9 * Tested up to: 6.9 10 * Stable tag: 1.0.3 210 * Stable tag: 1.0.33 11 11 * License: GPLv2 or later 12 12 * Requires at least: 5.2 … … 66 66 } 67 67 function roadcube_loyalty_coupon_button_callback() { 68 // To display points message if customer is not logged in 69 roadcube_logout_points_prev(); 68 70 if (!is_user_logged_in()) 69 71 return ''; // Return nothing if the user is not logged in
Note: See TracChangeset
for help on using the changeset viewer.