{"id":24,"date":"2022-05-21T10:54:55","date_gmt":"2022-05-21T08:54:55","guid":{"rendered":"http:\/\/demo.themegrill.com\/freedom\/?p=24"},"modified":"2022-05-30T14:40:02","modified_gmt":"2022-05-30T12:40:02","slug":"dotaznik_spokojnosti","status":"publish","type":"post","link":"https:\/\/www.areaweb.sk\/cs\/dotaznik_spokojnosti\/","title":{"rendered":"\u010eakovn\u00e1 str\u00e1nka a dotazn\u00edk pri objedn\u00e1vke"},"content":{"rendered":"<div>\n<div>Odpor\u00fa\u010dam skop\u00edrova\u0165 cel\u00fd prie\u010dinok z woocomerce\/templates\u00a0 do child-t\u00e9my aby sa \u00fapravy zachovali aj pri aktualiz\u00e1ci\u00ed pluginu<br \/>Ak nem\u00e1te child t\u00e9mu tak si ju treba vytvori\u0165. \u010eal\u0161ia mo\u017enos\u0165 je pou\u017ei\u0165 include alebo requiere pre vlo\u017eenie k\u00f3du z inej lokality.<br \/><br \/><br \/><\/div>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Woocomerce dotazn\u00edk na thank_you page ktor\u00fd sa zobraz\u00ed pri objedn\u00e1vke<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ woocomerce dotaznik na thank_you page ktor&yacute; sa zobraz&iacute; pri objedn&aacute;vke\n\nadd_action( &#039;woocommerce_thankyou&#039;, &#039;ppp_poll_form&#039;, 4 );\nfunction ppp_poll_form( $order_id ) {\n&nbsp; &nbsp; echo &#039;&lt;h2&gt;Ohodno\u0165te V&aacute;&scaron; n&aacute;kup&lt;\/h2&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;form id=&quot;thankyou_form&quot; action=&quot;&quot;&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;like&quot; value=&quot;Super&quot;&gt; Super&lt;\/label&gt;&lt;br&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;like&quot; value=&quot;Dobre&quot;&gt; Dobr&eacute; &lt;\/label&gt;&lt;br&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;like&quot; value=&quot;Mohlo to by\u0165 lep&scaron;ie&quot;&gt; Mohlo to by\u0165 lep&scaron;ie&lt;\/label&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;collect_feedback&quot; \/&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;order_id&quot; value=&quot;&#039; . $order_id . &#039;&quot; \/&gt;\n&nbsp; &nbsp; &nbsp; &nbsp; &#039; . wp_nonce_field( &#039;thankyou&#039;.$order_id, &#039;thankyou_nonce&#039;, true, false ) . &#039;\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; name=&quot;trp-form-language&quot; value=&quot;cs&quot;\/&gt;&lt;\/form&gt;&lt;br&gt;&lt;br&gt;&#039;;\n\n\n}\nadd_action( &#039;wp_footer&#039;, &#039;ppp_send_thankyou_ajax&#039; );\nfunction ppp_send_thankyou_ajax(){\n&nbsp; &nbsp; \/\/ exit if we are not on the Thank You page\n&nbsp; &nbsp; if( !is_wc_endpoint_url( &#039;order-received&#039; ) ) return;\n&nbsp; &nbsp; echo &quot;&lt;script&gt;\n&nbsp; &nbsp; jQuery( function( $ ) {\n&nbsp; &nbsp; &nbsp; &nbsp; $(&#039;input[type=radio][name=like]&#039;).change(function() {\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.ajax({\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: &#039;&quot; . admin_url(&#039;admin-ajax.php&#039;) . &quot;&#039;,\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: &#039;POST&#039;,\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: $(&#039;#thankyou_form&#039;).serialize(),\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beforeSend : function( xhr ){\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&#039;#thankyou_form&#039;).html(&#039;\u010eakujeme za V&aacute;&scaron; n&aacute;zor!&#039;);\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success : function( data ){\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log( data );\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });\n&nbsp; &nbsp; &nbsp; &nbsp; });\n&nbsp; &nbsp; });\n&nbsp; &nbsp; &lt;\/script&gt;&quot;;\n}\nadd_action( &#039;wp_ajax_collect_feedback&#039;, &#039;ppp_thankyou_ajax&#039; ); \/\/ wp_ajax_{ACTION}\nadd_action( &#039;wp_ajax_nopriv_collect_feedback&#039;, &#039;ppp_thankyou_ajax&#039; );\nfunction ppp_thankyou_ajax(){\n&nbsp; &nbsp; \/\/ security check\n&nbsp; &nbsp; check_ajax_referer( &#039;thankyou&#039;.$_POST[&#039;order_id&#039;], &#039;thankyou_nonce&#039; );\n&nbsp; &nbsp; if( $order = wc_get_order( $_POST[&#039;order_id&#039;] ) ) {\n&nbsp; &nbsp; &nbsp; &nbsp; $note = $order-&gt;get_formatted_billing_full_name() . &#039; Z&aacute;kazn&iacute;k hodnot&iacute; obchod ako &#039; . $_POST[&#039;like&#039;] . &#039;.&#039;;\n&nbsp; &nbsp; &nbsp; &nbsp; $order-&gt;add_order_note( $note, 0, true );\n&nbsp; &nbsp; }\n\n\n&nbsp; &nbsp; die();\n}<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Pri \u00faprave thankyou page sa V\u00e1m z\u00eddu aj tieto pr\u00edkazy z objedn\u00e1vky:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Get an instance of the WC_Order Object from the Order ID (if required)\r\n$order = wc_get_order( $order_id );\r\n\r\n\/\/ Get the Customer ID (User ID)\r\n$customer_id = $order->get_customer_id(); \/\/ Or $order->get_user_id();\r\n\r\n\/\/ Get the WP_User Object instance\r\n$user = $order->get_user();\r\n\r\n\/\/ Get the WP_User roles and capabilities\r\n$user_roles = $user->roles;\r\n\r\n\/\/ Get the Customer billing email\r\n$billing_email  = $order->get_billing_email();\r\n\r\n\/\/ Get the Customer billing phone\r\n$billing_phone  = $order->get_billing_phone();\r\n\r\n\/\/ Customer billing information details\r\n$billing_first_name = $order->get_billing_first_name();\r\n$billing_last_name  = $order->get_billing_last_name();\r\n$billing_company    = $order->get_billing_company();\r\n$billing_address_1  = $order->get_billing_address_1();\r\n$billing_address_2  = $order->get_billing_address_2();\r\n$billing_city       = $order->get_billing_city();\r\n$billing_state      = $order->get_billing_state();\r\n$billing_postcode   = $order->get_billing_postcode();\r\n$billing_country    = $order->get_billing_country();\r\n\r\n\/\/ Customer shipping information details\r\n$shipping_first_name = $order->get_shipping_first_name();\r\n$shipping_last_name  = $order->get_shipping_last_name();\r\n$shipping_company    = $order->get_shipping_company();\r\n$shipping_address_1  = $order->get_shipping_address_1();\r\n$shipping_address_2  = $order->get_shipping_address_2();\r\n$shipping_city       = $order->get_shipping_city();\r\n$shipping_state      = $order->get_shipping_state();\r\n$shipping_postcode   = $order->get_shipping_postcode();\r\n$shipping_country    = $order->get_shipping_country();<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>Odpor\u00fa\u010dam skop\u00edrova\u0165 cel\u00fd prie\u010dinok z woocomerce\/templates do child-t\u00e9my aby sa \u00fapravy zachovali aj pri aktualiz\u00e1ci\u00ed pluginuAk nem\u00e1te child t\u00e9mu tak si ju treba vytvori\u0165. \u010eal\u0161ia mo\u017enos\u0165 je pou\u017ei\u0165 include alebo requiere\u2026<\/p>","protected":false},"author":1,"featured_media":41,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,23],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocomerce","category-wordpress"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":0,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/media\/41"}],"wp:attachment":[{"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.areaweb.sk\/cs\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}