WordPress.org

Forums

WooCommerce - excelling eCommerce
Customizing WooCommerce checkout page (2 posts)

  1. TokerCoughin
    Member
    Posted 1 year ago #

    I'd like some help with customizing the functionality of my WooCommerce driven site. The link can be found here: http://seekoften.com/eCommerce/checkout

    My question is, What files / lines of code might I want to look at if I'd like to add another drop-down to the checkout form, and how do I go about adding items to the drop-down?

    Also, if I'd like to change the wording of "select a state" to be "select a province" ?

    I have already created a child-theme and placed the required WooCommerce template files within it. I have followed the guidelines outlines on this page : http://uploadwp.com/customizing-the-woocommerce-checkout-page/

    I have tried code like this already

    /** * Add the field to the checkout **/ add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');

    function my_custom_checkout_field( $checkout ) {

    echo '

    '.__('My Field').'

    '; woocommerce_form_field( 'my_field_name', array( 'type' => 'text', 'class' => array('my-field-class form-row-wide'), 'label' => _('Fill in this field'), 'placeholder' => _('Enter something'), ), $checkout->get_value( 'my_field_name' ));

    echo '';

    }

    I have been trying different lines of php in the functions.php but cannot accomplish what I'd like, can somebody please help me pin-point the required php to yield this result.

    http://wordpress.org/plugins/woocommerce/

  2. clickmac
    Member
    Posted 1 year ago #

    you can do something like

    $fields['billing']['billing_options'] = array(
        'label'       => __('Options', 'woocommerce'),
        'placeholder' => _x('', 'placeholder', 'woocommerce'),
        'required'    => false,
        'clear'       => false,
        'type'        => 'select',
        'class'       => array('own-css-name'),
        'options'     => array(
            'option_a' => __('option a', 'woocommerce' ),
            'option_b' => __('option b', 'woocommerce' )
            )
        );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    This is woocommerce docs for creating options
    http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    Or if its giving trouble you can try a plugin on wordpress for that
    http://wordpress.org/plugins/woocommerce-checkout-manager/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic