Plugin Directory

Changeset 2198541


Ignore:
Timestamp:
11/22/2019 02:41:41 AM (6 years ago)
Author:
hostplugin
Message:

1.1.0

Location:
hostplugin-woocommerce-points-and-rewards/trunk
Files:
8 added
17 edited

Legend:

Unmodified
Added
Removed
  • hostplugin-woocommerce-points-and-rewards/trunk/hostplugin-woocommerce-points-rewards.php

    r2072276 r2198541  
    77Plugin URI: https://wordpress.org/plugins/hostplugin-woocommerce-points-and-rewards
    88Description: Reward your loyal customers for purchases and other actions using points which can be redeemed for discounts on future purchase.
    9 Version: 1.0.6
     9Version: 1.1.0
    1010Author: HostPlugin.com
    1111Author URI: http://www.hostplugin.com
     12Text Domain: hostplugin-woocommerce-points-reward
     13Domain Path: /languages
    1214License: GPLv2 or later
    1315*/
     
    3032
    3133if ( 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'));
    3335}
    3436
     
    8890        private function setup_constants() {
    8991            if ( ! defined( 'HOSTPLUGIN_WOO_POINTS_VERSION' ) ) {
    90                 define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1.0.6' );
     92                define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1.1.0' );
    9193            }
    9294
     
    143145    hp_woo_points_rewards_upgrade_database();
    144146    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/');
    145148}
    146149
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Account.php

    r2072276 r2198541  
    7878
    7979    // Insert your custom endpoint.
    80     $items['hp-woo-rewards-points'] = __($point_name, 'hp-woo-rewards');
     80    $items['hp-woo-rewards-points'] = $point_name;
    8181
    8282    // Insert back the logout item.
     
    108108  public function display_review_points_message($comment_data) {
    109109
    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));
    111111
    112112    $review_points = $this->points->get_review_points();
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/Admin.php

    r1949889 r2198541  
    2727        add_action('admin_menu', array($this, 'create_admin_menu'));
    2828        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') );
    3030    }
    3131
     
    6060     */
    6161    public function create_admin_menu() {
    62         add_menu_page( __('HP Woocommerce Rewards & Points', 'hp-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 );
    6363    }//function
    6464
    6565    public function add_footer() {
    6666        $screen = get_current_screen();
    67         error_log($screen->id);
     67        //error_log($screen->id);
    6868        if ($screen->id == 'toplevel_page_hp_woo_rewards_points_dashboard') {
    6969            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>';
     
    7979     */
    8080    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>';
    8383
    8484       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>';
    8686       }
    8787       
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/PointTable.php

    r1926469 r2198541  
    4747   */
    4848  public function create_submenu_menu() {
    49     add_submenu_page('hp_woo_rewards_points_dashboard', __('Points Table', 'hp-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'));
    5050  }//function
    5151
     
    7070     */
    7171  public function add_point_column( $column ) {
    72       $column['points'] = 'Points';
     72      $column['points'] = __('Points', 'hostplugin-woocommerce-points-reward');
    7373      return $column;
    7474  }
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/Settings.php

    r2072276 r2198541  
    3737    public function create_submenu_menu() {
    3838
    39         add_submenu_page('hp_woo_rewards_points_dashboard', __('Settings', 'hp-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'));
    4040    }//function
    4141
     
    7777        register_setting('hp_woo_rewards_points_settings_option', 'hp_woo_rewards_points_settings_option', array($this, 'validate_fields'));
    7878
    79         add_settings_section("hp_woo_rewards_points_section", __("General Settings", 'hp-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", 'hp-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", 'hp-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", 'hp-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", 'hp-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", 'hp-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>
    9090            {points_label}: points label', true), "hp_woo_rewards_points_section_callback", "hp_woo_rewards_points_settings");
    9191
    92         add_settings_field("is_system_enabled", __("Enable Reward System: ", 'hp-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',
    9393            array(
    9494                'label_for' => 'is_system_enabled',
     
    9797        );
    9898
    99         add_settings_field("points_name", __("Points Label: ", 'hp-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',
    100100            array(
    101101                'label_for' => 'points_name',
     
    105105        );
    106106
    107         add_settings_field("points_earned", __("Points Conversion: ",'hp-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',
    108108                array(
    109109                'dollar_spent' => $option['dollar_spent'],
     
    116116            'round-up' => 'Always Round Up'
    117117        );
    118         add_settings_field("round_off", __('Round Off: ','hp-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',
    119119            array(
    120120                'label_for' => 'round_off',
     
    124124        );
    125125
    126         add_settings_field("points_redeem", __("Redeem Points Conversion: ",'hp-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',
    127127            array(
    128128                'redeem_points' => $option['redeem_points'],
     
    150150        /**********************************************************************/
    151151
    152         add_settings_field("signup_points", __("Signup Points: ", 'hp-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',
    153153            array(
    154154                'label_for' => 'signup_points',
     
    158158
    159159        $role_options = Helper::get_roles(true);
    160         add_settings_field("signup_points_role", __("Who can earn signup points? ", 'hp-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',
    161161            array(
    162162                'label_for' => 'signup_points_role',
     
    173173        /**********************************************************************/
    174174
    175         add_settings_field("review_points", __("Review Points: ", 'hp-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',
    176176            array(
    177177                'label_for' => 'review_points',
     
    180180        );
    181181
    182         add_settings_field("max_review_points_for_user", __("Maximum Review Points: ", 'hp-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',
    183183            array(
    184184                'label_for' => 'max_review_points_for_user',
     
    188188        );
    189189
    190         add_settings_field("user_cannot_earn_points_for_reviewing_same_product", __("User cannot earn points for reviewing the same product?", 'hp-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',
    191191            array(
    192192                'label_for' => 'user_cannot_earn_points_for_reviewing_same_product',
     
    196196        );
    197197
    198         add_settings_field("review_points_role", __("Who can earn review points? ", 'hp-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',
    199199            array(
    200200                'label_for' => 'review_points_role',
     
    211211        /**********************************************************************/
    212212
    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), 'hp-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',
    214214            array(
    215215                'label_for' => 'is_remove_earned_points_if_refunded',
     
    219219        );
    220220
    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), 'hp-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',
    222222            array(
    223223                'label_for' => 'is_return_redeemed_points_if_refunded',
     
    231231        /**********************************************************************/
    232232
    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',
    234235            array(
    235236                'label_for' => 'disable_point_when_using_coupon',
     
    239240        );
    240241
    241         add_settings_field("no_earn_point_when_using_coupon", __("Can't Earn Points if coupons are used", 'hp-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',
    242243            array(
    243244                'label_for' => 'no_earn_point_when_using_coupon',
     
    382383        $error_message = '';
    383384        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>';
    385386        }
    386387
    387388        if (!class_exists( 'WooCommerce' )) {
    388389            //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>';
    390391        }
    391392
    392393        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');
    394395    }
    395396}
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Cart.php

    r2018489 r2198541  
    8080     */
    8181    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__);
    8383        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');
    8585            WC()->session->set('hp_woo_rewards_enabled', 'true');   //customer wants to use points
    8686        }
     
    9191
    9292        //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);
    9494        WC()->session->set('hp_woo_rewards_discount', $discount);
    9595        WC()->session->set('hp_woo_rewards_points_used', $points_used);
     
    106106     */
    107107    public function apply_point_discount() {
    108         error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    109 
     108        //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    110109
    111110        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');
    113112            $max_discount = $this->get_max_cart_discount();
    114113            $discount = $this->points->get_point_discount($this->customer_id, $max_discount);
     
    120119
    121120            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 );
    123122            }
    124123        }//customer logged in
     
    133132     */
    134133    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>';
    137136    }
    138137
     
    146145     */
    147146    public function validate_order() {
    148         error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
     147        //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    149148        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');
    151150            $fees = WC()->cart->get_fees();
    152151
    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));
    154153            foreach ($fees as $fee) {
    155                 if ($fee->name == 'Point Discount') {
     154                if ($fee->name == __('Point Discount', 'hostplugin-woocommerce-points-reward')) {
    156155                    $discount = abs(floatval($fee->amount));    //convert to +
    157156                    $max_discount = $this->get_max_cart_discount();
    158157                    $customer_discount = $this->points->get_point_discount($this->customer_id, $max_discount);
    159158
    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);
    161160
    162161                    if ($discount > $customer_discount) {
    163                         $error_text = __('The maximum discount you can get is: ', 'hp-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;
    164163                        wc_add_notice( $error_text, 'error' );
    165164                        return;
     
    239238                echo('</span>');
    240239                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>');
    242241                }
    243242                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>');
    245244                }
    246245               
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Comments.php

    r2072277 r2198541  
    2424    if ($this->points->is_point_system_enabled() == true) {
    2525
    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 );
    2727      add_action('transition_comment_status', array($this, 'rewards_points_for_comment'),10,3);
    2828    }//show rewards points only if point system is enabled
     
    3131  public function prepare_rewards_points_for_comment( $comment_ID, $comment_approved ) {
    3232
    33     error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
     33    //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    3434    if( 1 === $comment_approved ){
    3535      $comment = get_comment( $comment_ID);
     
    4848  public function rewards_points_for_comment($new_status, $old_status, $comment) {
    4949
    50     error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    51 
     50    //error_log('HP-WOO-REWARDS: Calling '.__FUNCTION__);
    5251    $points_to_add = $this->can_earn_points_for_comment($new_status, $comment);
    5352    if ($points_to_add > 0)
     
    7776      //make sure it's product
    7877      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);
    8179        return $review_points;
    8280
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Helper.php

    r2072276 r2198541  
    1212     * @var array
    1313     */
    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(
    1527        'is_system_enabled'                 => 'on',
    1628        'points_name'                       => 'Points',
     
    3446        'disable_point_when_using_coupon'   => 'on',
    3547        '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    }
    4558
    4659    /**
     
    90103     */
    91104    public static function get_default_settings($option_name = '') {
     105
     106        if (self::$default_settings == null)
     107            self::set_default_settings();
     108
    92109        if (!empty($option_name)) {
    93110            return self::$default_settings[$option_name];
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Order.php

    r1924295 r2198541  
    5858     */
    5959    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);
    6161        $points_used = (int)WC()->session->get('hp_woo_rewards_points_used');
    6262        if (WC()->session->get('hp_woo_rewards_enabled') == 'true' && $points_used > 0) {
    6363            $order = wc_get_order( $order_id );
    6464            $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);
    6666            $this->points->redeem_points_on_purchase($customer_id, $order_id, -$points_used);
    6767        }
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Points.php

    r2072276 r2198541  
    199199     */
    200200    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);
    202202        $purchase_details = get_user_meta($customer_id, 'hp_woo_rewards_points_details', true);
    203203
    204         error_log('HP-WOO-REWARDS: Get : '.print_r($purchase_details, true));
     204        //error_log('HP-WOO-REWARDS: Get : '.print_r($purchase_details, true));
    205205        if (empty($purchase_details)) $purchase_details = array();
    206206        //oldest entry goes first?
    207207        if ($is_reverse) krsort($purchase_details);
     208
    208209        return $purchase_details;
    209210    }
     
    219220     */
    220221    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);
    222223        if ($points_to_add <> 0) {
    223224            $total_points = $this->get_customer_total_points($customer_id);
    224225            $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);
    226227            update_user_meta( $customer_id, 'hp_woo_rewards_points', $total_points );
    227228        }
     
    242243     */
    243244    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);
    245246
    246247        $points = intval($points_string);
     
    258259            );
    259260
    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));
    261262            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));
    263264            update_user_meta( $customer_id, 'hp_woo_rewards_points_details', $purchase_details);
    264265        }       
     
    274275     */
    275276    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);
    277278        $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()));
    280281        $net_total_after_discount = floatval($order->get_subtotal()) - floatval($order->get_discount_total());
    281282        $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);
    283284        return $earned_points;
    284285    }
     
    295296        $price = WC()->cart->get_cart_contents_total(); //total minus discounts (discount and coupons)
    296297        $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));
    298299
    299300        $discount_in_fee = 0;
     
    308309        $price = $price + $discount_in_fee;
    309310
    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);
    312313        $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);
    314315        return $total_points_in_cart;
    315316    }
     
    327328     */
    328329    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);
    330331        $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));
    332333        foreach ($points_details as $detail) {
    333334            if ($comment_id > 0) {
    334335                //review type
    335336                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');
    337338                    return (int)$detail['points'];
    338339                }
     
    341342                //other type
    342343                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');
    344345                    return (int)$detail['points'];
    345346                }
     
    360361     */
    361362    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);
    363364        $earned_points = $this->get_total_points_in_order($order_id);
    364365        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);
    366367            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);
    368369                $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');
    370371                $earned_points_string = "+$earned_points";
    371372                $this->update_customer_points_details($customer_id, $earned_points_string, $note, self::LOG_TYPE_PURCHASE_REWARDS, $order_id);
     
    384385     */
    385386    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);
    387388        if ((int)$this->option['signup_points'] > 0 && $this->is_already_processed(0, $customer_id, self::LOG_TYPE_SIGNUP_REWARDS) === false) {
    388389                $this->update_customer_points($customer_id, $signup_points);
    389390                $point_string = "+".$signup_points;
    390                 $event = __('{points_label} earned for account signup', 'hp-woo-rewards');
     391                $event = __('{points_label} earned for account signup', 'hostplugin-woocommerce-points-reward');
    391392                $this->update_customer_points_details($customer_id, $point_string, $event, self::LOG_TYPE_SIGNUP_REWARDS, $order_id = null);
    392393        }
     
    403404     */
    404405    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);
    406407
    407408        if ($review_points > 0 && $this->is_already_processed(0, $customer_id, self::LOG_TYPE_REVIEW_REWARDS, $comment_id) === false) {
     
    409410            $point_string = "+".$review_points;
    410411
    411             $event = __('{points_label} earned for reviewing product', 'hp-woo-rewards');
     412            $event = __('{points_label} earned for reviewing product', 'hostplugin-woocommerce-points-reward');
    412413            $this->update_customer_points_details($customer_id, $point_string, $event, self::LOG_TYPE_REVIEW_REWARDS, $order_id = null, $comment_id);
    413414        }
     
    433434         $point_string = "".$point_string;
    434435         $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: ', 'hp-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;
    437438
    438439         $this->update_customer_points($customer_id, $add_points);
     
    452453     */
    453454    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);
    455456
    456457        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');
    459460            $earned_points_string = "$deduct_points";
    460461            $this->update_customer_points($customer_id, $deduct_points);
     
    472473     */
    473474    public function get_point_name() {
    474         return __('Points', 'hp-woo-rewards');
     475        return __('Points', 'hostplugin-woocommerce-points-reward');
    475476    }
    476477
     
    485486     */
    486487    public function parse_point_name($message) {
    487         error_log('replacing '.$message.' with '.$this->point_name);
     488        //error_log('replacing '.$message.' with '.$this->point_name);
    488489        return str_ireplace("{points_label}", $this->point_name, $message);
    489490    }
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Product.php

    r2072276 r2198541  
    8585     */
    8686    public function show_points() {
     87
     88        $message = '';
     89
    8790        $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');
    8992        $values = array(
    9093          'points_label'  => $this->points->point_name,
    9194          'points'        => $hp_woo_points
    9295        );
    93         $message =Helper::parse_customized_message($message, $values);
     96
     97        $message .= Helper::parse_customized_message($default_message, $values).'<br>';
    9498
    9599        $customer_id = get_current_user_id();
     
    97101        if ($customer_id > 0 && $existing_points > 0) {
    98102
    99             $message = Helper::get_settings_option('total_points_message');
     103            $default_message = Helper::get_settings_option('total_points_message');
    100104            $values = array(
    101105              'points_label'  => $this->points->point_name,
    102106              'points'        => $existing_points
    103107            );
    104             $message = Helper::parse_customized_message($message, $values);
     108            $message .= Helper::parse_customized_message($default_message, $values);
     109        }
    105110
     111        if (strlen($message) > 0) {         
    106112            echo "<span>";
    107113            echo $message;
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Upgrade.php

    r2072276 r2198541  
    2828       
    2929        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);
    3131
    3232            //if database version is less than 1.0.3
     
    4949     */
    5050    public static function update_database_1_0_3() {
    51         error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
     51        //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
    5252        $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));
    5454       
    5555        if (isset($database_option['signup_points_role']) && !empty($database_option['signup_points_role'])) {
     
    5959            $database_option['signup_points_role'] = Helper::get_default_settings('signup_points_role');
    6060            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));
    6262        }
    6363    }
     
    6868     */
    6969    public static function update_database_1_0_6() {
    70         error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
     70        //error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
    7171        $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));
    7373
    7474        if (isset($database_option['review_points']) && !empty($database_option['review_points'])) {
     
    100100        }
    101101
    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));
    103103        update_option( 'hp_woo_rewards_points_settings_option', $database_option );
    104104    }
  • hostplugin-woocommerce-points-and-rewards/trunk/readme.txt

    r2072276 r2198541  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DY6X6XWJFH8MW
    44Tags: 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.1
    6 Tested up to: 5.1.1
    7 Stable tag: 1.0.6
     5Requires at least: 4.6
     6Tested up to: 5.3
     7Stable tag: 1.1.0
    88Requires PHP: 5.3.8
    99License: GPLv2 or later
     
    8484== Changelog ==
    8585
     86= 1.1.0 =
     87Support Translation (customer-side aka front-end only)
     88Added new translations: zh_HK, zh_TW, zh_CN
     89Fixed Product message not displaying on product page
     90Removed error log traces
     91
    8692= 1.0.6 =
    8793Added feature - reward points for reviewing products
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/admin_dashboard.php

    r2072276 r2198541  
    11<div class="wrap" id="hp_woo_rewards_dashboard">
    2     <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Dashboard', 'hp-woo-rewards' ); ?></h1>
     2    <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Dashboard', 'hostplugin-woocommerce-points-reward' ); ?></h1>
    33
    44<?php
    55function page_tabs( $current = 'first' ) {
    66    $tabs = array(
    7         'tutorial'   => 'Tutorial'
     7        'tutorial'   => __('Tutorial', 'hostplugin-woocommerce-points-reward')
    88    );
    99
    1010    if (HOSTPLUGIN_WOO_POINTS_LICENSE <> 'Premium') {
    11         $tabs['premium'] = 'Premium Version';
     11        $tabs['premium'] = __('Premium Version', 'hostplugin-woocommerce-points-reward');
    1212    }
    1313    else {
    14         $tabs['support'] = 'Premium Support';
     14        $tabs['support'] = __('Premium Support', 'hostplugin-woocommerce-points-reward');
    1515    }
    1616
     
    3333        <div class="meta-box-sortables ui-sortable">
    3434            <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>
    3636                <div class="inside vid-container">
    3737                    <iframe width="960" height="540" src="https://www.youtube.com/embed/-JQ056f7uAw?VQ=HD720" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
     
    5050        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/favourite.svg" class="premium-logo"></li>
    5151        <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>
    5455            <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    5556            <input type="hidden" name="cmd" value="_s-xclick">
     
    6667        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/female-customer.svg" class="premium-logo"></li>
    6768        <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>
    7075    </ul>
    7176</section>
     
    7580        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/refund.png"></li>
    7681        <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 orders
     82            <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'); ?>
    8085        </li>
    8186    </ul>
     
    8691        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/review.png"></li>
    8792        <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>
    9297        </li>
    9398    </ul>
     
    98103        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/message.png"></li>
    99104        <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>
    102108    </ul>
    103109</section>
     
    107113        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/discount-tag.svg" class="premium-logo"></li>
    108114        <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       
    111118    </li>
    112119    </ul>
     
    117124        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/min-purchase-amount.png"></li>
    118125        <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>
    121129    </ul>
    122130</section>
     
    126134        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/coupon.png"></li>
    127135        <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 use
     136            <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'); ?>
    131139        </li>
    132140    </ul>
     
    141149        <div class="meta-box-sortables ui-sortable">
    142150            <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>
    144152                <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'); ?>
    146155                </div>
    147156            </div>
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/admin_settings.php

    r2018489 r2198541  
    11<div class="wrap">
    2     <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Settings', 'hp-woo-rewards' ); ?></h1>
     2    <h1 class="wp-heading-inline"><?php esc_html_e( 'Hostplugin - Woocommerce Rewards & Points Settings', 'hostplugin-woocommerce-points-reward' ); ?></h1>
    33    <?php settings_errors('hp_woo_rewards_points_settings_error'); ?>
    44
     
    1010            do_settings_sections("hp_woo_rewards_points_settings");
    1111            // 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); 
    1313            echo "&nbsp;";
    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);         
    1515        ?>
    1616    </form>
     
    2626        if (isset($args['premium']) && $args['premium'] == true && HOSTPLUGIN_WOO_POINTS_LICENSE != 'Premium') {
    2727           
    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>';     
    2929        }
    3030    }
     
    5454
    5555    function hp_woo_rewards_points_field_points_conversion($args) {
    56         echo esc_html_e('Spend ', 'hp-woo-rewards');
     56        echo esc_html_e('Spend ', 'hostplugin-woocommerce-points-reward');
    5757        echo ' '.get_woocommerce_currency_symbol().' ';
    5858
     
    6060        hp_woo_rewards_points_number_input($dollar_spent);
    6161
    62         echo esc_html_e( ' and earn ', 'hp-woo-rewards' );
     62        echo esc_html_e( ' and earn ', 'hostplugin-woocommerce-points-reward' );
    6363        $points_earned = array('label_for' => 'points_earned', 'value' => $args['points_earned']);
    6464        hp_woo_rewards_points_number_input($points_earned);
    65         echo esc_html_e( ' Point(s) ', 'hp-woo-rewards' );
     65        echo esc_html_e( ' Point(s) ', 'hostplugin-woocommerce-points-reward' );
    6666    }
    6767   
     
    6969        $redeem_points = array('label_for' => 'redeem_points', 'value' => $args['redeem_points']);
    7070        hp_woo_rewards_points_number_input($redeem_points);
    71         echo esc_html_e( ' Point(s) ', 'hp-woo-rewards' );
     71        echo esc_html_e( ' Point(s) ', 'hostplugin-woocommerce-points-reward' );
    7272        echo ' = '.get_woocommerce_currency_symbol().' ';
    7373        $redeem_dollar = array('label_for' => 'redeem_dollar', 'value' => $args['redeem_dollar']);
     
    7878        $max_points_discount = array('label_for' => 'max_points_discount', 'value' => $args['max_points_discount']);
    7979        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');
    8181        hp_woo_rewards_points_select($max_points_discount_type);
    8282        hp_woo_premium_feature_only($args);
     
    100100
    101101           
    102             echo '<option value="'. $key .'" '. $selected .'>'. esc_attr( $value, 'hp-woo-rewards' ) .'</option>';
     102            echo '<option value="'. $key .'" '. $selected .'>'. esc_attr( $value, 'hostplugin-woocommerce-points-reward' ) .'</option>';
    103103        }
    104104
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/my_account.php

    r2072276 r2198541  
    66?>
    77
    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>
    1010<table class="woocommerce-orders-table woocommerce-MyAccount-orders shop_table shop_table_responsive my_account_orders account-orders-table">
    1111  <thead>
    1212    <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>
    1717        <th class="woocommerce-orders-table__header"><span class="nobr"><?php echo $point_name ?></span></th>
    1818    </tr>
     
    2424      <tr class="woocommerce-orders-table__row woocommerce-orders-table__row--status- order">
    2525          <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'); ?>
    2727          </td>
    2828          <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', 'hp-woo-rewards' ); ?></h2>
     1<h2><?php esc_html_e( 'Woo Rewards', 'hostplugin-woocommerce-points-reward' ); ?></h2>
    22<table class="form-table">
    33  <tbody><tr class="user-point-wrap">
    4     <th><label for="point"><?php esc_html_e( 'Total Points', 'hp-woo-rewards' ); ?></label></th>
     4    <th><label for="point"><?php esc_html_e( 'Total Points', 'hostplugin-woocommerce-points-reward' ); ?></label></th>
    55    <td>
    66      <?php
    77        $points = $this->points->get_customer_total_points($profileuser->ID);
    88      ?>
    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">
    1111    </td>
    1212  </tr>
     
    2222    <thead>
    2323    <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>
    2929    </tr>
    3030    </thead>
     
    6666    <tfoot>
    6767    <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>
    7373    </tr>
    7474    </tfoot>
Note: See TracChangeset for help on using the changeset viewer.