/** * returns the class for shipping and billing forms * @access public * * @since 3.8 * @param $additional_classes (string) additional classes to be * @return */ function wpsc_the_checkout_details_class($additional_classes = '') { if (wpsc_is_shipping_details()) { echo "class='wpsc_shipping_forms " . $additional_classes . "'"; } else { echo "class='wpsc_billing_forms " . $additional_classes . "'"; } }
</td> </tr> <?php } ?> <?php if (wpsc_checkout_form_is_header() == true) { ?> <tr <?php echo wpsc_the_checkout_item_error_class(); ?> > <td <?php if (wpsc_is_shipping_details()) { echo "class='wpsc_shipping_forms'"; } ?> colspan='2'> <h4> <?php echo wpsc_checkout_form_name(); ?> </h4> </td> </tr> <?php } else { ?> <?php
/** * wpsc_display_form_fields() * * This function displays each of the form fields. * */ function wpsc_display_form_fields() { do_action('wpsc_start_display_user_log_form_fields'); $wpsc_checkout = wpsc_core_get_checkout(); $i = 0; while (wpsc_have_checkout_items()) { wpsc_the_checkout_item(); if (wpsc_checkout_form_is_header()) { $i++; // display headers for form fields ?> <?php if ($i > 1) { ?> </table> <table> <?php } ?> <tr class="checkout-heading-row <?php echo esc_attr(wpsc_the_checkout_item_error_class(false)); ?> "> <td <?php wpsc_the_checkout_details_class(); ?> colspan='2'> <h4><?php echo esc_html(wpsc_checkout_form_name()); ?> </h4> </td> </tr> <?php if (wpsc_is_shipping_details()) { ?> <tr class='same_as_shipping_row'> <td colspan='2'> <?php $checked = ''; $shipping_same_as_billing = wpsc_get_customer_meta('shippingSameBilling'); if ($shipping_same_as_billing) { $checked = 'checked="checked"'; } ?> <label for='shippingSameBilling'> <input type='checkbox' value='true' data-wpsc-meta-key="shippingSameBilling" class="wpsc-visitor-meta" name='shippingSameBilling' id='shippingSameBilling' <?php echo $checked; ?> /> <?php _e('Same as billing address:', 'wp-e-commerce'); ?> </label> <br> <span id="shippingsameasbillingmessage"><?php _e('Your orders will be shipped to the billing address', 'wp-e-commerce'); ?> </span> </td> </tr> <?php } // Not a header so start display form fields } elseif ($wpsc_checkout->checkout_item->unique_name == 'billingemail') { ?> <?php $email_markup = "<div class='wpsc_email_address'>\n <p class='" . wpsc_checkout_form_element_id() . "'>\n <label class='wpsc_email_address' for='" . wpsc_checkout_form_element_id() . "'>\n " . __('Enter your email address', 'wp-e-commerce') . "\n </label>\n <p class='wpsc_email_address_p'>\n <img src='https://secure.gravatar.com/avatar/empty?s=60&d=mm' id='wpsc_checkout_gravatar' />\n " . wpsc_checkout_form_field(); if (wpsc_the_checkout_item_error() != '') { $email_markup .= "<p class='validation-error'>" . wpsc_the_checkout_item_error() . "</p>"; } $email_markup .= "</div>"; } else { ?> <tr> <td class='<?php echo wpsc_checkout_form_element_id(); ?> '> <label for='<?php echo esc_attr(wpsc_checkout_form_element_id()); ?> '> <?php echo wpsc_checkout_form_name(); ?> </label> </td> <td> <?php echo wpsc_checkout_form_field(); ?> <?php if (wpsc_the_checkout_item_error() != '') { ?> <p class='validation-error'><?php echo wpsc_the_checkout_item_error(); ?> </p> <?php } ?> </td> </tr> <?php } //endif; ?> <?php } // end while ?> <?php }
<table class='wpsc_checkout_table'> <?php while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> <?php if(wpsc_is_shipping_details()) : ?> <tr> <td colspan ='2'> <br /> <input type='checkbox' value='true' name='shippingSameBilling' id='shippingSameBilling' /> <label for='shippingSameBilling'>Shipping Address same as Billing Address?</label> </td> </tr> <?php endif; ?> <?php if(wpsc_checkout_form_is_header() == true) : ?> <tr <?php echo wpsc_the_checkout_item_error_class();?>> <td <?php if(wpsc_is_shipping_details()) echo "class='wpsc_shipping_forms'"; ?> colspan='2'> <h4> <?php echo wpsc_checkout_form_name();?> </h4> </td> </tr> <?php else: ?> <?php if((!wpsc_uses_shipping()) && $wpsc_checkout->checkout_item->unique_name == 'shippingstate'): ?> <?php else : ?> <tr <?php echo wpsc_the_checkout_item_error_class();?>> <td> <label for='<?php echo wpsc_checkout_form_element_id(); ?>'> <?php echo wpsc_checkout_form_name();?> </label> </td> <td>
/** * wpsc_display_form_fields() * * This function displays each of the form fields. * */ function wpsc_display_form_fields() { do_action('wpsc_start_display_user_log_form_fields'); $wpsc_checkout = wpsc_core_get_checkout(); $i = 0; while (wpsc_have_checkout_items()) { wpsc_the_checkout_item(); if (wpsc_checkout_form_is_header()) { $i++; // display headers for form fields ?> <?php if ($i > 1) { ?> </table> <table> <?php } ?> <tr class="checkout-heading-row <?php echo esc_attr(wpsc_the_checkout_item_error_class(false)); ?> "> <td <?php wpsc_the_checkout_details_class(); ?> colspan='2'> <h4><?php echo esc_html(wpsc_checkout_form_name()); ?> </h4> </td> </tr> <?php if (wpsc_is_shipping_details()) { ?> <tr class='same_as_shipping_row'> <td colspan='2'> <?php $checked = ''; $shipping_same_as_billing = wpsc_get_customer_meta('shippingSameBilling'); if ($shipping_same_as_billing) { $checked = 'checked="checked"'; } ?> <label for='shippingSameBilling'> <input type='checkbox' value='true' data-wpsc-meta-key="shippingSameBilling" class="wpsc-visitor-meta" name='shippingSameBilling' id='shippingSameBilling' <?php echo $checked; ?> /> <?php _e('Same as billing address:', 'wp-e-commerce'); ?> </label> <br> <span id="shippingsameasbillingmessage"><?php _e('Your orders will be shipped to the billing address', 'wp-e-commerce'); ?> </span> </td> </tr> <?php } // Not a header so start display form fields } else { ?> <tr> <td class='<?php echo wpsc_checkout_form_element_id(); ?> '> <label for='<?php echo esc_attr(wpsc_checkout_form_element_id()); ?> '> <?php echo wpsc_checkout_form_name(); ?> </label> </td> <td> <?php echo wpsc_checkout_form_field(); ?> <?php if (wpsc_the_checkout_item_error() != '') { ?> <p class='validation-error'><?php echo wpsc_the_checkout_item_error(); ?> </p> <?php } ?> </td> </tr> <?php } //endif; ?> <?php } // end while ?> <?php }