Administrators Nathan Posted December 11, 2013 Administrators Share Posted December 11, 2013 I'm trying to modify some wordpress files and I don't know what the "value" is called within a text area. $this->checkout_fields['order'] = array( 'order_comments' => array( 'type' => 'textarea', 'class' => array('notes'), 'label' => __( 'Order Notes', 'woocommerce' ), 'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') ) ); $this->checkout_fields = apply_filters( 'woocommerce_checkout_fields', $this->checkout_fields ); do_action( 'woocommerce_checkout_init', $this ); I need to put a value of a variable in that textarea. I tried the following code but it does nothing. $this->checkout_fields['order'] = array( 'order_comments' => array( 'type' => 'textarea', 'class' => array('notes'), 'label' => __( 'Order Notes', 'woocommerce' ), 'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') 'value' => $giftmsg ) ); $this->checkout_fields = apply_filters( 'woocommerce_checkout_fields', $this->checkout_fields ); do_action( 'woocommerce_checkout_init', $this ); Quote Link to comment Share on other sites More sharing options...
Administrators Nathan Posted December 11, 2013 Author Administrators Share Posted December 11, 2013 Aha! Looks like it called "default" whether that's html or the WordPress I'm unsure, but it's working now. $giftmsg = $_SESSION['giftmsg']; $this->checkout_fields['order'] = array( 'order_comments' => array( 'type' => 'textarea', 'class' => array('notes'), 'label' => __( 'Order Notes', 'woocommerce' ), 'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce'), 'default' => $giftmsg ) ); $this->checkout_fields = apply_filters( 'woocommerce_checkout_fields', $this->checkout_fields ); do_action( 'woocommerce_checkout_init', $this ); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.