Add 'woocommerce_create_account_default_checked' for #3098

This commit is contained in:
Coen Jacobs 2013-05-06 12:03:31 +02:00
parent f9300bad55
commit f03735d8f6
2 changed files with 6 additions and 3 deletions

View File

@ -167,6 +167,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
= 2.1 - x =
* Tweak - Searching for SKU in admin panel can also be done via lowercase 'sku:' instead of just 'SKU:'
* Tweak - Added filter to check the 'Create account' checkbox on checkout by default
* Fix - Cast term_id as int in product data write panel that will resolve issues with numerical attributes
* Refactor - Taken out Piwik integration, use http://wordpress.org/extend/plugins/woocommerce-piwik-integration/ from now on
* Refactor - Taken out ShareYourCart integration, use http://wordpress.org/extend/plugins/shareyourcart/ from now on

View File

@ -36,13 +36,15 @@ global $woocommerce;
<?php if ( ! is_user_logged_in() && $checkout->enable_signup ) : ?>
<?php if ( $checkout->enable_guest_checkout ) : ?>
<?php if ( $checkout->enable_guest_checkout ) {
$checked_value = ( true === $checkout->get_value('createaccount') || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) );
?>
<p class="form-row form-row-wide">
<input class="input-checkbox" id="createaccount" <?php checked($checkout->get_value('createaccount'), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label>
<input class="input-checkbox" id="createaccount" <?php checked( $checked_value, true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label>
</p>
<?php endif; ?>
<?php } ?>
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>