Plugin Directory

Changeset 2072276


Ignore:
Timestamp:
04/22/2019 12:51:15 AM (7 years ago)
Author:
hostplugin
Message:

1.0.6

Location:
hostplugin-woocommerce-points-and-rewards/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • hostplugin-woocommerce-points-and-rewards/trunk/assets/js/admin_script.js

    r2018489 r2072276  
    1010    quicktags({
    1111        id: 'hp_woo_rewards_signup_message',
     12        buttons: 'bold,italic,red,blue,brown,black'
     13    });
     14    quicktags({
     15        id: 'hp_woo_rewards_review_message',
    1216        buttons: 'bold,italic,red,blue,brown,black'
    1317    });
     
    3943    $('#hp_woo_rewards_signup_points_role').select2();
    4044
     45    $('#hp_woo_rewards_review_points_role').select2();
     46
    4147    $('#hp_woo_reset_settings').on('click', function(event) {
    4248        if (!window.confirm("Are you sure you wish to reset the settings to defaults?")) {
  • hostplugin-woocommerce-points-and-rewards/trunk/hostplugin-woocommerce-points-rewards.php

    r2018489 r2072276  
    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.5
     9Version: 1.0.6
    1010Author: HostPlugin.com
    1111Author URI: http://www.hostplugin.com
     
    2626use \HPWooRewardsIncludes\Deactivation;
    2727use \HPWooRewardsIncludes\Product;
     28use \HPWooRewardsIncludes\Comments;
    2829use \HPWooRewardsIncludes\Upgrade;
    2930
     
    4344        public $cart_page;
    4445        public $admin_point_table;
     46        public $comments;
    4547
    4648        /**
     
    6264                $order_class = Helper::get_class_name("\HPWooRewardsIncludes\Order");
    6365                $account_class = Helper::get_class_name("\HPWooRewardsIncludes\Account");
     66                $comment_class = Helper::get_class_name("\HPWooRewardsIncludes\Comments");
    6467                self::$instance->product_page = new Product();
    6568                self::$instance->cart_page = new $cart_class();
    6669                self::$instance->order = new $order_class();
    6770                self::$instance->account = new $account_class();
     71                self::$instance->comments = new $comment_class();
    6872                self::$instance->admin = new Admin();
    6973                self::$instance->admin_settings = new $settings_class();
    70                 self::$instance->admin_point_table = new PointTable();
     74                self::$instance->admin_point_table = new PointTable();             
    7175                self::$instance->load_update_checker();
    7276            }
     
    8488        private function setup_constants() {
    8589            if ( ! defined( 'HOSTPLUGIN_WOO_POINTS_VERSION' ) ) {
    86                 define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1.0.5' );
     90                define( 'HOSTPLUGIN_WOO_POINTS_VERSION', '1.0.6' );
    8791            }
    8892
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Account.php

    r2018489 r2072276  
    2828      add_filter( 'query_vars', array($this, 'add_query_vars'), 0 );
    2929      add_filter( 'woocommerce_account_menu_items', array($this, 'add_link') );
    30       add_action( 'woocommerce_account_hp-woo-rewards-points_endpoint', array($this, 'add_reward_content') );
     30      add_action( 'woocommerce_account_hp-woo-rewards-points_endpoint', array($this, 'add_reward_content'), 999 );
    3131      add_action( 'wp_enqueue_scripts', array($this, 'add_frontend_script'), 999);
    3232      add_action( 'woocommerce_register_form_start', array($this, 'display_signup_points'), 10, 1 ); 
    3333      add_action( 'user_register', array($this, 'add_signup_points'), 10, 1 );
     34      add_filter( 'woocommerce_product_review_comment_form_args',array($this,'display_review_points_message'),10,1);
    3435    }//show rewards points only if point system is enabled
    3536  }
     
    9899
    99100  /**
     101   * Display review points message
     102   *
     103   * @since 1.0.6
     104   * @param obj $comment_data
     105   * @return obj $comment_data
     106   *
     107   */
     108  public function display_review_points_message($comment_data) {
     109
     110    error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for comment: '.print_r($comment_data, true));
     111
     112    $review_points = $this->points->get_review_points();
     113
     114    $message = Helper::get_settings_option('review_message');
     115    $values = array(
     116      'points_label'  => $this->points->point_name,
     117      'points'        => $review_points
     118    );
     119    $message = Helper::parse_customized_message($message, $values);
     120
     121    $html = '';
     122    if ($review_points > 0 && $comment_data && $comment_data['title_reply_before']) {
     123      $html .= '<div class="woocommerce-message" role="alert">';
     124      $html .= $message;
     125      $html .= '</div>';
     126      $comment_data['title_reply_before'] = $html . $comment_data['title_reply_before'];
     127    }
     128
     129    return $comment_data;
     130  }
     131 
     132
     133  /**
    100134   * Display how many points customer will earn when signing up a new account
    101135   *
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Admin/Settings.php

    r2018489 r2072276  
    7878
    7979        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");
    8084
    8185        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");
     
    126130            ));
    127131
    128         add_settings_field("signup_points", __("Signup Points: ", 'hp-woo-rewards').wc_help_tip('Customer 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_section',
     132        add_settings_field("max_points_discount", __("Maximum Points Discount").wc_help_tip('Set the maximum points discount can be redeemed in the cart. Leave blank to disable', false), 'hp_woo_rewards_points_field_max_points_discount', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',
     133            array(
     134                'label_for' => 'max_points_discount',
     135                'max_points_discount' => $option['max_points_discount'],
     136                'max_points_discount_type' => $option['max_points_discount_type'],
     137                'premium'   => true)
     138        );
     139
     140        add_settings_field("min_purchase_amount", __("Minimum Purchase Amount").wc_help_tip('Set the minimum purchase amount in the shopping cart in order to redeem points. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',
     141            array(
     142                'label_for' => 'min_purchase_amount',
     143                'value'     => $option['min_purchase_amount'],
     144                'money'     => true,
     145                'premium'   => true)
     146        );
     147
     148        /**********************************************************************/
     149        /* Signup Section */
     150        /**********************************************************************/
     151
     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',
    129153            array(
    130154                'label_for' => 'signup_points',
     
    134158
    135159        $role_options = Helper::get_roles(true);
    136         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_section',
     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',
    137161            array(
    138162                'label_for' => 'signup_points_role',
     
    145169        );
    146170
    147         add_settings_field("max_points_discount", __("Maximum Points Discount").wc_help_tip('Set the maximum points discount can be redeemed in the cart. Leave blank to disable', false), 'hp_woo_rewards_points_field_max_points_discount', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',
    148             array(
    149                 'label_for' => 'max_points_discount',
    150                 'max_points_discount' => $option['max_points_discount'],
    151                 'max_points_discount_type' => $option['max_points_discount_type'],
    152                 'premium'   => true)
    153         );
    154 
    155         add_settings_field("min_purchase_amount", __("Minimum Purchase Amount").wc_help_tip('Set the minimum purchase amount in the shopping cart in order to redeem points. Leave blank to disable', false), 'hp_woo_rewards_points_number_input', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_section',
    156             array(
    157                 'label_for' => 'min_purchase_amount',
    158                 'value'     => $option['min_purchase_amount'],
    159                 'money'     => true,
    160                 'premium'   => true)
     171        /**********************************************************************/
     172        /* Review Section */
     173        /**********************************************************************/
     174
     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',
     176            array(
     177                'label_for' => 'review_points',
     178                'value'     => $option['review_points']
     179            )
     180        );
     181
     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',
     183            array(
     184                'label_for' => 'max_review_points_for_user',
     185                'value'     => $option['max_review_points_for_user'],
     186                'premium'   => true
     187            )
     188        );
     189
     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',
     191            array(
     192                'label_for' => 'user_cannot_earn_points_for_reviewing_same_product',
     193                'value'     => $option['user_cannot_earn_points_for_reviewing_same_product'],
     194                'premium'   => true
     195                )
     196        );
     197
     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',
     199            array(
     200                'label_for' => 'review_points_role',
     201                'options'   => $role_options,
     202                'multiple'  => true,
     203                'id'        => 'hp_woo_rewards_review_points_role',
     204                'value'     => $option['review_points_role'],
     205                'premium'   => true
     206            )
    161207        );
    162208
     
    209255                'label_for' => 'signup_message',
    210256                'value'     => $option['signup_message'],
     257                'premium'   => true)
     258        );
     259
     260        add_settings_field("review_message", __("Add a Review message"), 'hp_woo_rewards_points_textarea', 'hp_woo_rewards_points_settings', 'hp_woo_rewards_points_message_section',
     261            array(
     262                'label_for' => 'review_message',
     263                'value'     => $option['review_message'],
    211264                'premium'   => true)
    212265        );
     
    269322        $defaults = Helper::get_default_settings();
    270323
    271         if ($_POST['hp_woo_reset_settings']) {
     324        if (isset($_POST['hp_woo_reset_settings'])) {
    272325            //reset to defaults
    273326            $validated = $defaults;
     
    282335        $validated['redeem_dollar'] = ((int)$input['redeem_dollar'] <= 0) ? 1: (int)$input['redeem_dollar'];
    283336        $validated['signup_points'] = ((int)$input['signup_points'] <= 0) ? '': (int)$input['signup_points'];
     337        $validated['review_points'] = ((int)$input['review_points'] <= 0) ? '': (int)$input['review_points'];
     338
    284339        $validated['min_purchase_amount'] = (int)$input['min_purchase_amount'];
    285340        if ($validated['min_purchase_amount'] == 0) $validated['min_purchase_amount'] = "";
     
    303358
    304359        $validated['signup_message'] = $defaults['signup_message'];
     360        $validated['review_message'] = $defaults['review_message'];
    305361        $validated['single_product_message'] = $defaults['single_product_message'];
    306362        $validated['cart_checkout_message'] = $defaults['cart_checkout_message'];
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Helper.php

    r2018489 r2072276  
    2020        'redeem_dollar'                     => '1',
    2121        'signup_points'                     => '50',
     22        'review_points'                     => '10',
     23        'max_review_points_for_user'        => '',
    2224        'min_purchase_amount'               => '10',
    2325        'max_points_discount'               => '',
     
    2830        'round_off'                         => 'nearest-integer',
    2931        'signup_points_role'                => array('customer'),
     32        'review_points_role'                => array('customer'),
     33        'user_cannot_earn_points_for_reviewing_same_product'    => 'on',
    3034        'disable_point_when_using_coupon'   => 'on',
    3135        'no_earn_point_when_using_coupon'   => 'on',
    3236        '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]',
    3338        'single_product_message'            => 'Purchase this product and earn [bold]{points} {points_label}[/bold]',
    3439        'cart_checkout_message'             => 'Complete your order and earn [bold]{points} {points_label}[/bold] for a discount on a future purchase',
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Points.php

    r1924295 r2072276  
    1818    const LOG_TYPE_PURCHASE_REWARDS = 1;            //(+)   receive purchase rewards
    1919    const LOG_TYPE_REDEEM_REWARDS = 2;              //(-)   redeem points
    20     const LOG_TYPE_SIGNUP_REWARDS = 3;              //(-)   get signup rewards
     20    const LOG_TYPE_SIGNUP_REWARDS = 3;              //(+)   get signup rewards
    2121    const LOG_TYPE_ADJUSTMENT_BY_SELLER = 4;        //(+/-) manually adjust by admin / seller
     22    const LOG_TYPE_REVIEW_REWARDS = 5;              //(+)   get review rewards
    2223
    2324  /**
     
    175176
    176177    /**
     178     * Get review points (points for reviewing 1 product) defined in the admin settings
     179     *
     180     * @since 1.0.6
     181     * @return mixed
     182     *
     183     */
     184    public function get_review_points() {
     185        if ((int)$this->option['review_points'] > 0)
     186            return (int)$this->option['review_points'];
     187
     188        return false;
     189    }
     190
     191    /**
    177192     * Add points details for a particular customer
    178193     *
     
    222237     * @param const $log_type
    223238     * @param int $order_id (optional)
     239     * @param int $product_id (optional)
    224240     * @return boolean
    225241     *
    226242     */
    227     protected function update_customer_points_details($customer_id = 0, $points_string = '', $note, $log_type, $order_id = null) {
     243    protected function update_customer_points_details($customer_id = 0, $points_string = '', $note, $log_type, $order_id = null, $comment_id = null) {
    228244        error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' Customer ID: '.$customer_id);
    229245
     
    235251            $detail = array(
    236252                'order_id'          => $order_id,
     253                'comment_id'        => $comment_id,
    237254                'date'              => $today_date,
    238255                'event'             => $note,
     
    309326     *
    310327     */
    311     protected function is_already_processed($order_id, $customer_id, $log_type) {
    312         error_log('HP-WOO-REWARDS: calling '.__FUNCTION__.' for order ID: '.$order_id.' and customer: '.$customer_id. ' for log type: '.$log_type);
     328    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);
    313330        $points_details = $this->get_customer_points_details($customer_id);
    314331        error_log('HP-WOO-REWARDS: points details: '.print_r($points_details, true));
    315332        foreach ($points_details as $detail) {
    316 
    317             if ( ($order_id == 0 || $detail['order_id'] == $order_id) &&  $detail['event_type'] == $log_type  ) {
    318                 error_log('HP-WOO-REWARDS: Already processed points: '. $detail['points'].' to customer account');
    319                 return (int)$detail['points'];
     333            if ($comment_id > 0) {
     334                //review type
     335                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                    return (int)$detail['points'];
     338                }
     339            }
     340            else {
     341                //other type
     342                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                    return (int)$detail['points'];
     345                }
    320346            }
    321347        }//foreach
     
    368394
    369395    /**
     396     * Add review points for customer
     397     *
     398     * @since 1.0.6
     399     * @param int $customer_id
     400     * @param int $review_points
     401     * @return void
     402     *
     403     */
     404    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
     407        if ($review_points > 0 && $this->is_already_processed(0, $customer_id, self::LOG_TYPE_REVIEW_REWARDS, $comment_id) === false) {
     408            $this->update_customer_points($customer_id, $review_points);
     409            $point_string = "+".$review_points;
     410
     411            $event = __('{points_label} earned for reviewing product', 'hp-woo-rewards');
     412            $this->update_customer_points_details($customer_id, $point_string, $event, self::LOG_TYPE_REVIEW_REWARDS, $order_id = null, $comment_id);
     413        }
     414    }
     415
     416    /**
    370417     * admin (or whoever can update points on admin side) update user points
    371418     *
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Product.php

    r1924295 r2072276  
    2727
    2828        if ($this->points->is_point_system_enabled() == true) {
    29             add_action( 'woocommerce_single_product_summary', array($this,'show_points'), 15 );
     29            //quick fix for theme Hotel Queen as it doesn't call woocommerce_single_product_summary
     30            $theme = wp_get_theme();
     31       
     32            if ( stripos($theme->name, 'Hotel Queen') !== false ) {
     33                add_action( 'hotel_booking_single_price', array($this,'show_points'), 15 );
     34            }
     35            else {
     36                add_action( 'woocommerce_single_product_summary', array($this,'show_points'), 15 );
     37            }
    3038        }
    3139    }
     
    8593        $message =Helper::parse_customized_message($message, $values);
    8694
    87         echo "<p>";
    88         echo $message;
    89         echo "</p>";
    90 
    9195        $customer_id = get_current_user_id();
    9296        $existing_points = $this->points->get_customer_total_points($customer_id);
  • hostplugin-woocommerce-points-and-rewards/trunk/includes/Upgrade.php

    r1949889 r2072276  
    3232            //if database version is less than 1.0.3
    3333            if (version_compare($db_version, '1.0.3', '<')) {
    34                 self::update_database_1();
     34                self::update_database_1_0_3();
     35            }
     36
     37            //if database version is less than 1.0.6
     38            if (version_compare($db_version, '1.0.6', '<')) {
     39                self::update_database_1_0_6();
    3540            }
    3641
     
    4348     * @return void
    4449     */
    45     public static function update_database_1() {
     50    public static function update_database_1_0_3() {
    4651        error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
    4752        $database_option = get_option( 'hp_woo_rewards_points_settings_option' );
     
    5762        }
    5863    }
     64
     65    /**
     66     * upgrade database for v1.0.6
     67     * @return void
     68     */
     69    public static function update_database_1_0_6() {
     70        error_log('HP-WOO-REWARDS: calling '.__FUNCTION__);
     71        $database_option = get_option( 'hp_woo_rewards_points_settings_option' );
     72        error_log('HP-WOO-REWARDS: Before update: '.print_r($database_option, true));
     73
     74        if (isset($database_option['review_points']) && !empty($database_option['review_points'])) {
     75            ;
     76        }
     77        else {
     78            $database_option['review_points'] = Helper::get_default_settings('review_points');         
     79        }
     80
     81        if (isset($database_option['review_points_role']) && !empty($database_option['review_points_role'])) {
     82            ;
     83        }
     84        else {
     85            $database_option['review_points_role'] = Helper::get_default_settings('review_points_role');
     86        }
     87
     88        if (isset($database_option['max_review_points_for_user']) && !empty($database_option['max_review_points_for_user'])) {
     89            ;
     90        }
     91        else {
     92            $database_option['max_review_points_for_user'] = Helper::get_default_settings('max_review_points_for_user');
     93        }
     94
     95        if (isset($database_option['user_cannot_earn_points_for_reviewing_same_product']) && !empty($database_option['user_cannot_earn_points_for_reviewing_same_product'])) {
     96            ;
     97        }
     98        else {
     99            $database_option['user_cannot_earn_points_for_reviewing_same_product'] = Helper::get_default_settings('user_cannot_earn_points_for_reviewing_same_product');
     100        }
     101
     102        error_log('HP-WOO-REWARDS: After update: '.print_r($database_option, true));
     103        update_option( 'hp_woo_rewards_points_settings_option', $database_option );
     104    }
    59105}
  • hostplugin-woocommerce-points-and-rewards/trunk/readme.txt

    r2018489 r2072276  
    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
    55Requires at least: 4.0.1
    6 Tested up to: 5.0.3
    7 Stable tag: 1.0.5
     6Tested up to: 5.1.1
     7Stable tag: 1.0.6
    88Requires PHP: 5.3.8
    99License: GPLv2 or later
     
    2121
    2222* Free Rewards Points System for WooCommerce
    23 * Reward points for product purchase & signup
     23* Reward points for product purchase, signup & product review
    2424* Define how many reward points can be earned for purchases
    2525* Define the value of points for discounts
     
    3434* Option to disable customers from earning points if coupons are use (Premium Feature)
    3535* Option to set which roles (Admins, Customers, Editors etc) can earn signup points (Premium Feature)
     36* Option to set maximum points for reviewing products (Premium Feature)
     37* Option to set which roles (Admins, Customers, Editors etc) can earn review points (Premium Feature)
     38* Option to disable rewarding points for reviewing the same product (Premium Feature)
    3639* Set the minimum purchase amount in order to redeem points (Premium Feature)
    3740* Completely control the maximum discount available when redeeming points (Premium Feature)
     
    8184== Changelog ==
    8285
     86= 1.0.6 =
     87Added feature - reward points for reviewing products
     88Added premium feature - Maximum review points one can get
     89Added premium feature - Option to disable points for reviewing the same product
     90Added premium feature - who can earn product review points
     91Fixed - Who can earn signup points not working when setting to All
     92Fixed - Signup points cannot be set to blank
     93Fixed - Sometimes points sidebar link not showing up on customer login area
     94Fixed - Points not showing up on theme: https://themeforest.net/item/hotelqueen-hotel-wordpress-theme/20466233 product page
     95
    8396= 1.0.5 =
    8497Added premium feature - ability to customize the color of the front-end messages
    8598Allow Admin Settings reset back to defaults
    86 Fixed Bug - Signup points cannot be set to blank
    8799
    88100= 1.0.4 =
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/admin_dashboard.php

    r1991977 r2072276  
    5151        <li>
    5252            <h2>Premium Version</h2>
    53             Our premium version provides more features and functionalities that gives you more control over your WooCommerce store! To get a copy of our premium version simply donate at least US$25 and we will email you the plugin zip file within 1 business day. <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>
     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>
    5454            <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    5555            <input type="hidden" name="cmd" value="_s-xclick">
     
    7878                - Option to remove points for refunded / cancelled orders<br>
    7979                - Option to return redeemed points for refunded / cancelled orders
     80        </li>
     81    </ul>
     82</section>
     83
     84<section>
     85    <ul>
     86        <li><img src="<?php echo HOSTPLUGIN_PLUGIN_URL; ?>/assets/images/review.png"></li>
     87        <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>
    8092        </li>
    8193    </ul>
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/my_account.php

    r1924295 r2072276  
    1313        <th class="woocommerce-orders-table__header"><span class="nobr">Date</span></th>
    1414        <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>
    1516        <th class="woocommerce-orders-table__header"><span class="nobr">Event</span></th>
    1617        <th class="woocommerce-orders-table__header"><span class="nobr"><?php echo $point_name ?></span></th>
     
    3839          </td>
    3940          <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-">
     41             <?php
     42              if (!empty($detail['comment_id'])) {
     43              $comment_url = get_comment_link( $detail['comment_id'] );
     44             ?>
     45             <a href="<?php echo $comment_url ?>">
     46               <?php echo _x( '#', 'hash before order number', 'woocommerce' ) . $detail['comment_id']; ?>
     47             </a>
     48             <?php
     49              }
     50             ?>
     51          </td>
     52          <td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-">
    4053            <?php echo $detail['event']?>
    4154          </td>
  • hostplugin-woocommerce-points-and-rewards/trunk/templates/user_points_details.php

    r1926469 r2072276  
    2222    <thead>
    2323    <tr>
    24         <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary">Date</th>
     24        <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary">Date</th>     
    2525      <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>
    2627      <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event">Event</th>
    2728      <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format">Points</th>
     
    3233
    3334      foreach ($purchase_details as $detail) {
     35
    3436        $detail['event'] = $this->points->parse_point_name($detail['event']);
    3537    ?>
     
    3941          <td class="log_order_id column-order_id">
    4042            <?php
    41             if (strlen($detail['order_id']) > 0) {
     43            if (isset($detail['order_id']) && strlen($detail['order_id']) > 0) {
    4244            ?>
    4345              <a href="<?php echo admin_url( 'post.php?post='.$detail['order_id'].'&action=edit');?>">#<?php echo $detail['order_id']?></a>
     46           <?php
     47            }
     48            ?>
     49          </td>
     50          <td class="log_comment_id column-comment_id">
     51            <?php
     52            if (isset($detail['comment_id']) && strlen($detail['comment_id']) > 0) {
     53            ?>
     54              <a href="<?php echo get_comment_link( $detail['comment_id'] );?>">#<?php echo $detail['comment_id']?></a>
    4455           <?php
    4556            }
     
    5768        <th scope="col" id="hp_woo_rewards_log_date" class="manage-column column-date column-primary">Date</th>
    5869      <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>
    5971      <th scope="col" id="hp_woo_rewards_log_event" class="manage-column column-event">Event</th>
    6072      <th scope="col" id="hp_woo_rewards_log_point" class="manage-column column-format">Points</th>
Note: See TracChangeset for help on using the changeset viewer.