{"id":6267,"date":"2016-10-14T21:10:13","date_gmt":"2016-10-15T01:10:13","guid":{"rendered":"https:\/\/themespress.ca\/?p=6267"},"modified":"2022-09-07T20:52:20","modified_gmt":"2022-09-08T00:52:20","slug":"max-number-characters-woocommerce-filter","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/max-number-characters-woocommerce-filter\/","title":{"rendered":"Maximum number of Characters WooCommerce Filter"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>With this tutorial, we will force a number of characters in the Woocommerce ID: order_comments.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<h2 style=\"text-align: left\" class=\"vc_custom_heading vc_do_custom_heading\" >Maximum number of Characters WooCommerce Filter<\/h2>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>Add this filter to your <strong>functions.php<\/strong> file and then change the number 300 for the number of characters you want. This will force users to limit their message to the number of characters you&#8217;ll have set.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-1100878\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-1100878\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"standard\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Forcer max caraters div message commande \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nadd_filter( &#039;woocommerce_checkout_fields&#039;, &#039;themespress_checkout_fields&#039; );\nfunction themespress_checkout_fields( $fields ) {\n\t$fields[&#039;order&#039;][&#039;order_comments&#039;][&#039;maxlength&#039;] = 300;\n\treturn $fields;\n}<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p><a class=\"more\" href=\"https:\/\/docs.woocommerce.com\/document\/tutorial-customising-checkout-fields-using-actions-and-filters\/\" target=\"_blank\" rel=\"noopener\">Woocommerce Order Filters<\/a><\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"With this tutorial, we will force a number of characters in the Woocommerce ID: order_comments. Maximum number of Characters WooCommerce Filter Add this filter to your functions.php file and then<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/max-number-characters-woocommerce-filter\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":4545,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[328],"class_list":["post-6267","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-woocommerce-config"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/6267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=6267"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/6267\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/4545"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=6267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=6267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=6267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}