Created
March 9, 2011 23:40
-
-
Save loxK/863256 to your computer and use it in GitHub Desktop.
Patch for WP-e-commerce 3.8-developpement to enable users registration notice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: wpsc-includes/misc.functions.php | |
=================================================================== | |
--- wpsc-includes/misc.functions.php (révision 357938) | |
+++ wpsc-includes/misc.functions.php (copie de travail) | |
@@ -90,6 +90,11 @@ | |
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'wpsc' ), get_option( 'admin_email' ) ) ); | |
return $errors; | |
} | |
+ | |
+ if ( get_option('registration_notice') === '1' ) { | |
+ wp_new_user_notification($user_id, $user_pass); | |
+ } | |
+ | |
$credentials = array( 'user_login' => $user_login, 'user_password' => $user_pass, 'remember' => true ); | |
$user = wp_signon( $credentials ); | |
return $user; | |
@@ -769,4 +774,4 @@ | |
return; | |
} | |
-?> | |
\ No newline at end of file | |
+?> | |
Index: wpsc-admin/includes/settings-pages/checkout.php | |
=================================================================== | |
--- wpsc-admin/includes/settings-pages/checkout.php (révision 357938) | |
+++ wpsc-admin/includes/settings-pages/checkout.php (copie de travail) | |
@@ -56,6 +56,31 @@ | |
</td> | |
</tr> | |
+ <tr> | |
+ <td><?php _e('Send users a registration notice', 'wpsc'); ?>:</td> | |
+ <td> | |
+ <?php | |
+ $registration_notice = esc_attr( get_option('registration_notice') ); | |
+ $registration_notice1 = ""; | |
+ $registration_notice2 = ""; | |
+ switch($registration_notice) { | |
+ case 0: | |
+ $registration_notice2 = "checked ='checked'"; | |
+ break; | |
+ | |
+ case 1: | |
+ $registration_notice1 = "checked ='checked'"; | |
+ break; | |
+ } | |
+ ?> | |
+ <input type='radio' value='1' name='wpsc_options[registration_notice]' id='registration_notice1' <?php echo $registration_notice1; ?> /> <label for='require_register1'><?php _e('Yes', 'wpsc');?></label> | |
+ <input type='radio' value='0' name='wpsc_options[registration_notice]' id='registration_notice2' <?php echo $registration_notice2; ?> /> <label for='require_register2'><?php _e('No', 'wpsc');?></label> | |
+ </td> | |
+ <td> | |
+ <a title='<?php _e('If yes then you must also turn on the above option "Users must register before checking out"', 'wpsc');?>' class='flag_email' href='#' ><img src='<?php echo WPSC_CORE_IMAGES_URL; ?>/help.png' alt='' /> </a> | |
+ </td> | |
+ </tr> | |
+ | |
<tr> | |
<?php | |
$shippingBilling = get_option('shippingsameasbilling'); | |
@@ -230,4 +255,4 @@ | |
</form> | |
<?php | |
} | |
- ?> | |
\ No newline at end of file | |
+ ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment