Changeset 2198541
- Timestamp:
- 11/22/2019 02:41:41 AM (6 years ago)
- Location:
- hostplugin-woocommerce-points-and-rewards/trunk
- Files:
-
- 8 added
- 17 edited
-
hostplugin-woocommerce-points-rewards.php (modified) (4 diffs)
-
includes/Account.php (modified) (2 diffs)
-
includes/Admin/Admin.php (modified) (3 diffs)
-
includes/Admin/PointTable.php (modified) (2 diffs)
-
includes/Admin/Settings.php (modified) (17 diffs)
-
includes/Cart.php (modified) (7 diffs)
-
includes/Comments.php (modified) (4 diffs)
-
includes/Helper.php (modified) (3 diffs)
-
includes/Order.php (modified) (1 diff)
-
includes/Points.php (modified) (17 diffs)
-
includes/Product.php (modified) (2 diffs)
-
includes/Upgrade.php (modified) (5 diffs)
-
languages (added)
-
languages/hostplugin-woocommerce-points-reward-zh_CN.mo (added)
-
languages/hostplugin-woocommerce-points-reward-zh_CN.po (added)
-
languages/hostplugin-woocommerce-points-reward-zh_HK.mo (added)
-
languages/hostplugin-woocommerce-points-reward-zh_HK.po (added)
-
languages/hostplugin-woocommerce-points-reward-zh_TW.mo (added)
-
languages/hostplugin-woocommerce-points-reward-zh_TW.po (added)
-
languages/hostplugin-woocommerce-points-reward.pot (added)
-
readme.txt (modified) (2 diffs)
-
templates/admin_dashboard.php (modified) (11 diffs)
-
templates/admin_settings.php (modified) (8 diffs)
-
templates/my_account.php (modified) (2 diffs)
-
templates/user_points_details.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hostplugin-woocommerce-points-and-rewards/trunk/hostplugin-woocommerce-points-rewards.php
r2072276 r2198541 7 7 Plugin URI: https://wordpress.org/plugins/hostplugin-woocommerce-points-and-rewards 8 8 Description: Reward your loyal customers for purchases and other actions using points which can be redeemed for discounts on future purchase. 9 Version: 1. 0.69 Version: 1.1.0 10 10 Author: HostPlugin.com 11 11 Author URI: http://www.hostplugin.com 12 Text Domain: hostplugin-woocommerce-points-reward 13 Domain Path: /languages 12 14 License: GPLv2 or later 13 15 */ … … 30 32 31 33 if ( class_exists('Hostplugin_Woocommerce_Points_Rewards') ) { 32 die( 'Hostplugin - WooCommerce Points & Rewards is already installed and activated. Please deactivate any other version before you activate this one.');34 die(__('Hostplugin - WooCommerce Points & Rewards is already installed and activated. Please deactivate any other version before you activate this one.', 'hostplugin-woocommerce-points-reward')); 33 35 } 34 36 … … 88 90 private function setup_constants() { 89 91 if ( ! defined( 'HOSTPLUGIN_WOO_POINTS_VERSION' ) ) { 90 define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1. 0.6' );92 define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1.1.0' ); 91 93 } 92 94 … … 143 145 hp_woo_points_rewards_upgrade_database(); 144 146 add_rewrite_endpoint( 'hp-woo-rewards-points', EP_ROOT | EP_PAGES ); 147 load_plugin_textdomain( 'hostplugin-woocommerce-points-reward', false, dirname(plugin_basename(__FILE__)) . '/languages/'); 145 148 } 146 149 -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Account.php
r2072276 r2198541 78 78 79 79 // Insert your custom endpoint. 80 $items['hp-woo-rewards-points'] = __($point_name, 'hp-woo-rewards');80 $items['hp-woo-rewards-points'] = $point_name; 81 81 82 82 // Insert back the logout item. … … 108 108 public function display_review_points_message($comment_data) { 109 109 110 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for comment: '.print_r($comment_data, true));110 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for comment: '.print_r($comment_data, true)); 111 111 112 112 $review_points = $this->points->get_review_points(); -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/Admin.php
r1949889 r2198541 27 27 add_action('admin_menu', array($this, 'create_admin_menu')); 28 28 add_action('admin_footer', array($this, 'add_footer')); 29 add_filter( 'plugin_action_links_'.HOSTPLUGIN_PLUGIN_BASE, array($this, 'add_plugin_links') );29 add_filter('plugin_action_links_'.HOSTPLUGIN_PLUGIN_BASE, array($this, 'add_plugin_links') ); 30 30 } 31 31 … … 60 60 */ 61 61 public function create_admin_menu() { 62 add_menu_page( __('HP Woocommerce Rewards & Points', 'h p-woo-rewards'), __('Woo Rewards', 'hp-woo-rewards'), 'administrator', 'hp_woo_rewards_points_dashboard', array($this, 'create_dashboard_page'), 'dashicons-money', 57 );62 add_menu_page( __('HP Woocommerce Rewards & Points', 'hostplugin-woocommerce-points-rewards'), __('Woo Rewards', 'hostplugin-woocommerce-points-reward'), 'administrator', 'hp_woo_rewards_points_dashboard', array($this, 'create_dashboard_page'), 'dashicons-money', 57 ); 63 63 }//function 64 64 65 65 public function add_footer() { 66 66 $screen = get_current_screen(); 67 error_log($screen->id);67 //error_log($screen->id); 68 68 if ($screen->id == 'toplevel_page_hp_woo_rewards_points_dashboard') { 69 69 echo '<div class="credit">Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>'; … … 79 79 */ 80 80 public function add_plugin_links( $links ) { 81 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_settings') ) .'"> Settings</a>';82 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_points_dashboard') ) .'"> Tutorials</a>';81 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_settings') ) .'">'. __('Settings', 'hostplugin-woocommerce-points-reward') .'</a>'; 82 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_points_dashboard') ) .'">'. __('Tutorials', 'hostplugin-woocommerce-points-reward') .'</a>'; 83 83 84 84 if (HOSTPLUGIN_WOO_POINTS_LICENSE <> 'Premium') { 85 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_points_dashboard&tab=premium') ) .'"> Upgrade to Premium Version</a>';85 $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=hp_woo_rewards_points_dashboard&tab=premium') ) .'">'. __('Upgrade to Premium Version', 'hostplugin-woocommerce-points-reward') .'</a>'; 86 86 } 87 87 -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/PointTable.php
r1926469 r2198541 47 47 */ 48 48 public function create_submenu_menu() { 49 add_submenu_page('hp_woo_rewards_points_dashboard', __('Points Table', 'h p-woo-rewards'), __('Customer Points', 'hp-woo-rewards'), 'administrator', 'hp_woo_rewards_points_table', array($this, 'create_subpage'));49 add_submenu_page('hp_woo_rewards_points_dashboard', __('Points Table', 'hostplugin-woocommerce-points-reward'), __('Customer Points', 'hostplugin-woocommerce-points-reward'), 'administrator', 'hp_woo_rewards_points_table', array($this, 'create_subpage')); 50 50 }//function 51 51 … … 70 70 */ 71 71 public function add_point_column( $column ) { 72 $column['points'] = 'Points';72 $column['points'] = __('Points', 'hostplugin-woocommerce-points-reward'); 73 73 return $column; 74 74 } -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/Settings.php
r2072276 r2198541 37 37 public function create_submenu_menu() { 38 38 39 add_submenu_page('hp_woo_rewards_points_dashboard', __('Settings', 'h p-woo-rewards'), __('Settings', 'hp-woo-rewards'), 'administrator', 'hp_woo_rewards_settings', array($this, 'create_subpage'));39 add_submenu_page('hp_woo_rewards_points_dashboard', __('Settings', 'hostplugin-woocommerce-points-reward'), __('Settings', 'hostplugin-woocommerce-points-reward'), 'administrator', 'hp_woo_rewards_settings', array($this, 'create_subpage')); 40 40 }//function 41 41 … … 77 77 register_setting('hp_woo_rewards_points_settings_option', 'hp_woo_rewards_points_settings_option', array($this, 'validate_fields')); 78 78 79 add_settings_section("hp_woo_rewards_points_section", __("General Settings", 'h p-woo-rewards'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");80 81 add_settings_section("hp_woo_rewards_points_signup_section", __("Signup Settings", 'h p-woo-rewards'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");82 83 add_settings_section("hp_woo_rewards_points_review_section", __("Product Review Settings", 'h p-woo-rewards'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");84 85 add_settings_section("hp_woo_rewards_points_refund_section", __("Refund Settings", 'h p-woo-rewards'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");86 87 add_settings_section("hp_woo_rewards_points_coupon_section", __("Coupon Settings", 'h p-woo-rewards'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");88 89 add_settings_section("hp_woo_rewards_points_message_section", __("Messages", 'h p-woo-rewards').wc_help_tip('{points}: number of points<br>79 add_settings_section("hp_woo_rewards_points_section", __("General Settings", 'hostplugin-woocommerce-points-reward'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 80 81 add_settings_section("hp_woo_rewards_points_signup_section", __("Signup Settings", 'hostplugin-woocommerce-points-reward'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 82 83 add_settings_section("hp_woo_rewards_points_review_section", __("Product Review Settings", 'hostplugin-woocommerce-points-reward'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 84 85 add_settings_section("hp_woo_rewards_points_refund_section", __("Refund Settings", 'hostplugin-woocommerce-points-reward'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 86 87 add_settings_section("hp_woo_rewards_points_coupon_section", __("Coupon Settings", 'hostplugin-woocommerce-points-reward'), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 88 89 add_settings_section("hp_woo_rewards_points_message_section", __("Messages", 'hostplugin-woocommerce-points-reward').wc_help_tip('{points}: number of points<br> 90 90 {points_label}: points label', true), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings"); 91 91 92 add_settings_field("is_system_enabled", __("Enable Reward System: ", 'h p-woo-rewards'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',92 add_settings_field("is_system_enabled", __("Enable Reward System: ", 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section', 93 93 array( 94 94 'label_for' => 'is_system_enabled', … … 97 97 ); 98 98 99 add_settings_field("points_name", __("Points Label: ", 'h p-woo-rewards').wc_help_tip('Points Label you wish to display on the frontend', false), 'hp_woo_rewards_points_text_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',99 add_settings_field("points_name", __("Points Label: ", 'hostplugin-woocommerce-points-reward').wc_help_tip('Points Label you wish to display on the frontend', false), 'hp_woo_rewards_points_text_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section', 100 100 array( 101 101 'label_for' => 'points_name', … … 105 105 ); 106 106 107 add_settings_field("points_earned", __("Points Conversion: ",'h p-woo-rewards'), 'hp_woo_rewards_points_field_points_conversion', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',107 add_settings_field("points_earned", __("Points Conversion: ",'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_field_points_conversion', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section', 108 108 array( 109 109 'dollar_spent' => $option['dollar_spent'], … … 116 116 'round-up' => 'Always Round Up' 117 117 ); 118 add_settings_field("round_off", __('Round Off: ','h p-woo-rewards').wc_help_tip('How points should be rounded', false), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',118 add_settings_field("round_off", __('Round Off: ','hostplugin-woocommerce-points-reward').wc_help_tip('How points should be rounded', false), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section', 119 119 array( 120 120 'label_for' => 'round_off', … … 124 124 ); 125 125 126 add_settings_field("points_redeem", __("Redeem Points Conversion: ",'h p-woo-rewards'), 'hp_woo_rewards_points_field_redeem_points', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',126 add_settings_field("points_redeem", __("Redeem Points Conversion: ",'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_field_redeem_points', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section', 127 127 array( 128 128 'redeem_points' => $option['redeem_points'], … … 150 150 /**********************************************************************/ 151 151 152 add_settings_field("signup_points", __("Signup Points: ", 'h p-woo-rewards').wc_help_tip('User will get [x] points when signing up an account. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_signup_section',152 add_settings_field("signup_points", __("Signup Points: ", 'hostplugin-woocommerce-points-reward').wc_help_tip('User will get [x] points when signing up an account. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_signup_section', 153 153 array( 154 154 'label_for' => 'signup_points', … … 158 158 159 159 $role_options = Helper::get_roles(true); 160 add_settings_field("signup_points_role", __("Who can earn signup points? ", 'h p-woo-rewards'), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_signup_section',160 add_settings_field("signup_points_role", __("Who can earn signup points? ", 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_signup_section', 161 161 array( 162 162 'label_for' => 'signup_points_role', … … 173 173 /**********************************************************************/ 174 174 175 add_settings_field("review_points", __("Review Points: ", 'h p-woo-rewards').wc_help_tip('User will get [x] points when reviewing the product. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section',175 add_settings_field("review_points", __("Review Points: ", 'hostplugin-woocommerce-points-reward').wc_help_tip('User will get [x] points when reviewing the product. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section', 176 176 array( 177 177 'label_for' => 'review_points', … … 180 180 ); 181 181 182 add_settings_field("max_review_points_for_user", __("Maximum Review Points: ", 'h p-woo-rewards').wc_help_tip('Maximum Points One user can earn for reviewing products. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section',182 add_settings_field("max_review_points_for_user", __("Maximum Review Points: ", 'hostplugin-woocommerce-points-reward').wc_help_tip('Maximum Points One user can earn for reviewing products. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section', 183 183 array( 184 184 'label_for' => 'max_review_points_for_user', … … 188 188 ); 189 189 190 add_settings_field("user_cannot_earn_points_for_reviewing_same_product", __("User cannot earn points for reviewing the same product?", 'h p-woo-rewards'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section',190 add_settings_field("user_cannot_earn_points_for_reviewing_same_product", __("User cannot earn points for reviewing the same product?", 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section', 191 191 array( 192 192 'label_for' => 'user_cannot_earn_points_for_reviewing_same_product', … … 196 196 ); 197 197 198 add_settings_field("review_points_role", __("Who can earn review points? ", 'h p-woo-rewards'), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section',198 add_settings_field("review_points_role", __("Who can earn review points? ", 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_select', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_review_section', 199 199 array( 200 200 'label_for' => 'review_points_role', … … 211 211 /**********************************************************************/ 212 212 213 add_settings_field("is_remove_earned_points_if_refunded", __("Remove earned points for Cancelled / Refunded Order?".wc_help_tip('If checked, previously earned points will be deducted if order is cancelled / refunded. Order status must be set to Cancelled / Refunded in order to trigger this event', false), 'h p-woo-rewards'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_refund_section',213 add_settings_field("is_remove_earned_points_if_refunded", __("Remove earned points for Cancelled / Refunded Order?".wc_help_tip('If checked, previously earned points will be deducted if order is cancelled / refunded. Order status must be set to Cancelled / Refunded in order to trigger this event', false), 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_refund_section', 214 214 array( 215 215 'label_for' => 'is_remove_earned_points_if_refunded', … … 219 219 ); 220 220 221 add_settings_field("is_return_redeemed_points_if_refunded", __("Return Redeemed points for Cancelled / Refunded Order?".wc_help_tip('If checked, redeemed points will be returned to customer if order is cancelled / refunded. Order status must be set to Cancelled / Refunded in order to trigger this event', false), 'h p-woo-rewards'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_refund_section',221 add_settings_field("is_return_redeemed_points_if_refunded", __("Return Redeemed points for Cancelled / Refunded Order?".wc_help_tip('If checked, redeemed points will be returned to customer if order is cancelled / refunded. Order status must be set to Cancelled / Refunded in order to trigger this event', false), 'hostplugin-woocommerce-points-reward'), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_refund_section', 222 222 array( 223 223 'label_for' => 'is_return_redeemed_points_if_refunded', … … 231 231 /**********************************************************************/ 232 232 233 add_settings_field("disable_point_when_using_coupon", __("Can't be combined with other woo coupons", 'hp-woo-rewards').wc_help_tip('If checked, customer cannot redeem points if coupons are used', false), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_coupon_section', 233 add_settings_field("disable_point_when_using_coupon", __("Can't be combined with other woo coupons", ' 234 ').wc_help_tip('If checked, customer cannot redeem points if coupons are used', false), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_coupon_section', 234 235 array( 235 236 'label_for' => 'disable_point_when_using_coupon', … … 239 240 ); 240 241 241 add_settings_field("no_earn_point_when_using_coupon", __("Can't Earn Points if coupons are used", 'h p-woo-rewards').wc_help_tip('If checked, customer cannot earn points if coupons are used', false), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_coupon_section',242 add_settings_field("no_earn_point_when_using_coupon", __("Can't Earn Points if coupons are used", 'hostplugin-woocommerce-points-reward').wc_help_tip('If checked, customer cannot earn points if coupons are used', false), 'hp_woo_rewards_points_checkbox', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_coupon_section', 242 243 array( 243 244 'label_for' => 'no_earn_point_when_using_coupon', … … 382 383 $error_message = ''; 383 384 if (version_compare(PHP_VERSION, '5.3.8', '<')) { 384 $error_message .= "This plugin requires PHP 5.3.8+<br>";385 $error_message .= __("This plugin requires PHP 5.3.8+", 'hostplugin-woocommerce-points-reward').'<br>'; 385 386 } 386 387 387 388 if (!class_exists( 'WooCommerce' )) { 388 389 //3.2 389 $error_message .= "This plugin requires the Woocommerce plugin<br>";390 $error_message .= __("This plugin requires the Woocommerce plugin", 'hostplugin-woocommerce-points-reward').'<br>'; 390 391 } 391 392 392 393 if (!empty($error_message)) 393 add_settings_error('hp_woo_rewards_points_settings_error','hp_woo_error', __($error_message, 'hp-woo-rewards'),'error');394 add_settings_error('hp_woo_rewards_points_settings_error','hp_woo_error',$error_message,'error'); 394 395 } 395 396 } -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Cart.php
r2018489 r2198541 80 80 */ 81 81 private function set_apply_point_session($discount, $customer_total_point, $points_used) { 82 error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);82 //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 83 83 if (isset( $_POST['hp_woo_apply_point_button'] ) && $_POST['hp_woo_apply_point_button'] == "Apply") { 84 error_log('apply points here');84 //error_log('apply points here'); 85 85 WC()->session->set('hp_woo_rewards_enabled', 'true'); //customer wants to use points 86 86 } … … 91 91 92 92 //doesn't matter if customer wants to use points or not, update the session 93 error_log('HP-WOO-REWARDS: customer total points: '.$customer_total_point.' max discount customer can use in cart: '.$discount);93 //error_log('HP-WOO-REWARDS: customer total points: '.$customer_total_point.' max discount customer can use in cart: '.$discount); 94 94 WC()->session->set('hp_woo_rewards_discount', $discount); 95 95 WC()->session->set('hp_woo_rewards_points_used', $points_used); … … 106 106 */ 107 107 public function apply_point_discount() { 108 error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 109 108 //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 110 109 111 110 if (is_user_logged_in()) { 112 error_log('HP-WOO-REWARDS: User is logged in and hp_woo_rewards is currently enabled');111 //error_log('HP-WOO-REWARDS: User is logged in and hp_woo_rewards is currently enabled'); 113 112 $max_discount = $this->get_max_cart_discount(); 114 113 $discount = $this->points->get_point_discount($this->customer_id, $max_discount); … … 120 119 121 120 if (WC()->session->get('hp_woo_rewards_enabled') == 'true' && $discount > 0) { 122 WC()->cart->add_fee( 'Point Discount', -$discount );121 WC()->cart->add_fee( __('Point Discount', 'hostplugin-woocommerce-points-reward'), -$discount ); 123 122 } 124 123 }//customer logged in … … 133 132 */ 134 133 public function add_apply_points_button() { 135 echo '<button type="submit" class="button hide" id="hp_woo_apply_point_button" name="hp_woo_apply_point_button" value="Apply"> Apply '.$this->points->point_name.'</button>';136 echo '<button type="submit" class="button hide" id="hp_woo_remove_point_button" name="hp_woo_remove_point_button" value="Remove"> Remove '.$this->points->point_name.'</button>';134 echo '<button type="submit" class="button hide" id="hp_woo_apply_point_button" name="hp_woo_apply_point_button" value="Apply">'.__('Apply ', 'hostplugin-woocommerce-points-reward').$this->points->point_name.'</button>'; 135 echo '<button type="submit" class="button hide" id="hp_woo_remove_point_button" name="hp_woo_remove_point_button" value="Remove">'.__('Remove ', 'hostplugin-woocommerce-points-reward').$this->points->point_name.'</button>'; 137 136 } 138 137 … … 146 145 */ 147 146 public function validate_order() { 148 error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);147 //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 149 148 if (WC()->session->get('hp_woo_rewards_enabled') == 'true') { 150 error_log('HP-WOO-REWARDS: customer wants to use points');149 //error_log('HP-WOO-REWARDS: customer wants to use points'); 151 150 $fees = WC()->cart->get_fees(); 152 151 153 error_log('HP-WOO-REWARDS: Checking all fees: '.print_r($fees, true));152 //error_log('HP-WOO-REWARDS: Checking all fees: '.print_r($fees, true)); 154 153 foreach ($fees as $fee) { 155 if ($fee->name == 'Point Discount') {154 if ($fee->name == __('Point Discount', 'hostplugin-woocommerce-points-reward')) { 156 155 $discount = abs(floatval($fee->amount)); //convert to + 157 156 $max_discount = $this->get_max_cart_discount(); 158 157 $customer_discount = $this->points->get_point_discount($this->customer_id, $max_discount); 159 158 160 error_log('HP-WOO-REWARDS: Discount applied on cart is: '.$discount.' Customer max discount: '.$customer_discount);159 //error_log('HP-WOO-REWARDS: Discount applied on cart is: '.$discount.' Customer max discount: '.$customer_discount); 161 160 162 161 if ($discount > $customer_discount) { 163 $error_text = __('The maximum discount you can get is: ', 'h p-woo-rewards'). get_woocommerce_currency_symbol(). ' '.$customer_discount;162 $error_text = __('The maximum discount you can get is: ', 'hostplugin-woocommerce-points-reward'). get_woocommerce_currency_symbol(). ' '.$customer_discount; 164 163 wc_add_notice( $error_text, 'error' ); 165 164 return; … … 239 238 echo('</span>'); 240 239 if (WC()->session->get('hp_woo_rewards_enabled') == 'true') { 241 echo(' <a id="hp_woo_rewards_remove_points" class="button" href="#"> Remove '. $point_name.'</a>');240 echo(' <a id="hp_woo_rewards_remove_points" class="button" href="#">'.__('Remove ', 'hostplugin-woocommerce-points-reward'). $point_name.'</a>'); 242 241 } 243 242 else { 244 echo('<a id="hp_woo_rewards_apply_points" class="button" href="#"> Apply '. $point_name.'</a>');243 echo('<a id="hp_woo_rewards_apply_points" class="button" href="#">'.__('Apply ', 'hostplugin-woocommerce-points-reward'). $point_name.'</a>'); 245 244 } 246 245 -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Comments.php
r2072277 r2198541 24 24 if ($this->points->is_point_system_enabled() == true) { 25 25 26 add_action( 'comment_post', array($this, 'prepare_rewards_points_for_comment'), 10, 2 );26 add_action('comment_post', array($this, 'prepare_rewards_points_for_comment'), 10, 2 ); 27 27 add_action('transition_comment_status', array($this, 'rewards_points_for_comment'),10,3); 28 28 }//show rewards points only if point system is enabled … … 31 31 public function prepare_rewards_points_for_comment( $comment_ID, $comment_approved ) { 32 32 33 error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);33 //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 34 34 if( 1 === $comment_approved ){ 35 35 $comment = get_comment( $comment_ID); … … 48 48 public function rewards_points_for_comment($new_status, $old_status, $comment) { 49 49 50 error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 51 50 //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__); 52 51 $points_to_add = $this->can_earn_points_for_comment($new_status, $comment); 53 52 if ($points_to_add > 0) … … 77 76 //make sure it's product 78 77 if ($product) { 79 error_log('HP-WOO-REWARDS: Preparing to add '.$review_points.' point(s) to user: '.$comment->user_id); 80 78 //error_log('HP-WOO-REWARDS: Preparing to add '.$review_points.' point(s) to user: '.$comment->user_id); 81 79 return $review_points; 82 80 -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Helper.php
r2072276 r2198541 12 12 * @var array 13 13 */ 14 public static $default_settings = array( 14 public static $default_settings = null; 15 16 17 /** 18 * Set default settings 19 * Otherwise return the whole array 20 * 21 * @since 1.1.0 22 * @return array 23 * 24 */ 25 public static function set_default_settings() { 26 self::$default_settings = array( 15 27 'is_system_enabled' => 'on', 16 28 'points_name' => 'Points', … … 34 46 'disable_point_when_using_coupon' => 'on', 35 47 'no_earn_point_when_using_coupon' => 'on', 36 'signup_message' => 'Sign up now and receive [bold]{points} {points_label}[/bold]', 37 'review_message' => 'Add your review and receive [bold]{points} {points_label}[/bold]', 38 'single_product_message' => 'Purchase this product and earn [bold]{points} {points_label}[/bold]', 39 'cart_checkout_message' => 'Complete your order and earn [bold]{points} {points_label}[/bold] for a discount on a future purchase', 40 'guest_reminder_message' => 'Please create an account or login to your existing account to receive your {points_label}', 41 'thankyou_message' => 'We will add {points_label} to your account once the order is completed.', 42 'total_points_message' => 'You have {points} {points_label} in your account', 43 'min_purchase_amount_message' => 'You need to add {money} products to your order to redeem your {points_label}' 44 ); 48 'signup_message' => __('Sign up now and receive [bold]{points} {points_label}[/bold]', 'hostplugin-woocommerce-points-reward'), 49 'review_message' => __('Add your review and receive [bold]{points} {points_label}[/bold]', 'hostplugin-woocommerce-points-reward'), 50 'single_product_message' => __('Purchase this product and earn [bold]{points} {points_label}[/bold]', 'hostplugin-woocommerce-points-reward'), 51 'cart_checkout_message' => __('Complete your order and earn [bold]{points} {points_label}[/bold] for a discount on a future purchase', 'hostplugin-woocommerce-points-reward'), 52 'guest_reminder_message' => __('Please create an account or login to your existing account to receive your {points_label}', 'hostplugin-woocommerce-points-reward'), 53 'thankyou_message' => __('We will add {points_label} to your account once the order is completed.', 'hostplugin-woocommerce-points-reward'), 54 'total_points_message' => __('You have {points} {points_label} in your account', 'hostplugin-woocommerce-points-reward'), 55 'min_purchase_amount_message' => __('You need to add {money} product(s) to your order to redeem your {points_label}', 'hostplugin-woocommerce-points-reward') 56 ); 57 } 45 58 46 59 /** … … 90 103 */ 91 104 public static function get_default_settings($option_name = '') { 105 106 if (self::$default_settings == null) 107 self::set_default_settings(); 108 92 109 if (!empty($option_name)) { 93 110 return self::$default_settings[$option_name]; -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Order.php
r1924295 r2198541 58 58 */ 59 59 public function deduct_points($order_id) { 60 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for Order ID: '.$order_id);60 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for Order ID: '.$order_id); 61 61 $points_used = (int)WC()->session->get('hp_woo_rewards_points_used'); 62 62 if (WC()->session->get('hp_woo_rewards_enabled') == 'true' && $points_used > 0) { 63 63 $order = wc_get_order( $order_id ); 64 64 $customer_id = $order->get_customer_id(); 65 error_log('HP-WOO-REWARDS: Customer ID: '.$customer_id. ' to redeem: '.$points_used.' on Order: '.$order_id);65 //error_log('HP-WOO-REWARDS: Customer ID: '.$customer_id. ' to redeem: '.$points_used.' on Order: '.$order_id); 66 66 $this->points->redeem_points_on_purchase($customer_id, $order_id, -$points_used); 67 67 } -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Points.php
r2072276 r2198541 199 199 */ 200 200 public function get_customer_points_details($customer_id = 0, $is_reverse = true) { 201 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id);201 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id); 202 202 $purchase_details = get_user_meta($customer_id, 'hp_woo_rewards_points_details', true); 203 203 204 error_log('HP-WOO-REWARDS: Get : '.print_r($purchase_details, true));204 //error_log('HP-WOO-REWARDS: Get : '.print_r($purchase_details, true)); 205 205 if (empty($purchase_details)) $purchase_details = array(); 206 206 //oldest entry goes first? 207 207 if ($is_reverse) krsort($purchase_details); 208 208 209 return $purchase_details; 209 210 } … … 219 220 */ 220 221 protected function update_customer_points($customer_id = 0, $points_to_add = 0) { 221 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id. ' Points to add: '.$points_to_add);222 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id. ' Points to add: '.$points_to_add); 222 223 if ($points_to_add <> 0) { 223 224 $total_points = $this->get_customer_total_points($customer_id); 224 225 $total_points = $total_points + $points_to_add; 225 error_log('HP-WOO-REWARDS: set points to: '.$total_points.' for customer: '.$customer_id);226 //error_log('HP-WOO-REWARDS: set points to: '.$total_points.' for customer: '.$customer_id); 226 227 update_user_meta( $customer_id, 'hp_woo_rewards_points', $total_points ); 227 228 } … … 242 243 */ 243 244 protected function update_customer_points_details($customer_id = 0, $points_string = '', $note, $log_type, $order_id = null, $comment_id = null) { 244 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id);245 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id); 245 246 246 247 $points = intval($points_string); … … 258 259 ); 259 260 260 error_log('HP-WOO-REWARDS: Before update purchase details: '.print_r($purchase_details, true));261 //error_log('HP-WOO-REWARDS: Before update purchase details: '.print_r($purchase_details, true)); 261 262 array_push($purchase_details, $detail); 262 error_log('HP-WOO-REWARDS: After update purchase details: '.print_r($purchase_details, true));263 //error_log('HP-WOO-REWARDS: After update purchase details: '.print_r($purchase_details, true)); 263 264 update_user_meta( $customer_id, 'hp_woo_rewards_points_details', $purchase_details); 264 265 } … … 274 275 */ 275 276 public function get_total_points_in_order($order_id) { 276 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for order ID: '.$order_id);277 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for order ID: '.$order_id); 277 278 $order = wc_get_order( $order_id ); 278 error_log('HP-WOO-REWARDS: Order: '.print_r($order, true));279 error_log('HP-WOO-REWARDS: Net total: '.floatval($order->get_subtotal()).' Total Discount: '.floatval($order->get_discount_total()));279 //error_log('HP-WOO-REWARDS: Order: '.print_r($order, true)); 280 //error_log('HP-WOO-REWARDS: Net total: '.floatval($order->get_subtotal()).' Total Discount: '.floatval($order->get_discount_total())); 280 281 $net_total_after_discount = floatval($order->get_subtotal()) - floatval($order->get_discount_total()); 281 282 $earned_points = $this->get_total_points($net_total_after_discount); 282 error_log('HP-WOO-REWARDS: total points in this order: '.$earned_points);283 //error_log('HP-WOO-REWARDS: total points in this order: '.$earned_points); 283 284 return $earned_points; 284 285 } … … 295 296 $price = WC()->cart->get_cart_contents_total(); //total minus discounts (discount and coupons) 296 297 $fees = WC()->cart->get_fees(); 297 error_log('HP-WOO-REWARDS: fees: '.print_r($fees, true));298 //error_log('HP-WOO-REWARDS: fees: '.print_r($fees, true)); 298 299 299 300 $discount_in_fee = 0; … … 308 309 $price = $price + $discount_in_fee; 309 310 310 error_log('HP-WOO-REWARDS: Discount in fee: '.$discount_in_fee);311 error_log('HP-WOO-REWARDS: Total minus all discounts: '.$price);311 //error_log('HP-WOO-REWARDS: Discount in fee: '.$discount_in_fee); 312 //error_log('HP-WOO-REWARDS: Total minus all discounts: '.$price); 312 313 $total_points_in_cart = $this->get_total_points($price); 313 error_log('HP-WOO-REWARDS: '.__FUNCTION__.' total points in cart: '.$total_points_in_cart);314 //error_log('HP-WOO-REWARDS: '.__FUNCTION__.' total points in cart: '.$total_points_in_cart); 314 315 return $total_points_in_cart; 315 316 } … … 327 328 */ 328 329 protected function is_already_processed($order_id, $customer_id, $log_type, $comment_id = null) { 329 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for order ID: '.$order_id. ' comment id: '.$comment_id . ' and customer: '.$customer_id. ' for log type: '.$log_type);330 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for order ID: '.$order_id. ' comment id: '.$comment_id . ' and customer: '.$customer_id. ' for log type: '.$log_type); 330 331 $points_details = $this->get_customer_points_details($customer_id); 331 error_log('HP-WOO-REWARDS: points details: '.print_r($points_details, true));332 //error_log('HP-WOO-REWARDS: points details: '.print_r($points_details, true)); 332 333 foreach ($points_details as $detail) { 333 334 if ($comment_id > 0) { 334 335 //review type 335 336 if ($detail['event_type'] == $log_type && $detail['comment_id'] == $comment_id) { 336 error_log('HP-WOO-REWARDS: Already processed points: '. $detail['points'].' to customer account');337 //error_log('HP-WOO-REWARDS: Already processed points: '. $detail['points'].' to customer account'); 337 338 return (int)$detail['points']; 338 339 } … … 341 342 //other type 342 343 if ( ($order_id == 0 || $detail['order_id'] == $order_id) && $detail['event_type'] == $log_type ) { 343 error_log('HP-WOO-REWARDS: Already processed points: '. $detail['points'].' to customer account');344 //error_log('HP-WOO-REWARDS: Already processed points: '. $detail['points'].' to customer account'); 344 345 return (int)$detail['points']; 345 346 } … … 360 361 */ 361 362 public function add_reward_points_for_purchase($order_id, $customer_id) { 362 error_log('HP-WOO-REWARDS: calling add_points_for_order() for Order ID: '.$order_id.' Customer ID: '.$customer_id);363 //error_log('HP-WOO-REWARDS: calling add_points_for_order() for Order ID: '.$order_id.' Customer ID: '.$customer_id); 363 364 $earned_points = $this->get_total_points_in_order($order_id); 364 365 if ($customer_id) { 365 error_log('HP-WOO-REWARDS: customer ID found: '.$customer_id);366 //error_log('HP-WOO-REWARDS: customer ID found: '.$customer_id); 366 367 if ($this->is_already_processed($order_id, $customer_id, self::LOG_TYPE_PURCHASE_REWARDS) === false) { 367 error_log('HP-WOO-REWARDS: preparing to add rewards points to customer: '.$customer_id);368 //error_log('HP-WOO-REWARDS: preparing to add rewards points to customer: '.$customer_id); 368 369 $this->update_customer_points($customer_id, $earned_points); 369 $note = '{points_label} earned for purchase';370 $note = __('{points_label} earned for purchase', 'hostplugin-woocommerce-points-reward'); 370 371 $earned_points_string = "+$earned_points"; 371 372 $this->update_customer_points_details($customer_id, $earned_points_string, $note, self::LOG_TYPE_PURCHASE_REWARDS, $order_id); … … 384 385 */ 385 386 public function add_signup_point_for_customer($customer_id, $signup_points) { 386 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Signup points: '.$signup_points);387 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Signup points: '.$signup_points); 387 388 if ((int)$this->option['signup_points'] > 0 && $this->is_already_processed(0, $customer_id, self::LOG_TYPE_SIGNUP_REWARDS) === false) { 388 389 $this->update_customer_points($customer_id, $signup_points); 389 390 $point_string = "+".$signup_points; 390 $event = __('{points_label} earned for account signup', 'h p-woo-rewards');391 $event = __('{points_label} earned for account signup', 'hostplugin-woocommerce-points-reward'); 391 392 $this->update_customer_points_details($customer_id, $point_string, $event, self::LOG_TYPE_SIGNUP_REWARDS, $order_id = null); 392 393 } … … 403 404 */ 404 405 public function add_review_point_for_customer($customer_id, $comment_id, $review_points) { 405 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Review points to add: '.$review_points);406 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Review points to add: '.$review_points); 406 407 407 408 if ($review_points > 0 && $this->is_already_processed(0, $customer_id, self::LOG_TYPE_REVIEW_REWARDS, $comment_id) === false) { … … 409 410 $point_string = "+".$review_points; 410 411 411 $event = __('{points_label} earned for reviewing product', 'h p-woo-rewards');412 $event = __('{points_label} earned for reviewing product', 'hostplugin-woocommerce-points-reward'); 412 413 $this->update_customer_points_details($customer_id, $point_string, $event, self::LOG_TYPE_REVIEW_REWARDS, $order_id = null, $comment_id); 413 414 } … … 433 434 $point_string = "".$point_string; 434 435 $current_user = wp_get_current_user(); 435 $event = __('{points_label} adjusted by ', 'hp-woo-rewards').' '.$current_user->user_login;436 if (strlen($update_reason) > 0) $event .= ' '. __('Note: ', 'h p-woo-rewards').$update_reason;436 $event = __('{points_label} adjusted by ', 'hostplugin-woocommerce-points-reward').' '.$current_user->user_login; 437 if (strlen($update_reason) > 0) $event .= ' '. __('Note: ', 'hostplugin-woocommerce-points-reward').$update_reason; 437 438 438 439 $this->update_customer_points($customer_id, $add_points); … … 452 453 */ 453 454 public function redeem_points_on_purchase($customer_id, $order_id, $deduct_points) { 454 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Order ID: '.$order_id.' Redeem points: '.$deduct_points);455 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id.' Order ID: '.$order_id.' Redeem points: '.$deduct_points); 455 456 456 457 if ($this->is_already_processed($order_id, $customer_id, self::LOG_TYPE_REDEEM_REWARDS) === false) { 457 $this->update_customer_points($this->customer_id, -$deduct_points); 458 $note = '{points_label} redeemed towards purchase';458 $this->update_customer_points($this->customer_id, -$deduct_points); 459 $note = __('{points_label} redeemed towards purchase', 'hostplugin-woocommerce-points-reward'); 459 460 $earned_points_string = "$deduct_points"; 460 461 $this->update_customer_points($customer_id, $deduct_points); … … 472 473 */ 473 474 public function get_point_name() { 474 return __('Points', 'h p-woo-rewards');475 return __('Points', 'hostplugin-woocommerce-points-reward'); 475 476 } 476 477 … … 485 486 */ 486 487 public function parse_point_name($message) { 487 error_log('replacing '.$message.' with '.$this->point_name);488 //error_log('replacing '.$message.' with '.$this->point_name); 488 489 return str_ireplace("{points_label}", $this->point_name, $message); 489 490 } -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Product.php
r2072276 r2198541 85 85 */ 86 86 public function show_points() { 87 88 $message = ''; 89 87 90 $hp_woo_points = $this->get_product_point(); 88 $ message = Helper::get_settings_option('single_product_message');91 $default_message = Helper::get_settings_option('single_product_message'); 89 92 $values = array( 90 93 'points_label' => $this->points->point_name, 91 94 'points' => $hp_woo_points 92 95 ); 93 $message =Helper::parse_customized_message($message, $values); 96 97 $message .= Helper::parse_customized_message($default_message, $values).'<br>'; 94 98 95 99 $customer_id = get_current_user_id(); … … 97 101 if ($customer_id > 0 && $existing_points > 0) { 98 102 99 $ message = Helper::get_settings_option('total_points_message');103 $default_message = Helper::get_settings_option('total_points_message'); 100 104 $values = array( 101 105 'points_label' => $this->points->point_name, 102 106 'points' => $existing_points 103 107 ); 104 $message = Helper::parse_customized_message($message, $values); 108 $message .= Helper::parse_customized_message($default_message, $values); 109 } 105 110 111 if (strlen($message) > 0) { 106 112 echo "<span>"; 107 113 echo $message; -
hostplugin-woocommerce-points-and-rewards/trunk/includes/Upgrade.php
r2072276 r2198541 28 28 29 29 if (version_compare($db_version, HOSTPLUGIN_WOO_POINTS_VERSION, '<') ) { 30 error_log('HP-WOO-REWARDS: Database version is '.$db_version.' Need to upgrade to '.HOSTPLUGIN_WOO_POINTS_VERSION);30 //error_log('HP-WOO-REWARDS: Database version is '.$db_version.' Need to upgrade to '.HOSTPLUGIN_WOO_POINTS_VERSION); 31 31 32 32 //if database version is less than 1.0.3 … … 49 49 */ 50 50 public static function update_database_1_0_3() { 51 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);51 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__); 52 52 $database_option = get_option( 'hp_woo_rewards_points_settings_option' ); 53 error_log('HP-WOO-REWARDS: Before update: '.print_r($database_option, true));53 //error_log('HP-WOO-REWARDS: Before update: '.print_r($database_option, true)); 54 54 55 55 if (isset($database_option['signup_points_role']) && !empty($database_option['signup_points_role'])) { … … 59 59 $database_option['signup_points_role'] = Helper::get_default_settings('signup_points_role'); 60 60 update_option( 'hp_woo_rewards_points_settings_option', $database_option ); 61 error_log('HP-WOO-REWARDS: After update: '.print_r($database_option, true));61 //error_log('HP-WOO-REWARDS: After update: '.print_r($database_option, true)); 62 62 } 63 63 } … … 68 68 */ 69 69 public static function update_database_1_0_6() { 70 error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);70 //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__); 71 71 $database_option = get_option( 'hp_woo_rewards_points_settings_option' ); 72 error_log('HP-WOO-REWARDS: Before update: '.print_r($database_option, true));72 //error_log('HP-WOO-REWARDS: Before update: '.print_r($database_option, true)); 73 73 74 74 if (isset($database_option['review_points']) && !empty($database_option['review_points'])) { … … 100 100 } 101 101 102 error_log('HP-WOO-REWARDS: After update: '.print_r($database_option, true));102 //error_log('HP-WOO-REWARDS: After update: '.print_r($database_option, true)); 103 103 update_option( 'hp_woo_rewards_points_settings_option', $database_option ); 104 104 } -
hostplugin-woocommerce-points-and-rewards/trunk/readme.txt
r2072276 r2198541 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DY6X6XWJFH8MW 4 4 Tags: points, rewards, points and rewards, woocommerce points and rewards, loyalty program, point, reward, awards, credit, credits, loyalty, customer, customer loyalty, customer loyalty program, woocommerce loyalty program, woocommerce, woocommerce points, woocommerce rewards, woocommerce discount, woocommerce plugin, woocommerce extenions, cashback, coupon, coupons, hostplugin 5 Requires at least: 4. 0.16 Tested up to: 5. 1.17 Stable tag: 1. 0.65 Requires at least: 4.6 6 Tested up to: 5.3 7 Stable tag: 1.1.0 8 8 Requires PHP: 5.3.8 9 9 License: GPLv2 or later … … 84 84 == Changelog == 85 85 86 = 1.1.0 = 87 Support Translation (customer-side aka front-end only) 88 Added new translations: zh_HK, zh_TW, zh_CN 89 Fixed Product message not displaying on product page 90 Removed error log traces 91 86 92 = 1.0.6 = 87 93 Added feature - reward points for reviewing products -
hostplugin-woocommerce-points-and-rewards/trunk/templates/admin_dashboard.php
r2072276 r2198541 1 1 <div class="wrap" id="hp_woo_rewards_dashboard"> 2 <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Dashboard', 'h p-woo-rewards' ); ?></h1>2 <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Dashboard', 'hostplugin-woocommerce-points-reward' ); ?></h1> 3 3 4 4 <?php 5 5 function page_tabs( $current = 'first' ) { 6 6 $tabs = array( 7 'tutorial' => 'Tutorial'7 'tutorial' => __('Tutorial', 'hostplugin-woocommerce-points-reward') 8 8 ); 9 9 10 10 if (HOSTPLUGIN_WOO_POINTS_LICENSE <> 'Premium') { 11 $tabs['premium'] = 'Premium Version';11 $tabs['premium'] = __('Premium Version', 'hostplugin-woocommerce-points-reward'); 12 12 } 13 13 else { 14 $tabs['support'] = 'Premium Support';14 $tabs['support'] = __('Premium Support', 'hostplugin-woocommerce-points-reward'); 15 15 } 16 16 … … 33 33 <div class="meta-box-sortables ui-sortable"> 34 34 <div class="postbox"> 35 <h3 class="hndle"><span> Using Hostplugin - Woocommerce Rewards & Points</span></h3>35 <h3 class="hndle"><span><?php _e('Using Hostplugin - Woocommerce Rewards & Points', 'hostplugin-woocommerce-points-reward'); ?></span></h3> 36 36 <div class="inside vid-container"> 37 37 <iframe width="960" height="540" src="https://www.youtube.com/embed/-JQ056f7uAw?VQ=HD720" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> … … 50 50 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/favourite.svg" class="premium-logo"></li> 51 51 <li> 52 <h2>Premium Version</h2> 53 Our premium version provides more features and functionalities that gives you more control over your WooCommerce store! For a limited time, To get a copy of our premium version simply donate at least US$29.99 and we will email you the plugin zip file within 1 business day (Don't forget to include your domain name, ie. yourdomain.com in the special instruction section to avoid any delay). <a href="https://www.hostplugin.com/woo-comparison.php" target="_blank">Please take a look on the feature comparison to see how the Premium Version can reward your loyal customers even more!</a> 52 <h2><?php _e('Premium Version', 'hostplugin-woocommerce-points-reward')?></h2> 53 <?php _e("Our premium version provides more features and functionalities that gives you more control over your WooCommerce store! For a limited time, To get a copy of our premium version simply donate at least US$29.99 and we will email you the plugin zip file within 1 business day (Don't forget to include your domain name, ie. yourdomain.com in the special instruction section to avoid any delay).", 'hostplugin-woocommerce-points-reward'); ?> 54 <a href="https://www.hostplugin.com/woo-comparison.php" target="_blank"><?php _e('Please take a look on the feature comparison to see how the Premium Version can reward your loyal customers even more!', 'hostplugin-woocommerce-points-reward')?></a> 54 55 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> 55 56 <input type="hidden" name="cmd" value="_s-xclick"> … … 66 67 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/female-customer.svg" class="premium-logo"></li> 67 68 <li> 68 <h2>Premium Support</h2> 69 Premium license entitles you to <strong>lifetime</strong> update and 6 months premium support. Each installation of the plugin will require a licence key in order for you to receive updates and support.</li> 69 <h2><?php _e('Premium Support', 'hostplugin-woocommerce-points-reward'); ?></h2> 70 <?php 71 72 $lifetime = __('lifetime', 'hostplugin-woocommerce-points-reward'); 73 printf( __('Premium license entitles you to <strong>%s</strong> update and 6 months premium support. Each installation of the plugin will require a licence key in order for you to receive updates and support.', 'hostplugin-woocommerce-points-reward'), $lifetime ); ?> 74 </li> 70 75 </ul> 71 76 </section> … … 75 80 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/refund.png"></li> 76 81 <li> 77 <h2> Refund Feature</h2>78 - Option to remove points for refunded / cancelled orders<br>79 - Option to return redeemed points for refunded / cancelled orders82 <h2><?php _e('Refund Feature', 'hostplugin-woocommerce-points-reward'); ?></h2> 83 <?php _e('- Option to remove points for refunded / cancelled orders', 'hostplugin-woocommerce-points-reward'); ?><br> 84 <?php _e('- Option to return redeemed points for refunded / cancelled orders', 'hostplugin-woocommerce-points-reward'); ?> 80 85 </li> 81 86 </ul> … … 86 91 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/review.png"></li> 87 92 <li> 88 <h2> Product Review</h2>89 - Option to set maximum review points one can get<br>90 - Option to disable points for reviewing the same product<br>91 - who can earn product review points<br>93 <h2><?php _e('Product Review', 'hostplugin-woocommerce-points-reward'); ?></h2> 94 <?php _e('- Option to set maximum review points one can get', 'hostplugin-woocommerce-points-reward'); ?><br> 95 <?php _e('- Option to disable points for reviewing the same product', 'hostplugin-woocommerce-points-reward'); ?><br> 96 <?php _e('- who can earn product review points', 'hostplugin-woocommerce-points-reward'); ?><br> 92 97 </li> 93 98 </ul> … … 98 103 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/message.png"></li> 99 104 <li> 100 <h2>Easy to Customize</h2> 101 Customize the frontend messages that are shown on the product, cart, checkout & order received page. You can also change the points label so that customers could earn "Coins" or "Bucks" instead of "Points".</li> 105 <h2><?php _e('Easy to Customize', 'hostplugin-woocommerce-points-reward'); ?></h2> 106 <?php _e('Customize the frontend messages that are shown on the product, cart, checkout & order received page. You can also change the points label so that customers could earn "Coins" or "Bucks" instead of "Points".', 'hostplugin-woocommerce-points-reward'); ?> 107 </li> 102 108 </ul> 103 109 </section> … … 107 113 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/discount-tag.svg" class="premium-logo"></li> 108 114 <li> 109 <h2>Maximum Points Discount</h2> 110 Completely control the maximum discount available when redeeming points. 115 <h2><?php _e('Maximum Points Discount', 'hostplugin-woocommerce-points-reward'); ?></h2> 116 <?php _e('Completely control the maximum discount available when redeeming points.', 'hostplugin-woocommerce-points-reward'); ?> 117 111 118 </li> 112 119 </ul> … … 117 124 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/min-purchase-amount.png"></li> 118 125 <li> 119 <h2>Minimum Purchase Amount</h2> 120 Ability to set the minimum purchase amount in order to redeem points.</li> 126 <h2><?php _e('Minimum Purchase Amount', 'hostplugin-woocommerce-points-reward'); ?></h2> 127 <?php _e('Ability to set the minimum purchase amount in order to redeem points.', 'hostplugin-woocommerce-points-reward'); ?> 128 </li> 121 129 </ul> 122 130 </section> … … 126 134 <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/coupon.png"></li> 127 135 <li> 128 <h2> Coupon</h2>129 - Ability to disable points redemption when using coupons<br>130 - Ability to disable customers from earning points if coupons are use136 <h2><?php _e('Coupon', 'hostplugin-woocommerce-points-reward'); ?></h2> 137 <?php _e('- Ability to disable points redemption when using coupons', 'hostplugin-woocommerce-points-reward'); ?><br> 138 <?php _e('- Ability to disable customers from earning points if coupons are use', 'hostplugin-woocommerce-points-reward'); ?> 131 139 </li> 132 140 </ul> … … 141 149 <div class="meta-box-sortables ui-sortable"> 142 150 <div class="postbox"> 143 <h3 class="hndle"><span> Premium Support</span></h3>151 <h3 class="hndle"><span><?php _e('Premium Support', 'hostplugin-woocommerce-points-reward'); ?></span></h3> 144 152 <div class="inside vid-container"> 145 Please <a href="https://www.hostplugin.com/members/" target="_blank">Click Here</a>, login and create a ticket 153 <?php _e('Please', 'hostplugin-woocommerce-points-reward'); ?> 154 <a href="https://www.hostplugin.com/members/" target="_blank"><?php _e('Click Here', 'hostplugin-woocommerce-points-reward'); ?></a>, <?php _e('login and create a ticket', 'hostplugin-woocommerce-points-reward'); ?> 146 155 </div> 147 156 </div> -
hostplugin-woocommerce-points-and-rewards/trunk/templates/admin_settings.php
r2018489 r2198541 1 1 <div class="wrap"> 2 <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Settings', 'h p-woo-rewards' ); ?></h1>2 <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Settings', 'hostplugin-woocommerce-points-reward' ); ?></h1> 3 3 <?php settings_errors('hp_woo_rewards_points_settings_error'); ?> 4 4 … … 10 10 do_settings_sections("hp_woo_rewards_points_settings"); 11 11 // Add the submit button to serialize the options 12 submit_button( 'Save Changes', 'primary', 'submit', false);12 submit_button(__('Save Changes', 'hostplugin-woocommerce-points-reward'), 'primary', 'submit', false); 13 13 echo " "; 14 submit_button( 'Reset to Defaults', 'secondary', 'hp_woo_reset_settings', false);14 submit_button(__('Reset to Defaults', 'hostplugin-woocommerce-points-reward'), 'secondary', 'hp_woo_reset_settings', false); 15 15 ?> 16 16 </form> … … 26 26 if (isset($args['premium']) && $args['premium'] == true && HOSTPLUGIN_WOO_POINTS_LICENSE != 'Premium') { 27 27 28 echo '<span class="premium"> <a href="'. admin_url( 'admin.php?page=hp_woo_rewards_points_dashboard&tab=premium').'">( Premium Feature)</a></span>';28 echo '<span class="premium"> <a href="'. admin_url( 'admin.php?page=hp_woo_rewards_points_dashboard&tab=premium').'">('. __('Premium Feature', 'hostplugin-woocommerce-points-reward') .')</a></span>'; 29 29 } 30 30 } … … 54 54 55 55 function hp_woo_rewards_points_field_points_conversion($args) { 56 echo esc_html_e('Spend ', 'h p-woo-rewards');56 echo esc_html_e('Spend ', 'hostplugin-woocommerce-points-reward'); 57 57 echo ' '.get_woocommerce_currency_symbol().' '; 58 58 … … 60 60 hp_woo_rewards_points_number_input($dollar_spent); 61 61 62 echo esc_html_e( ' and earn ', 'h p-woo-rewards' );62 echo esc_html_e( ' and earn ', 'hostplugin-woocommerce-points-reward' ); 63 63 $points_earned = array('label_for' => 'points_earned', 'value' => $args['points_earned']); 64 64 hp_woo_rewards_points_number_input($points_earned); 65 echo esc_html_e( ' Point(s) ', 'h p-woo-rewards' );65 echo esc_html_e( ' Point(s) ', 'hostplugin-woocommerce-points-reward' ); 66 66 } 67 67 … … 69 69 $redeem_points = array('label_for' => 'redeem_points', 'value' => $args['redeem_points']); 70 70 hp_woo_rewards_points_number_input($redeem_points); 71 echo esc_html_e( ' Point(s) ', 'h p-woo-rewards' );71 echo esc_html_e( ' Point(s) ', 'hostplugin-woocommerce-points-reward' ); 72 72 echo ' = '.get_woocommerce_currency_symbol().' '; 73 73 $redeem_dollar = array('label_for' => 'redeem_dollar', 'value' => $args['redeem_dollar']); … … 78 78 $max_points_discount = array('label_for' => 'max_points_discount', 'value' => $args['max_points_discount']); 79 79 hp_woo_rewards_points_number_input($max_points_discount); 80 $max_points_discount_type = array('label_for' => 'max_points_discount_type', 'value' => $args['max_points_discount_type'], 'options' => array('currency' => get_woocommerce_currency_symbol(), 'percentage' => 'percentage'), 'class'=> 'medium');80 $max_points_discount_type = array('label_for' => 'max_points_discount_type', 'value' => $args['max_points_discount_type'], 'options' => array('currency' => get_woocommerce_currency_symbol(), 'percentage' => __('percentage', 'hostplugin-woocommerce-points-reward')), 'class'=> 'medium'); 81 81 hp_woo_rewards_points_select($max_points_discount_type); 82 82 hp_woo_premium_feature_only($args); … … 100 100 101 101 102 echo '<option value="'. $key .'" '. $selected .'>'. esc_attr( $value, 'h p-woo-rewards' ) .'</option>';102 echo '<option value="'. $key .'" '. $selected .'>'. esc_attr( $value, 'hostplugin-woocommerce-points-reward' ) .'</option>'; 103 103 } 104 104 -
hostplugin-woocommerce-points-and-rewards/trunk/templates/my_account.php
r2072276 r2198541 6 6 ?> 7 7 8 <h3><?php echo 'Your '.$point_name?></h3>9 <p> You have <?php echo $points. ' '.$point_name?></p>8 <h3><?php printf( __( 'Your %s', 'hostplugin-woocommerce-points-reward'), $point_name);?></h3> 9 <p><?php printf( __( 'You have %s %s', 'hostplugin-woocommerce-points-reward'), $points, $point_name);?></p> 10 10 <table class="woocommerce-orders-table woocommerce-MyAccount-orders shop_table shop_table_responsive my_account_orders account-orders-table"> 11 11 <thead> 12 12 <tr> 13 <th class="woocommerce-orders-table__header"><span class="nobr"> Date</span></th>14 <th class="woocommerce-orders-table__header"><span class="nobr"> Order ID</span></th>15 <th class="woocommerce-orders-table__header"><span class="nobr"> Comment ID</span></th>16 <th class="woocommerce-orders-table__header"><span class="nobr"> Event</span></th>13 <th class="woocommerce-orders-table__header"><span class="nobr"><?php _e('Date', 'hostplugin-woocommerce-points-reward'); ?></span></th> 14 <th class="woocommerce-orders-table__header"><span class="nobr"><?php _e('Order ID', 'hostplugin-woocommerce-points-reward'); ?></span></th> 15 <th class="woocommerce-orders-table__header"><span class="nobr"><?php _e('Comment ID', 'hostplugin-woocommerce-points-reward'); ?></span></th> 16 <th class="woocommerce-orders-table__header"><span class="nobr"><?php _e('Event', 'hostplugin-woocommerce-points-reward'); ?></span></th> 17 17 <th class="woocommerce-orders-table__header"><span class="nobr"><?php echo $point_name ?></span></th> 18 18 </tr> … … 24 24 <tr class="woocommerce-orders-table__row woocommerce-orders-table__row--status- order"> 25 25 <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-"> 26 <?php echo human_time_diff( $detail['date'], current_time('timestamp',1) ) . ' ago'?>26 <?php echo human_time_diff( $detail['date'], current_time('timestamp',1) ) . __(' ago', 'hostplugin-woocommerce-points-reward'); ?> 27 27 </td> 28 28 <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-"> -
hostplugin-woocommerce-points-and-rewards/trunk/templates/user_points_details.php
r2072276 r2198541 1 <h2><?php esc_html_e( 'Woo Rewards', 'h p-woo-rewards' ); ?></h2>1 <h2><?php esc_html_e( 'Woo Rewards', 'hostplugin-woocommerce-points-reward' ); ?></h2> 2 2 <table class="form-table"> 3 3 <tbody><tr class="user-point-wrap"> 4 <th><label for="point"><?php esc_html_e( 'Total Points', 'h p-woo-rewards' ); ?></label></th>4 <th><label for="point"><?php esc_html_e( 'Total Points', 'hostplugin-woocommerce-points-reward' ); ?></label></th> 5 5 <td> 6 6 <?php 7 7 $points = $this->points->get_customer_total_points($profileuser->ID); 8 8 ?> 9 <input type="number" step="1" name="hp_woo_reward_points" id="hp_woo_reward_points" value="<?php esc_attr_e( $points, 'hp-woo-rewards'); ?>" class="short">10 Reason: <input type="text" name="hp_woo_reward_points_update_reason" id="hp_woo_reward_points_update_reason" placeholder="Optional" class="regular-text">9 <input type="number" step="1" name="hp_woo_reward_points" id="hp_woo_reward_points" value="<?php esc_attr_e($points); ?>" class="short"> 10 <?php _e('Reason: ', 'hostplugin-woocommerce-points-reward'); ?><input type="text" name="hp_woo_reward_points_update_reason" id="hp_woo_reward_points_update_reason" placeholder="<?php _e('Optional', 'hostplugin-woocommerce-points-reward') ?>" class="regular-text"> 11 11 </td> 12 12 </tr> … … 22 22 <thead> 23 23 <tr> 24 <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary"> Date</th>25 <th scope="col" id="hp_woo_rewards_log_order_id" class="manage-column column-format"> Order ID</th>26 <th scope="col" id="hp_woo_rewards_log_comment_id" class="manage-column column-format"> Comment ID</th>27 <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event"> Event</th>28 <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format"> Points</th>24 <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary"><?php _e('Date', 'hostplugin-woocommerce-points-reward'); ?></th> 25 <th scope="col" id="hp_woo_rewards_log_order_id" class="manage-column column-format"><?php _e('Order ID', 'hostplugin-woocommerce-points-reward'); ?></th> 26 <th scope="col" id="hp_woo_rewards_log_comment_id" class="manage-column column-format"><?php _e('Comment ID', 'hostplugin-woocommerce-points-reward'); ?></th> 27 <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event"><?php _e('Event', 'hostplugin-woocommerce-points-reward'); ?></th> 28 <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format"><?php _e('Points', 'hostplugin-woocommerce-points-reward'); ?></th> 29 29 </tr> 30 30 </thead> … … 66 66 <tfoot> 67 67 <tr> 68 <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary">Date</th>69 <th scope="col" id="hp_woo_rewards_log_order_id" class="manage-column column-format"> Order ID</th>70 <th scope="col" id="hp_woo_rewards_log_comment_id" class="manage-column column-format"> Comment ID</th>71 <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event"> Event</th>72 <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format"> Points</th>68 <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary"><?php _e('Date', 'hostplugin-woocommerce-points-reward'); ?></th> 69 <th scope="col" id="hp_woo_rewards_log_order_id" class="manage-column column-format"><?php _e('Order ID', 'hostplugin-woocommerce-points-reward'); ?></th> 70 <th scope="col" id="hp_woo_rewards_log_comment_id" class="manage-column column-format"><?php _e('Comment ID', 'hostplugin-woocommerce-points-reward'); ?></th> 71 <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event"><?php _e('Event', 'hostplugin-woocommerce-points-reward'); ?></th> 72 <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format"><?php _e('Points', 'hostplugin-woocommerce-points-reward'); ?></th> 73 73 </tr> 74 74 </tfoot>
Note: See TracChangeset
for help on using the changeset viewer.