Plugin Directory

Changeset 1823612


Ignore:
Timestamp:
02/16/2018 10:49:06 PM (8 years ago)
Author:
reality66
Message:

Update to version 2.1.1

Location:
cart66-cloud/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cart66-cloud/trunk/cart66-cloud.php

    r1815908 r1823612  
    44Plugin URI: http://cart66.com
    55Description: Secure Ecommerce For WordPress.
    6 Version: 2.1.0
     6Version: 2.1.1
    77Author: Reality66
    88Author URI: http://www.reality66.com
  • cart66-cloud/trunk/includes/admin/class-cc-admin-review-settings.php

    r1815908 r1823612  
    3333            [
    3434                'show_reviews' => 'approved',
    35                 'review_thank_you' => 'Thank you for submitting your review.'
     35                'review_thank_you' => 'Thank you for submitting your review.',
     36                'notify_emails' => ''
    3637            ]
    3738        );
     
    5152        $reviews_section->add_field( $show_reviews );
    5253
    53         // Add start markup wrapper box
     54        // Add review thank you message textarea
    5455        $review_thank_you_msg = $option_values[ 'review_thank_you' ];
    5556        $review_thanks = new CC_Admin_Settings_Text_Area( __('Thank you message', 'cart66'), 'review_thank_you', $review_thank_you_msg );
    5657        $review_thanks->description = __( 'The message shown to the customer after new a review is submitted.', 'cart66' );
    5758        $reviews_section->add_field( $review_thanks );
     59
     60        // Add email notification box
     61        $email = $option_values[ 'notify_emails' ];
     62        $emails = new CC_Admin_Settings_Text_Field( __('Email Notifications', 'cart66'), 'notify_emails', $email );
     63        $emails->description = __( 'Get an email when a new review is submitted. <br>Leave blank if you do not want to receive an email notification.<br>You can list multiple email address separated by commas like this:<br>one@email.com, two@email.com', 'cart66' );
     64        $reviews_section->add_field( $emails );
    5865
    5966        // Add Post Type section to the main settings
  • cart66-cloud/trunk/includes/class-cart66-cloud.php

    r1815908 r1823612  
    2525        define( 'CC_URL',  WP_PLUGIN_URL . '/' . $plugin_dir . '/' );
    2626        define( 'CC_TEMPLATE_DEBUG_MODE', false );
    27         define( 'CC_VERSION_NUMBER', '2.1.0' );
     27        define( 'CC_VERSION_NUMBER', '2.1.1' );
    2828    }
    2929
  • cart66-cloud/trunk/includes/class-cc-cart.php

    r1815908 r1823612  
    188188    public static function item_count() {
    189189        self::load_summary();
    190         return self::$cart_summary->item_count > 0 ? self::$cart_summary->item_count : 0;
     190
     191        $item_count = 0;
     192
     193        if( is_object( self::$cart_summary ) ) {
     194            $item_count = self::$cart_summary->item_count > 0 ? self::$cart_summary->item_count : 0;
     195        }
     196
     197        return $item_count;
    191198    }
    192199
  • cart66-cloud/trunk/includes/class-cc-product-review.php

    r1815908 r1823612  
    3232    }
    3333
    34     public function ajax_save_review() {
     34    public static function ajax_save_review() {
    3535
    3636        // Validate the reCAPTCHA if it is enabeled before saving the reivew
     
    6767        $post_id = wp_insert_post( $post_data );
    6868
     69        if ( $post_id ) {
     70            self::send_email_notification( $review );
     71        }
     72
    6973        CC_Log::write( "Created new customer review post: $post_id" );
    7074        echo $post_id;
     
    7377    }
    7478
     79    public static function send_email_notification( $review ) {
     80
     81        $recipients = CC_Admin_Setting::get_option('cart66_review_settings', 'notify_emails', false);
     82
     83        $from = get_bloginfo('admin_email');
     84        $subject = 'New Product Review';
     85        $body = 'Rating: ' . $review['rating'] . "\nName: " . $review['name'];
     86        $body .= "\nEmail: " . $review['email'] . "\nSKU: " . $review['sku'];
     87        $body .= "\n\n" . $review['title'] ."\n\n" . $review['content'];
     88
     89        $headers = ['From: ' . $review['name'] . "<$from>"];
     90
     91        $recipients = explode( ',', $recipients );
     92
     93        foreach ( $recipients as $to ) {
     94            $to = trim( $to );
     95            wp_mail( $to, $subject, $body, $headers );
     96        }
     97    }
     98
    7599}
  • cart66-cloud/trunk/readme.txt

    r1815908 r1823612  
    66Requires PHP: 5.4
    77Tested up to: 4.9
    8 Stable tag: 2.1.0
     8Stable tag: 2.1.1
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    139139== Changelog ==
    140140
     141= 2.1.1 =
     142
     143- New: Send email notifcations when new reviews are submitted
     144- Update: Cleaned up a few PHP notices
     145
    141146= 2.1.0 =
    142147
Note: See TracChangeset for help on using the changeset viewer.