{"id":660,"date":"2020-10-08T08:47:37","date_gmt":"2020-10-08T08:47:37","guid":{"rendered":"https:\/\/el.wordpress.org\/support\/topic\/checkbox-%cf%83%cf%84%ce%bf-woocommerce-%ce%bc%ce%b5-%ce%b5%ce%bc%cf%86%ce%ac%ce%bd%ce%b9%cf%83%ce%b7-%cf%80%ce%b5%ce%b4%ce%b9%cf%89%ce%bd\/"},"modified":"2020-10-08T08:47:37","modified_gmt":"2020-10-08T08:47:37","slug":"checkbox-%cf%83%cf%84%ce%bf-woocommerce-%ce%bc%ce%b5-%ce%b5%ce%bc%cf%86%ce%ac%ce%bd%ce%b9%cf%83%ce%b7-%cf%80%ce%b5%ce%b4%ce%b9%cf%89%ce%bd","status":"publish","type":"topic","link":"https:\/\/el.wordpress.org\/support\/topic\/checkbox-%cf%83%cf%84%ce%bf-woocommerce-%ce%bc%ce%b5-%ce%b5%ce%bc%cf%86%ce%ac%ce%bd%ce%b9%cf%83%ce%b7-%cf%80%ce%b5%ce%b4%ce%b9%cf%89%ce%bd\/","title":{"rendered":"Checkbox \u03c3\u03c4\u03bf Woocommerce \u03bc\u03b5 \u03b5\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c0\u03b5\u03b4\u03b9\u03c9\u03bd"},"content":{"rendered":"<p>\u0398\u03ad\u03bb\u03c9 \u03bd\u03b1 \u03b2\u03ac\u03bb\u03c9 \u03c3\u03c4\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c4\u03bf\u03c5 \u03c4\u03b1\u03bc\u03b5\u03af\u03bf\u03c5 \u03bc\u03bf\u03c5 \u03bc\u03b9\u03b1 \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae ckeckbox \u03b7 \u03bf\u03c0\u03bf\u03af\u03b1 \u03cc\u03c4\u03b1\u03bd \u03c4\u03b9\u03ba\u03ac\u03c1\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03bc\u03c6\u03b1\u03bd\u03af\u03b6\u03bf\u03bd\u03c4\u03b1\u03b9 3-4 \u03c0\u03b5\u03b4\u03af\u03b1 \u03b3\u03b9\u03b1 \u03c3\u03c5\u03bc\u03c0\u03bb\u03ae\u03c1\u03c9\u03c3\u03b7.<br \/>\n\u0395\u03c0\u03af\u03c3\u03b7\u03c2 \u03b5\u03c6\u03cc\u03c3\u03bf\u03bd \u03b1\u03c5\u03c4\u03ac \u03c4\u03b1 \u03c0\u03b5\u03b4\u03af\u03b1 \u03c3\u03c5\u03bc\u03c0\u03bb\u03b7\u03c1\u03c9\u03b8\u03bf\u03cd\u03bd, \u03b8\u03ad\u03bb\u03c9 \u03bd\u03b1 \u03b5\u03bc\u03c6\u03b1\u03bd\u03af\u03b6\u03bf\u03bd\u03c4\u03b1\u03b9 \u03bf\u03b9 \u03c4\u03b9\u03bc\u03ad\u03c2 \u03c4\u03bf\u03c5\u03c2 \u03c3\u03c4\u03bf email \u03c4\u03bf\u03c5 \u03c0\u03b5\u03bb\u03ac\u03c4\u03b7 \u03b1\u03bb\u03bb\u03ac \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b9\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b5\u03c2 \u03bc\u03bf\u03c5.<\/p>\n<p>\u03a8\u03ac\u03c7\u03bd\u03c9\u03bd\u03c4\u03b1\u03c2 \u03b2\u03c1\u03ae\u03ba\u03b1 \u03c4\u03bf\u03bd \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03bf functions.php \u03b1\u03bb\u03bb\u03ac \u03bc\u03cc\u03bd\u03bf \u03b3\u03b9\u03b1 \u03ad\u03bd\u03b1 \u03c0\u03b5\u03b4\u03af\u03bf \u03ba\u03b1\u03b9 \u03c7\u03c9\u03c1\u03af\u03c2 \u03c4\u03b7\u03bd \u03c4\u03b9\u03bc\u03ae \u03c4\u03bf\u03c5 \u03c0\u03b5\u03b4\u03af\u03bf\u03c5 \u03bd\u03b1 \u03b5\u03bc\u03c6\u03b1\u03bd\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03c3\u03c4\u03b7\u03bd \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1 \u03c0\u03bf\u03c5 \u03bb\u03b1\u03bc\u03b2\u03ac\u03bd\u03c9 \u03c3\u03c4\u03bf dashboard.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>add_action( &#8216;woocommerce_before_checkout_form&#8217;, &#8216;conditionally_show_hide_checkout_field&#8217; );<br \/>\nfunction conditionally_show_hide_checkout_field() {<br \/>\n    ?&gt;<br \/>\n    &lt;style&gt;<br \/>\n    p#new_billing_field_field.on { display:none !important; }<br \/>\n    &lt;\/style&gt;<\/p>\n<p>    &lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n    jQuery(function($){<br \/>\n        var a = &#8216;input#checkbox_trigger&#8217;,   b = &#8216;#new_billing_field_field&#8217;<\/p>\n<p>        $(a).change(function(){<br \/>\n            if ( $(this).prop(&#8216;checked&#8217;) === true &amp;&amp; $(b).hasClass(&#8216;on&#8217;) ) {<br \/>\n                $(b).show(function(){<br \/>\n                    $(b).css({&#8216;display&#8217;:&#8217;none&#8217;}).removeClass(&#8216;on&#8217;).show();<br \/>\n                });<br \/>\n            }<br \/>\n            else if ( $(this).prop(&#8216;checked&#8217;) !== true &amp;&amp; ! $(b).hasClass(&#8216;on&#8217;) ) {<br \/>\n                $(b).fadeOut(function(){<br \/>\n                    $(b).addClass(&#8216;on&#8217;)<br \/>\n                });<br \/>\n                $(b+&#8217; input&#8217;).val(&#8221;);<br \/>\n            }<br \/>\n        });<br \/>\n    });<br \/>\n    &lt;\/script&gt;<br \/>\n    &lt;?php<br \/>\n}<\/p>\n<p>add_filter( &#8216;woocommerce_checkout_fields&#8217;, &#8216;add_custom_checkout_fields&#8217; );<br \/>\nfunction add_custom_checkout_fields( $fields ) {<\/p>\n<p>    $fields[&#8216;billing&#8217;][&#8216;checkbox_trigger&#8217;] = array(<br \/>\n        &#8216;type&#8217;      =&gt; &#8216;checkbox&#8217;,<br \/>\n        &#8216;label&#8217;     =&gt; __(&#8216;Checkbox label&#8217;, &#8216;woocommerce&#8217;),<br \/>\n        &#8216;class&#8217;     =&gt; array(&#8216;form-row-wide&#8217;),<br \/>\n        &#8216;clear&#8217;     =&gt; true<br \/>\n    );<\/p>\n<p>    $fields[&#8216;billing&#8217;][&#8216;new_billing_field&#8217;] = array(<br \/>\n        &#8216;label&#8217;     =&gt; __(&#8216;New Billing Field Label&#8217;, &#8216;woocommerce&#8217;),<br \/>\n        &#8216;placeholder&#8217;   =&gt; _x(&#8216;New Billing Field Placeholder&#8217;, &#8216;placeholder&#8217;, &#8216;woocommerce&#8217;),<br \/>\n        &#8216;class&#8217;     =&gt; array(&#8216;form-row-wide on&#8217;),<br \/>\n        &#8216;clear&#8217;     =&gt; true<br \/>\n    );<\/p>\n<p>    return $fields;<br \/>\n}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n","protected":false},"template":"","class_list":["post-660","topic","type-topic","status-publish","hentry","topic-tag-checkbox","topic-tag-show_fields","topic-tag-woocommerce"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/el.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/el.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/el.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/el.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/660\/revisions"}],"wp:attachment":[{"href":"https:\/\/el.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}