{"id":255,"date":"2020-03-13T17:27:38","date_gmt":"2020-03-13T17:27:38","guid":{"rendered":"http:\/\/www.texeltech.com\/?p=255"},"modified":"2020-03-13T17:30:51","modified_gmt":"2020-03-13T17:30:51","slug":"adding-field-in-woocommerce-registration-form-template","status":"publish","type":"post","link":"http:\/\/www.texeltech.com\/?p=255","title":{"rendered":"Adding Field in Woocommerce registration form template"},"content":{"rendered":"\n<p>You will find the template in plugin\/woocommerce\/templates\/my-account\/form-login.php and there are following hooks on there. <\/p>\n\n\n\n<ul><li>At the beginning of the form :  woocommerce_register_form_start <\/li><li>Before the register button : woocommerce_register_form<\/li><li>Adding something after the register button: woocommerce_register_form_end<\/li><\/ul>\n\n\n\n<p>add_action(&#8216;woocommerce_register_form_start&#8217;, &#8216;anis_add_something_beginning_form&#8217;);<\/p>\n\n\n\n<p>function  anis_add_something_beginning_form(){<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">woocommerce_form_field(\n\t\t'country_to_visit',\n\t\tarray(\n\t\t\t'type'        =&gt; 'text',\n\t\t\t'required'    =&gt; true, \/\/ just adds an \"*\"\n\t\t\t'label'       =&gt; 'Country you want to visit the most'\n\t\t),\n\t\t( isset($_POST['country_to_visit']) ? $_POST['country_to_visit'] : '' )\n\t);<\/pre>\n\n\n\n<p><br>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You will find the template in plugin\/woocommerce\/templates\/my-account\/form-login.php and there are following hooks on there. At the beginning of the form : woocommerce_register_form_start Before the register button : woocommerce_register_form Adding something after the register button: woocommerce_register_form_end&hellip;<\/p>\n","protected":false},"author":2,"featured_media":256,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/posts\/255"}],"collection":[{"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255"}],"version-history":[{"count":2,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":258,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions\/258"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=\/wp\/v2\/media\/256"}],"wp:attachment":[{"href":"http:\/\/www.texeltech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.texeltech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}