{"id":53638,"date":"2021-02-10T17:54:47","date_gmt":"2021-02-11T00:54:47","guid":{"rendered":"https:\/\/help.foosales.com\/docs\/topics\/code-snippets\/"},"modified":"2026-09-11T02:24:30","modified_gmt":"2026-09-11T08:24:30","slug":"%ce%b1%cf%80%ce%bf%cf%83%cf%80%ce%ac%cf%83%ce%bc%ce%b1%cf%84%ce%b1-%ce%ba%cf%8e%ce%b4%ce%b9%ce%ba%ce%b1","status":"publish","type":"docs","link":"https:\/\/help.foosales.com\/el\/docs\/topics\/code-snippets\/","title":{"rendered":"\u0391\u03c0\u03bf\u03c3\u03c0\u03ac\u03c3\u03bc\u03b1\u03c4\u03b1 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1"},"content":{"rendered":"<p class=\"notice\">\u0391\u03c5\u03c4\u03cc \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1\u00a0<b>\u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf \u03c0\u03c1\u03bf\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1\u03c4\u03b9\u03c3\u03c4\u03ae<\/b> \u03ad\u03b3\u03b3\u03c1\u03b1\u03c6\u03bf. \u0395\u03ac\u03bd \u03b4\u03b5\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03b5\u03be\u03bf\u03b9\u03ba\u03b5\u03b9\u03c9\u03bc\u03ad\u03bd\u03bf\u03b9 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1\/\u03c0\u03c1\u03bf\u03c4\u03cd\u03c0\u03c9\u03bd \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7 \u03c0\u03b9\u03b8\u03b1\u03bd\u03ce\u03bd \u03c3\u03c5\u03b3\u03ba\u03c1\u03bf\u03cd\u03c3\u03b5\u03c9\u03bd, \u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b1\u03c0\u03b5\u03c5\u03b8\u03c5\u03bd\u03b8\u03b5\u03af\u03c4\u03b5 \u03c3\u03b5 \u03ad\u03bd\u03b1\u03bd \u03c0\u03c1\u03bf\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1\u03c4\u03b9\u03c3\u03c4\u03ae \u03c0\u03bf\u03c5 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03be\u03bf\u03b9\u03ba\u03b5\u03b9\u03c9\u03bc\u03ad\u03bd\u03bf\u03c2 \u03bc\u03b5 \u03c4\u03bf FooSales \u03ae\/\u03ba\u03b1\u03b9 \u03c4\u03bf WooCommerce. \u0391\u03c5\u03c4\u03ac \u03c4\u03b1 \u03b1\u03c0\u03bf\u03c3\u03c0\u03ac\u03c3\u03bc\u03b1\u03c4\u03b1 \u03c0\u03b1\u03c1\u03ad\u03c7\u03bf\u03bd\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03b5\u03c5\u03b3\u03ad\u03bd\u03b5\u03b9\u03b1 \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03bf\u03c1\u03af\u03b6\u03bf\u03bd\u03c4\u03b1\u03b9 \u03c9\u03c2 \u03c3\u03b7\u03bc\u03b5\u03af\u03bf \u03b5\u03ba\u03ba\u03af\u03bd\u03b7\u03c3\u03b7\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b2\u03bf\u03b7\u03b8\u03ae\u03c3\u03bf\u03c5\u03bd \u03c3\u03b5 \u03c4\u03c5\u03c7\u03cc\u03bd \u03b5\u03b9\u03b4\u03b9\u03ba\u03ad\u03c2 \u03b1\u03bd\u03ac\u03b3\u03ba\u03b5\u03c2 \u03c0\u03c1\u03bf\u03c3\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2. \u0394\u03b5\u03bd \u03b5\u03af\u03bc\u03b1\u03c3\u03c4\u03b5 \u03c3\u03b5 \u03b8\u03ad\u03c3\u03b7 \u03bd\u03b1 \u03c0\u03b1\u03c1\u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c5\u03c0\u03bf\u03c3\u03c4\u03ae\u03c1\u03b9\u03be\u03b7 \u03b3\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b1\u03c1\u03bc\u03bf\u03b3\u03ad\u03c2 \u03c3\u03c4\u03bf \u03c0\u03bb\u03b1\u03af\u03c3\u03b9\u03bf \u03c4\u03c9\u03bd <a href=\"https:\/\/www.foosales.com\/terms-of-service\/\" target=\"_blank\" rel=\"noopener\">\u038c\u03c1\u03bf\u03b9 \u03c7\u03c1\u03ae\u03c3\u03b7\u03c2<\/a>.<\/p>\n<h3>\u039a\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae \u03c4\u03b5\u03bb\u03ce\u03bd Square \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03bf\u03bb\u03bf\u03ba\u03bb\u03ae\u03c1\u03c9\u03c3\u03b7 \u03bc\u03b9\u03b1\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2<\/h3>\n<p>\u0395\u03ac\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03c0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf \u03b5\u03be\u03b1\u03b3\u03c9\u03b3\u03ae\u03c2 \u03c4\u03c1\u03af\u03c4\u03bf\u03c5 \u03bc\u03ad\u03c1\u03bf\u03c5\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b5\u03be\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b5\u03c2 \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03ac\u03b6\u03b5\u03c3\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03c2 \u03bc\u03b5 \u03c4\u03bf Square, \u03af\u03c3\u03c9\u03c2 \u03bd\u03b1 \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03c4\u03b1 \u03c4\u03ad\u03bb\u03b7 \u03c0\u03bf\u03c5 \u03b1\u03c6\u03b1\u03b9\u03c1\u03b5\u03af \u03c4\u03bf Square \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ae \u03c3\u03c4\u03b7\u03bd \u03b5\u03be\u03b1\u03b3\u03c9\u03b3\u03ae \u03c4\u03c9\u03bd \u03c0\u03c9\u03bb\u03ae\u03c3\u03b5\u03ce\u03bd \u03c3\u03b1\u03c2. \u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03ad\u03b3\u03b3\u03c1\u03b1\u03c6\u03bf \u03b2\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1\u03c2 \u03c0\u03b5\u03c1\u03b9\u03b5\u03af\u03c7\u03b5 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03c5\u03bc\u03ad\u03bd\u03c9\u03c2 \u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc\u03c3\u03c0\u03b1\u03c3\u03bc\u03b1 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03c0\u03bf\u03c4\u03cd\u03c0\u03c9\u03bd\u03b5 \u03c4\u03b9\u03c2 \u03b1\u03bc\u03bf\u03b9\u03b2\u03ad\u03c2 \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2 Square \u03c9\u03c2 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03bf\u03bb\u03bf\u03ba\u03bb\u03ae\u03c1\u03c9\u03c3\u03b7 \u03c4\u03b7\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2. \u0391\u03c5\u03c4\u03cc, \u03c9\u03c3\u03c4\u03cc\u03c3\u03bf, \u03b4\u03b5\u03bd \u03c5\u03c0\u03bf\u03c3\u03c4\u03ae\u03c1\u03b9\u03b6\u03b5 \u03b4\u03b9\u03b1\u03b9\u03c1\u03b5\u03bc\u03ad\u03bd\u03b5\u03c2 \u03c0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03c2 \u03ba\u03b1\u03b9 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03bf\u03c5 \u03cc\u03c4\u03b9 \u03b7 \u03b4\u03bf\u03bc\u03ae \u03c4\u03bf\u03c5 \u03c0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf\u03c5 1.40.0+ \u03ad\u03c7\u03b5\u03b9 \u03b1\u03bd\u03b1\u03b8\u03b5\u03c9\u03c1\u03b7\u03b8\u03b5\u03af \u03c0\u03bb\u03ae\u03c1\u03c9\u03c2, \u03c4\u03bf \u03b1\u03c0\u03cc\u03c3\u03c0\u03b1\u03c3\u03bc\u03b1 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03b4\u03b5\u03bd \u03b8\u03b1 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03c0\u03bb\u03ad\u03bf\u03bd. \u0397 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b9\u03ba\u03cc\u03c4\u03b7\u03c4\u03b1 \u03c0\u03bf\u03c5 \u03c0\u03b5\u03c1\u03b9\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03c3\u03c4\u03bf \u03b1\u03c0\u03cc\u03c3\u03c0\u03b1\u03c3\u03bc\u03b1 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03ad\u03c7\u03b5\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c4\u03b5\u03b8\u03b5\u03af \u03c3\u03c4\u03b7 \u03b2\u03b1\u03c3\u03b9\u03ba\u03ae \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03b9\u03ba\u03cc\u03c4\u03b7\u03c4\u03b1 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf\u03c5, \u03b7 \u03bf\u03c0\u03bf\u03af\u03b1 \u03c5\u03c0\u03bf\u03c3\u03c4\u03b7\u03c1\u03af\u03b6\u03b5\u03b9 \u03b5\u03c0\u03af\u03c3\u03b7\u03c2 \u03c0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03c2 \u03bc\u03b5 \u03b4\u03b9\u03b1\u03c7\u03c9\u03c1\u03b9\u03c3\u03bc\u03cc \u03ba\u03b1\u03b9 \u03b4\u03b9\u03ac\u03c6\u03bf\u03c1\u03b5\u03c2 \u03ba\u03b1\u03c4\u03b1\u03c3\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2 \u03c5\u03c0\u03bf\u03b2\u03bf\u03bb\u03ae\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2 \u03c3\u03c4\u03b7\u03bd \u03ad\u03ba\u03b4\u03bf\u03c3\u03b7 1.40.2 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf\u03c5<\/p>\n<p><strong>\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03c3\u03b7\u03bc\u03b5\u03b9\u03ce\u03c3\u03c4\u03b5<\/strong> \u03cc\u03c4\u03b9 \u03b1\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03c5\u03bc\u03ad\u03bd\u03c9\u03c2 \u03c0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03b1\u03c4\u03b5 \u03c4\u03bf \u03b1\u03c0\u03cc\u03c3\u03c0\u03b1\u03c3\u03bc\u03b1 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c3\u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf functions.php, \u03b8\u03b1 <strong>\u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03b1\u03c6\u03b1\u03b9\u03c1\u03ad\u03c3\u03b5\u03c4\u03b5<\/strong> \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c6\u03c5\u03b3\u03ae \u03ba\u03c1\u03af\u03c3\u03b9\u03bc\u03c9\u03bd \u03c3\u03c6\u03b1\u03bb\u03bc\u03ac\u03c4\u03c9\u03bd \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c5\u03c0\u03bf\u03b2\u03bf\u03bb\u03ae \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03b9\u03ce\u03bd \u03bc\u03ad\u03c3\u03c9 \u03c4\u03bf\u03c5 FooSales.<\/p>\n<p>\u039c\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b4\u03b9\u03b1\u03b2\u03ac\u03c3\u03b5\u03c4\u03b5 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b1 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03bf\u03bd \u03c4\u03c1\u03cc\u03c0\u03bf \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2 \u03c4\u03c9\u03bd \u03c4\u03b5\u03bb\u03ce\u03bd Square \u03c3\u03c4\u03bf <a href=\"https:\/\/help.foosales.com\/el\/%ce%ad%ce%b3%ce%b3%cf%81%ce%b1%cf%86%ce%b1\/%ce%b8%ce%ad%ce%bc%ce%b1%cf%84%ce%b1\/%cf%80%ce%bb%ce%b7%cf%81%cf%89%ce%bc%ce%ad%cf%82\/%cf%84%ce%b5%cf%84%cf%81%ce%ac%ce%b3%cf%89%ce%bd%ce%b7-%ce%b5%ce%bd%cf%83%cf%89%ce%bc%ce%ac%cf%84%cf%89%cf%83%ce%b7-%cf%80%ce%bb%ce%b7%cf%81%cf%89%ce%bc%cf%8e%ce%bd\/#capturing-processing-fees\">\u0388\u03b3\u03b3\u03c1\u03b1\u03c6\u03bf \u03b2\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b5\u03bd\u03c3\u03c9\u03bc\u03ac\u03c4\u03c9\u03c3\u03b7 \u03c0\u03bb\u03b7\u03c1\u03c9\u03bc\u03ce\u03bd Square<\/a>.<\/p>\n<h3>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03c3\u03b7\u03bc\u03b5\u03af\u03c9\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf FooSales \u03c3\u03c4\u03b1 email \u03c4\u03bf\u03c5 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03c4\u03bf\u03c5 WooCommerce.<\/h3>\n<p>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03bf \u03ba\u03bf\u03bc\u03bc\u03ac\u03c4\u03b9 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c3\u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2 <em>functions.php<\/em> \u03b1\u03bd \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03b7 \"\u03a3\u03b7\u03bc\u03b5\u03af\u03c9\u03c3\u03b7 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2\" \u03c0\u03bf\u03c5 \u03c0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03b1\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1 \u03c3\u03c4\u03bf FooSales \u03bd\u03b1 \u03b5\u03bc\u03c6\u03b1\u03bd\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03c3\u03c4\u03b1 emails \u03c4\u03bf\u03c5 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03c4\u03bf\u03c5 WooCommerce.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">add_action( &#039;woocommerce_email_order_meta&#039;, &#039;woo_add_order_notes_to_email&#039;, 10, 4 ),\r\n\r\nfunction woo_add_order_notes_to_email($order, $sent_to_admin, $plain_text, $email) {\r\n\r\n\tif ( isset($post-&amp;gt;ID) )\r\n\t\t$id = $post-&amp;gt;ID,\r\n\telse\r\n\t\t$id = $order-&amp;gt;ID,\r\n\r\n\r\n\tif ($sent_to_admin &amp;amp;&amp;amp; &#039;foosales_app&#039; === get_post_meta($id, &#039;_foosales_order_source&#039;, true)) {\r\n\t\t$args = array(\r\n\t\t\t&#039;order_id&#039; =&amp;gt; $id,\r\n\t\t\t&#039;type&#039; =&amp;gt; &#039;&#039;\r\n\t\t);\r\n\t\t\r\n\t\t$notes = wc_get_order_notes( $args ),\r\n\t\t\r\n\t\techo &#039;&lt;h2&gt;&#039; . __( &#039;&Sigma;&eta;&mu;&epsilon;&iota;\u03ce&sigma;&epsilon;&iota;&sigmaf; &pi;&alpha;&rho;&alpha;&gamma;&gamma;&epsilon;&lambda;\u03af&alpha;&sigmaf;&#039;, &#039;woocommerce&#039; ) . &#039;&lt;\/h2&gt;&#039;;\r\n\r\n\t\techo &#039;&lt;ul class=&quot;order_notes&quot;&gt;&#039;;\r\n\r\n\t\tif ( $notes ) {\r\n\t\t\t\t?&amp;gt;\r\n\t\t\t\t&lt;li&gt;\r\n\t\t\t\t\t&lt;div class=&quot;note_content&quot;&gt;\r\n\t\t\t\t\t\tcontent ) ) ); ?&amp;gt;\r\n\t\t\t\t\t&lt;\/div&gt;\r\n\t\t\t\t&lt;\/li&gt;\r\n\t\t\t\t&amp;lt;?php } else { echo &amp;#039;&lt;li&gt;&#039; . __( &#039;&Delta;&epsilon;&nu; &upsilon;&pi;\u03ac&rho;&chi;&omicron;&upsilon;&nu; &alpha;&kappa;\u03cc&mu;&alpha; &sigma;&eta;&mu;&epsilon;&iota;\u03ce&sigma;&epsilon;&iota;&sigmaf; &gamma;&iota;&alpha; &alpha;&upsilon;&tau;\u03ae &tau;&eta;&nu; &pi;&alpha;&rho;&alpha;&gamma;&gamma;&epsilon;&lambda;\u03af&alpha;.&#039;, &#039;woocommerce&#039; ) . &#039;&lt;\/li&gt;&#039;;\r\n\t\t}\r\n\r\n\t\techo &#039;&lt;\/ul&gt;&#039;;\r\n\t}\r\n}<\/pre>\n<h3>\u0391\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf FooSales \u03ba\u03b1\u03b9 \u03bf\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03c9\u03bc\u03ad\u03bd\u03bf email \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03b9\u03c3\u03c4\u03bf\u03c3\u03b5\u03bb\u03af\u03b4\u03b1<\/h3>\n<p>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03bf \u03ba\u03bf\u03bc\u03bc\u03ac\u03c4\u03b9 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c3\u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2 <em>functions.php<\/em> \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03b1\u03bd \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c4\u03ad\u03bb\u03bd\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc\u03bc\u03b1\u03c4\u03b1 \u03c4\u03bf \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 \u03b7\u03bb\u03b5\u03ba\u03c4\u03c1\u03bf\u03bd\u03b9\u03ba\u03bf\u03cd \u03c4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b5\u03af\u03bf\u03c5 \u039b\u03b5\u03c0\u03c4\u03bf\u03bc\u03ad\u03c1\u03b5\u03b9\u03b5\u03c2 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1\u03c2 \u03cc\u03c4\u03b1\u03bd \u03bc\u03b9\u03b1 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1 \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c4\u03b5\u03af\u03c4\u03b1\u03b9 \u03bc\u03ad\u03c3\u03c9 \u03c4\u03bf\u03c5 FooSales \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03c3\u03c4\u03ad\u03bb\u03bd\u03b5\u03c4\u03b5 \u03c4\u03bf \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 \u03b7\u03bb\u03b5\u03ba\u03c4\u03c1\u03bf\u03bd\u03b9\u03ba\u03bf\u03cd \u03c4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b5\u03af\u03bf\u03c5 \u039f\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5 \u03cc\u03c4\u03b1\u03bd \u03bc\u03b9\u03b1 \u03c0\u03b1\u03c1\u03b1\u03b3\u03b3\u03b5\u03bb\u03af\u03b1 \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c4\u03b5\u03af\u03c4\u03b1\u03b9 \u03bc\u03ad\u03c3\u03c9 \u03c4\u03bf\u03c5 front-end \u03c4\u03bf\u03c5 \u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf\u03cd \u03c3\u03b1\u03c2.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nadd_filter( &#039;woocommerce_email_enabled_customer_completed_order&#039;, &#039;is_foosales&#039;, 9999, 2 );\r\n\r\nfunction is_foosales($enabled, $order ) {\r\n\tif ( ! empty( $order ) &amp;&amp; &#039;foosales_app&#039; === $order-&gt;get_meta( &#039;_foosales_order_source&#039;, true ) ) {\r\n\t\treturn false;\r\n\t}\r\n\treturn $enabled;\r\n}\r\n\r\nadd_action( &#039;woocommerce_order_status_completed&#039;, &#039;send_invoice_on_completed&#039; );\r\nfunction send_invoice_on_completed( $order_id ) {\r\n\t$wc_order = wc_get_order($order_id);\r\n\tif ( ! empty( $wc_order ) &amp;&amp; &#039;foosales_app&#039; === $wc_order-&gt;get_meta( &#039;_foosales_order_source&#039;, true ) ) {\r\n\t\t$emails = WC()-&gt;mailer()-&gt;get_emails();\r\n    \t$emails&#x5B;&#039;WC_Email_Customer_Invoice&#039;]-&gt;trigger( $order_id );\r\n\t}\r\n    \r\n}<\/pre>\n<h3>Implement partial use for coupon codes<\/h3>\n<p>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03bf \u03ba\u03bf\u03bc\u03bc\u03ac\u03c4\u03b9 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c3\u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2 <em>functions.php<\/em> file if you want to enable the partial use of coupon codes. This means that if the coupon code amount is more than the total price of the items being purchased, then the amount owed would be 0 and the total price will be deducted from the coupon code amount so that there is credit left to be used in the future.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/\/ 1. Process coupon adjustments on active order completion\/processing\r\nadd_action( &#039;woocommerce_order_status_processing&#039;, &#039;adjust_partially_used_coupon_amount&#039;, 10, 1 );\r\nadd_action( &#039;woocommerce_order_status_completed&#039;, &#039;adjust_partially_used_coupon_amount&#039;, 10, 1 );\r\n\r\nfunction adjust_partially_used_coupon_amount( $order_id ) {\r\n    $order = wc_get_order( $order_id );\r\n    if ( ! $order ) {\r\n        return;\r\n    }\r\n\r\n    \/\/ Prevent code from running multiple times on the same order\r\n    if ( $order-&gt;get_meta( &#039;_coupon_amount_adjusted&#039; ) ) {\r\n        return;\r\n    }\r\n\r\n    $coupons = $order-&gt;get_coupons();\r\n    \r\n    foreach ( $coupons as $item ) {\r\n        $code   = $item-&gt;get_code();\r\n        $coupon = new WC_Coupon( $code );\r\n        \r\n        \/\/ Only target fixed cart discount coupons\r\n        if ( $coupon-&gt;get_id() &amp;&amp; $coupon-&gt;is_type( &#039;fixed_cart&#039; ) ) {\r\n            $coupon_original_amount = (float) $coupon-&gt;get_amount();\r\n            $discount_used          = (float) $item-&gt;get_discount();\r\n\r\n            if ( $coupon_original_amount &gt; $discount_used ) {\r\n                \/\/ PARTIAL USE: Reduce balance and restore 1 usage count so it stays active\r\n                $remaining_balance = $coupon_original_amount - $discount_used;\r\n                $coupon-&gt;set_amount( $remaining_balance );\r\n                \r\n                $usage_count = $coupon-&gt;get_usage_count();\r\n                if ( $usage_count &gt; 0 ) {\r\n                    $coupon-&gt;set_usage_count( $usage_count - 1 );\r\n                }\r\n                \r\n                $coupon-&gt;save();\r\n            } elseif ( $coupon_original_amount &gt; 0 &amp;&amp; abs( $coupon_original_amount - $discount_used ) &lt; 0.001 ) {\r\n                \/\/ FINAL USE: Full remaining balance spent. Set balance to 0.\r\n                \/\/ Leave usage_count alone so WooCommerce natural limits apply.\r\n                $coupon-&gt;set_amount( 0 );\r\n                $coupon-&gt;save();\r\n            }\r\n        }\r\n    }\r\n\r\n    \/\/ Mark order as processed so status changes don&#039;t re-trigger this logic\r\n    $order-&gt;update_meta_data( &#039;_coupon_amount_adjusted&#039;, &#039;yes&#039; );\r\n    $order-&gt;save();\r\n}\r\n\r\n\/\/ 2. Restore coupon balance if order is cancelled, refunded, or failed\r\nadd_action( &#039;woocommerce_order_status_cancelled&#039;, &#039;restore_partially_used_coupon_amount&#039;, 10, 1 );\r\nadd_action( &#039;woocommerce_order_status_refunded&#039;, &#039;restore_partially_used_coupon_amount&#039;, 10, 1 );\r\nadd_action( &#039;woocommerce_order_status_failed&#039;, &#039;restore_partially_used_coupon_amount&#039;, 10, 1 );\r\n\r\nfunction restore_partially_used_coupon_amount( $order_id ) {\r\n    $order = wc_get_order( $order_id );\r\n    if ( ! $order ) {\r\n        return;\r\n    }\r\n\r\n    \/\/ Only attempt restoration if the coupon was previously deducted on this order\r\n    if ( ! $order-&gt;get_meta( &#039;_coupon_amount_adjusted&#039; ) ) {\r\n        return;\r\n    }\r\n\r\n    \/\/ Prevent double-restoration if status changes between cancelled\/refunded\r\n    if ( $order-&gt;get_meta( &#039;_coupon_amount_restored&#039; ) ) {\r\n        return;\r\n    }\r\n\r\n    $coupons = $order-&gt;get_coupons();\r\n\r\n    foreach ( $coupons as $item ) {\r\n        $code   = $item-&gt;get_code();\r\n        $coupon = new WC_Coupon( $code );\r\n\r\n        if ( $coupon-&gt;get_id() &amp;&amp; $coupon-&gt;is_type( &#039;fixed_cart&#039; ) ) {\r\n            $current_balance  = (float) $coupon-&gt;get_amount();\r\n            $discount_applied = (float) $item-&gt;get_discount();\r\n\r\n            if ( $discount_applied &gt; 0 ) {\r\n                $restored_balance = $current_balance + $discount_applied;\r\n                $coupon-&gt;set_amount( $restored_balance );\r\n\r\n                \/\/ If coupon was completely depleted (0) and is now restored, reduce usage count so it reactivates\r\n                if ( $current_balance == 0 &amp;&amp; $restored_balance &gt; 0 ) {\r\n                    $usage_count = $coupon-&gt;get_usage_count();\r\n                    if ( $usage_count &gt; 0 ) {\r\n                        $coupon-&gt;set_usage_count( $usage_count - 1 );\r\n                    }\r\n                }\r\n\r\n                $coupon-&gt;save();\r\n            }\r\n        }\r\n    }\r\n\r\n    \/\/ Mark order meta as restored\r\n    $order-&gt;update_meta_data( &#039;_coupon_amount_restored&#039;, &#039;yes&#039; );\r\n    $order-&gt;save();\r\n}\r\n<\/pre>\n<h3>Hide WooCommerce Point of Sale Settings<\/h3>\n<p>\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03c4\u03bf \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03bf \u03ba\u03bf\u03bc\u03bc\u03ac\u03c4\u03b9 \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03c3\u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2 <em>functions.php<\/em> file if you want to hide the <a href=\"https:\/\/woocommerce.com\/document\/configuring-woocommerce-settings\/#point-of-sale\" target=\"_blank\" rel=\"noopener\">Point of Sale settings<\/a> added by WooCommerce as of version 11.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/\/ Remove the built-in WooCommerce Point of Sale settings tab.\r\nadd_filter( &#039;woocommerce_settings_tabs_array&#039;, &#039;remove_wc_pos_settings_tab&#039;, 999, 1 );\r\nfunction remove_wc_pos_settings_tab( $tabs ) {\r\n    if ( isset( $tabs&#x5B;&#039;point-of-sale&#039;] ) ) {\r\n        unset( $tabs&#x5B;&#039;point-of-sale&#039;] );\r\n    }\r\n\r\n    return $tabs;\r\n}\r\n\r\n\/\/ Remove the All Sales Channels filter on the Orders page.\r\nadd_action( &#039;admin_head&#039;, &#039;hide_sales_channel_order_filter&#039; );\r\nfunction hide_sales_channel_order_filter() {\r\n    $screen = get_current_screen();\r\n    \/\/ Target the WooCommerce orders listing screen\r\n    if ( isset( $screen-&gt;id ) &amp;&amp; ( $screen-&gt;id === &#039;woocommerce_page_wc-orders&#039; || $screen-&gt;id === &#039;edit-shop_order&#039; ) ) {\r\n        echo &#039;&lt;style&gt;\r\n            select&#x5B;name=&quot;_created_via&quot;],\r\n            #sales_channel { \r\n                display: none !important; \r\n            }\r\n        &lt;\/style&gt;&#039;;\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>","protected":false},"featured_media":0,"parent":14,"menu_order":20,"comment_status":"open","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_is_vendor_doc":"0","footnotes":""},"doc_tag":[],"class_list":["post-53638","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/53638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/comments?post=53638"}],"version-history":[{"count":5,"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/53638\/revisions"}],"predecessor-version":[{"id":56621,"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/53638\/revisions\/56621"}],"up":[{"embeddable":true,"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/14"}],"next":[{"title":"\u03a6\u03b9\u03bb\u03bf\u03be\u03b5\u03bd\u03af\u03b1","link":"https:\/\/help.foosales.com\/el\/docs\/topics\/hosting\/","href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/55967"}],"prev":[{"title":"\u039f\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c7\u03ac\u03c1\u03c4\u03b7\u03c2 FooSales","link":"https:\/\/help.foosales.com\/el\/docs\/topics\/foosales-roadmap\/","href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/docs\/34"}],"wp:attachment":[{"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/media?parent=53638"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.foosales.com\/el\/wp-json\/wp\/v2\/doc_tag?post=53638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}