{"id":1013507,"date":"2015-10-10T19:59:22","date_gmt":"2015-10-11T02:59:22","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/"},"modified":"2015-10-27T07:05:06","modified_gmt":"2015-10-27T14:05:06","slug":"want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/","title":{"rendered":"Want to change the label and placeholder text at checkout? Check this out!"},"content":{"rendered":"<p>At checkout, you have a section &#8220;Additional Information&#8221; and in there for order comments you have a label called: &#8220;Order Notes&#8221; and in there you have the placeholder it has the following text: &#8220;Notes about your order, e.g. special notes for delivery.&#8221;<\/p>\n<p>Now if you are selling tickets, that looks dumb. So in my case i want to make the following changes:<\/p>\n<p>I want &#8220;Additional Information&#8221; to say &#8220;Did you buy a ticket for a friend?&#8221;<br \/>\nI want &#8220;Order Notes&#8221; to say &#8220;Please enter your friends names that you purchased a ticket for&#8221;<br \/>\nI want &#8220;Notes about your order, e.g. special notes for delivery.&#8221; to say &#8220;Enter full name here..&#8221;<\/p>\n<p>I also want &#8220;Out of stock&#8221; to say &#8220;ALL TICKETS SOLD&#8221; for when all tickets are sold.<\/p>\n<p>The code:<\/p>\n<pre><code>\r\n    add_filter(&#039;gettext&#039;, &#039;translate_text&#039;);\r\n    add_filter(&#039;ngettext&#039;, &#039;translate_text&#039;);\r\n\r\n    function translate_text($translated) {\r\n    $translated = str_ireplace(&#039;Out of stock&#039;, &#039;ALL TICKETS SOLD&#039;, $translated);\r\n    $translated = str_ireplace(&#039;Additional Information&#039;, &#039;Did you buy a ticket for a friend?&#039;, $translated);\r\n    return $translated;\r\n    }\r\n\/\/ Hook in\r\nadd_filter( &#039;woocommerce_checkout_fields&#039; , &#039;custom_override_checkout_fields&#039; );\r\n \r\n\/\/ Our hooked in function - $fields is passed via the filter!\r\nfunction custom_override_checkout_fields( $fields ) {\r\n     $fields[&#039;order&#039;][&#039;order_comments&#039;][&#039;label&#039;] = &#039;Personalized Message&#039;;\r\n     $fields[&#039;order&#039;][&#039;order_comments&#039;][&#039;placeholder&#039;] = &#039;Add message here&#039;;\r\n     return $fields;\r\n}<\/code><\/pre>\n<p>Add this to your functions.php &#8211; It can be added at the bottom above the last line. Ideally you&#8217;d want to add it to your child theme functions.php<\/p>\n<p>Example of where you can place it:<\/p>\n<pre><code>\t\t$excerpt_length = fusion_get_theme_option( &#039;excerpt_length_blog&#039; );\r\n\r\n\t\t$sermon_content .= Avada()-&gt;blog-&gt;get_content_stripped_and_excerpted( $excerpt_length, $description );\r\n\t}\r\n\r\n\treturn $sermon_content;\r\n}\r\n\r\n    add_filter(&#039;gettext&#039;, &#039;translate_text&#039;);\r\n    add_filter(&#039;ngettext&#039;, &#039;translate_text&#039;);\r\n\r\n    function translate_text($translated) {\r\n    $translated = str_ireplace(&#039;Out of stock&#039;, &#039;ALL TICKETS SOLD&#039;, $translated);\r\n    $translated = str_ireplace(&#039;Additional Information&#039;, &#039;Did you buy a ticket for a friend?&#039;, $translated);\r\n    return $translated;\r\n    }\r\n\/\/ Hook in\r\nadd_filter( &#039;woocommerce_checkout_fields&#039; , &#039;custom_override_checkout_fields&#039; );\r\n \r\n\/\/ Our hooked in function - $fields is passed via the filter!\r\nfunction custom_override_checkout_fields( $fields ) {\r\n     $fields[&#039;order&#039;][&#039;order_comments&#039;][&#039;label&#039;] = &#039;Personalized Message&#039;;\r\n     $fields[&#039;order&#039;][&#039;order_comments&#039;][&#039;placeholder&#039;] = &#039;Add message here&#039;;\r\n     return $fields;\r\n}\r\n\r\n\/\/ Omit closing PHP tag to avoid &quot;Headers already sent&quot; issues.<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png\" alt=\"Final results\" \/><\/p>\n<p>Tell me i&#8217;m a rockstar? =p<\/p>\n","protected":false},"template":"","class_list":["post-1013507","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Want to change the label and placeholder text at checkout? Check this out! -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Want to change the label and placeholder text at checkout? Check this out! -\" \/>\n<meta property=\"og:description\" content=\"At checkout, you have a section &#8220;Additional Information&#8221; and in there for order comments you have a label called: &#8220;Order Notes&#8221; and in there you have the placeholder it has the following text: &#8220;Notes about your order, e.g. special notes for delivery.&#8221; Now if you are selling tickets, that looks dumb. So in my case [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-10-27T14:05:06+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/\",\"name\":\"Want to change the label and placeholder text at checkout? Check this out! -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png\",\"datePublished\":\"2015-10-11T02:59:22+00:00\",\"dateModified\":\"2015-10-27T14:05:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage\",\"url\":\"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png\",\"contentUrl\":\"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Want to change the label and placeholder text at checkout? Check this out!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Want to change the label and placeholder text at checkout? Check this out! -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/","og_locale":"en_US","og_type":"article","og_title":"Want to change the label and placeholder text at checkout? Check this out! -","og_description":"At checkout, you have a section &#8220;Additional Information&#8221; and in there for order comments you have a label called: &#8220;Order Notes&#8221; and in there you have the placeholder it has the following text: &#8220;Notes about your order, e.g. special notes for delivery.&#8221; Now if you are selling tickets, that looks dumb. So in my case [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/","article_modified_time":"2015-10-27T14:05:06+00:00","og_image":[{"url":"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/","name":"Want to change the label and placeholder text at checkout? Check this out! -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage"},"image":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage"},"thumbnailUrl":"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png","datePublished":"2015-10-11T02:59:22+00:00","dateModified":"2015-10-27T14:05:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#primaryimage","url":"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png","contentUrl":"http:\/\/singlesevents.melbourne\/images\/change_checkout_text.png"},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/want-to-change-the-label-and-placeholder-text-at-checkout-check-this-out\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Want to change the label and placeholder text at checkout? Check this out!"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1013507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1013507\/revisions"}],"predecessor-version":[{"id":1013613,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1013507\/revisions\/1013613"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1013507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}