Changeset 1823612
- Timestamp:
- 02/16/2018 10:49:06 PM (8 years ago)
- Location:
- cart66-cloud/trunk
- Files:
-
- 6 edited
-
cart66-cloud.php (modified) (1 diff)
-
includes/admin/class-cc-admin-review-settings.php (modified) (2 diffs)
-
includes/class-cart66-cloud.php (modified) (1 diff)
-
includes/class-cc-cart.php (modified) (1 diff)
-
includes/class-cc-product-review.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cart66-cloud/trunk/cart66-cloud.php
r1815908 r1823612 4 4 Plugin URI: http://cart66.com 5 5 Description: Secure Ecommerce For WordPress. 6 Version: 2.1. 06 Version: 2.1.1 7 7 Author: Reality66 8 8 Author URI: http://www.reality66.com -
cart66-cloud/trunk/includes/admin/class-cc-admin-review-settings.php
r1815908 r1823612 33 33 [ 34 34 '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' => '' 36 37 ] 37 38 ); … … 51 52 $reviews_section->add_field( $show_reviews ); 52 53 53 // Add start markup wrapper box54 // Add review thank you message textarea 54 55 $review_thank_you_msg = $option_values[ 'review_thank_you' ]; 55 56 $review_thanks = new CC_Admin_Settings_Text_Area( __('Thank you message', 'cart66'), 'review_thank_you', $review_thank_you_msg ); 56 57 $review_thanks->description = __( 'The message shown to the customer after new a review is submitted.', 'cart66' ); 57 58 $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 ); 58 65 59 66 // Add Post Type section to the main settings -
cart66-cloud/trunk/includes/class-cart66-cloud.php
r1815908 r1823612 25 25 define( 'CC_URL', WP_PLUGIN_URL . '/' . $plugin_dir . '/' ); 26 26 define( 'CC_TEMPLATE_DEBUG_MODE', false ); 27 define( 'CC_VERSION_NUMBER', '2.1. 0' );27 define( 'CC_VERSION_NUMBER', '2.1.1' ); 28 28 } 29 29 -
cart66-cloud/trunk/includes/class-cc-cart.php
r1815908 r1823612 188 188 public static function item_count() { 189 189 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; 191 198 } 192 199 -
cart66-cloud/trunk/includes/class-cc-product-review.php
r1815908 r1823612 32 32 } 33 33 34 public function ajax_save_review() {34 public static function ajax_save_review() { 35 35 36 36 // Validate the reCAPTCHA if it is enabeled before saving the reivew … … 67 67 $post_id = wp_insert_post( $post_data ); 68 68 69 if ( $post_id ) { 70 self::send_email_notification( $review ); 71 } 72 69 73 CC_Log::write( "Created new customer review post: $post_id" ); 70 74 echo $post_id; … … 73 77 } 74 78 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 75 99 } -
cart66-cloud/trunk/readme.txt
r1815908 r1823612 6 6 Requires PHP: 5.4 7 7 Tested up to: 4.9 8 Stable tag: 2.1. 08 Stable tag: 2.1.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 139 139 == Changelog == 140 140 141 = 2.1.1 = 142 143 - New: Send email notifcations when new reviews are submitted 144 - Update: Cleaned up a few PHP notices 145 141 146 = 2.1.0 = 142 147
Note: See TracChangeset
for help on using the changeset viewer.