Support » Plugin: WooCommerce » How to add a shortcode to a checkout page field?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support RK

    (@riaanknoetze)

    Yeah, that’d take some custom achieve. I’d suggest getting in touch a web developer to look into that for you.

    I’ve used managed to get the function in the link above to work. But it doesn’t let the shortcode do its thing. It just shows the shortcode in the field. Hmmm…

    Plugin Contributor Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Unfortunately, since the WordPress 4.2.3 update, the basic shortcode no longer works in HTML attributes.

    It used to work like this:
    <input type="email" name="firstname" value="[urlparam param='FirstName']">

    Now it has to work like this:
    <input type="email" name="firstname" [urlparam attr="value" param='FirstName']>

    The WooCommerce field is:
    <input type="email" value="" autocomplete="email" placeholder="" id="billing_email" name="billing_email" class="input-text form-control ">

    So, I’d have to remove the “value” from the WooCommerce input first. I’ve scoured the documents to learn how to do this, but It seems to be beyond my understanding.

    Plugin Contributor Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    You can’t enter shortcodes in plain html like that. Need to use do_shortcode().

    Here is a guide on customizing checkout fields: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    I can’t help much further than that though. If you need to hire a developer, these links will help:

    http://jobs.wordpress.net/
    https://codeable.io/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add a shortcode to a checkout page field?’ is closed to new replies.