Home Forums WoodMart support forum Checkout field location

Checkout field location

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #113005

    jcbdesign
    Participant

    Hi,

    I’m trying to add an additional field to the checkout for a purchase order number. I can get the code below to work fine, but I can’t position it where I want. I’d like it in the location of “woocommerce_review_order_before_payment” but it doesn’t display and breaks that order summary. It will display in “woocommerce_before_checkout_billing_form” or “woocommerce_after_order_notes”. Or anywhere on the left hand side. Is there something in the theme that’s overriding the code? or am I missing something?

    Thanks again.
    Jon

    Code:
    /**
    * Add the field to the checkout
    */
    add_action( ‘woocommerce_before_checkout_billing_form’, ‘my_custom_checkout_field’ );

    function my_custom_checkout_field( $checkout ) {

    echo ‘<div id=”my_custom_checkout_field”>’;

    woocommerce_form_field( ‘my_field_name’, array(
    ‘type’ => ‘text’,
    ‘class’ => array(‘my-field-class form-row-wide’),
    ‘label’ => __(‘Purchase Order Number:‘),
    ‘placeholder’ => __(‘Enter you PO number here’),
    ), $checkout->get_value( ‘my_field_name’ ));

    echo ‘</div>’;

    }

    #113026

    Hello,

    Such an issue is beyond our support scope. Please try to search a plugin which would do what you want. You can delete the plugin easily without destroying the rest code if you decideю

    Bet Regards

    #113085

    jcbdesign
    Participant

    ok thanks

    #113113

    You are welcome! If you have any questions related to our theme please feel free to contact us.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)