Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Defaults customer meta for shipping same as billing.
- *
- * Means that by default we say that billing and shipping match so just hide the stuff
- * about shipping unless the user unselects the box.
- *
- * @author SFNdesign, Curtis McHale
- * @link sfndesign.ca
- *
- * @param null $value A null flag.
- * @param string $key The meta key being passed to the customer meta API.
- * @param int $id The current user/customer/visitor ID.
- * @return string|null The meta value, or null, if unmodified.
- */
- function elite_default_same_billing( $value, $key = '', $id = '' ) {
- remove_filter( 'wpsc_get_visitor_meta_shippingSameBilling', __FUNCTION__, 15 );
- $current_value = wpsc_get_customer_meta( 'shippingSameBilling' );
- add_filter( 'wpsc_get_visitor_meta_shippingSameBilling', __FUNCTION__, 15 );
- if ( '' !== $current_value ){
- } else {
- $value = 'on';
- }
- return $value;
- }
- add_filter( 'wpsc_get_visitor_meta_shippingSameBilling', 'elite_default_same_billing', 15, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement