Saturday, 8 June 2013

where is the data saved and how can i access it/ print it out in woocommerce fields

where is the data saved and how can i access it/ print it out in woocommerce fields

i have came across http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
these docs for woocommerce, and they shows you how to create a field using this piece of code
// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
     $fields['shipping']['shipping_phone'] = array(
        'label'     => __('Phone', 'woocommerce'),
    'placeholder'   => _x('Phone', 'placeholder', 'woocommerce'),
    'required'  => false,
    'class'     => array('form-row-wide'),
    'clear'     => true
     );

     return $fields;
}
now my question is, how do i access the data the customer entered in the placeholder (front-end), i would like to access it and print it out on the product page of woocommerce. Can anyone help me?

No comments:

Post a Comment