{"id":1463,"date":"2012-09-27T19:13:25","date_gmt":"2012-09-27T15:13:25","guid":{"rendered":"http:\/\/yousite.ru\/?p=1463"},"modified":"2012-09-29T21:35:14","modified_gmt":"2012-09-29T17:35:14","slug":"%d0%bc%d0%be%d0%b4%d0%b8%d1%84%d0%b8%d0%ba%d0%b0%d1%86%d0%b8%d1%8f-woocommerce","status":"publish","type":"post","link":"https:\/\/yousite.ru\/?p=1463","title":{"rendered":"\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f woocommerce"},"content":{"rendered":"<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0443\u0431\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0438\u0436\u0435 \u0432 \u0444\u0430\u0439\u043b functions.php \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b.<\/p>\n<p><!--more--><\/p>\n<pre class=\"brush: php; gutter: true\">add_filter( &#039;woocommerce_currencies&#039;, &#039;add_my_currency&#039; );\r\n\r\nfunction add_my_currency( $currencies ) {\r\n     $currencies[&#039;ABC&#039;] = __( &#039;\u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0439 \u0440\u0443\u0431\u043b\u044c&#039;, &#039;woocommerce&#039; );\r\n     return $currencies;\r\n}\r\n\r\nadd_filter(&#039;woocommerce_currency_symbol&#039;, &#039;add_my_currency_symbol&#039;, 10, 2);\r\nfunction add_my_currency_symbol( $currency_symbol, $currency ) {\r\n     switch( $currency ) {\r\n          case &#039;ABC&#039;: $currency_symbol = &#039;\u0440\u0443\u0431&#039;; break;\r\n     }\r\n     return $currency_symbol;\r\n}<\/pre>\n<p>&nbsp;<br \/>\n\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f WOOCOMMERCE \u0432 \u043e\u0431\u0445\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u044f\u0434\u0440\u0430:<\/p>\n<pre class=\"brush: php; gutter: true\">\/\/ \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f WOOCOMMERCE \u0432 \u043e\u0431\u0445\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u044f\u0434\u0440\u0430\r\n\r\nadd_filter( &#039;woocommerce_currencies&#039;, &#039;add_my_currency&#039; );\r\n\r\nfunction add_my_currency( $currencies ) {\r\n     $currencies[&#039;ABC&#039;] = __( &#039;\u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0439 \u0440\u0443\u0431\u043b\u044c&#039;, &#039;woocommerce&#039; );\r\n     return $currencies;\r\n}\r\n\r\nadd_filter(&#039;woocommerce_currency_symbol&#039;, &#039;add_my_currency_symbol&#039;, 10, 2);\r\nfunction add_my_currency_symbol( $currency_symbol, $currency ) {\r\n     switch( $currency ) {\r\n          case &#039;ABC&#039;: $currency_symbol = &#039;\u0440\u0443\u0431&#039;; break;\r\n     }\r\n     return $currency_symbol;\r\n}\r\n\r\n\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0432\u0430\u0440\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443\r\nadd_filter(&#039;loop_shop_per_page&#039;, create_function(&#039;$cols&#039;, &#039;return 30;&#039;));\r\n\r\n\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 (\u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 - \u0434\u043b\u044f \u0440\u0435\u0437\u0438\u043d\u044b)\r\nadd_filter(&#039;loop_shop_columns&#039;, &#039;loop_columns&#039;);\r\nif (!function_exists(&#039;loop_columns&#039;)) {\r\n        function loop_columns() {\r\n                return 35;\r\n        }\r\n}\r\n\r\n\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0430 up-sells\r\nremove_action( &#039;woocommerce_after_single_product&#039;, &#039;woocommerce_upsell_display&#039;);\r\nadd_action( &#039;woocommerce_after_single_product&#039;, &#039;woocommerce_output_upsells&#039;, 20);\r\n\r\nif (!function_exists(&#039;woocommerce_output_upsells&#039;)) {\r\n        function woocommerce_output_upsells() {\r\n            woocommerce_upsell_display(4,4); \/\/ \u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c 4 \u0442\u043e\u0432\u0430\u0440\u0430 \u0430 4 \u043a\u043e\u043b\u043e\u043d\u043a\u0438\r\n        }\r\n}\r\n\r\n\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043f\u0443\u0442\u0441\u0432\u0443\u0435\u0449\u0435\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0430 (\u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 2)\r\nfunction woocommerce_output_related_products() {\r\nwoocommerce_related_products(4,4); \/\/ \u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c 4 \u0442\u043e\u0432\u0430\u0440\u0430 \u0430 4 \u043a\u043e\u043b\u043e\u043d\u043a\u0438\r\n}\r\n\r\n\/\/ \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430\r\nadd_filter( &#039;woocommerce_checkout_fields&#039; , &#039;custom_override_checkout_fields&#039; );\r\nfunction custom_override_checkout_fields( $fields ) { \/*\u0423\u0431\u0440\u0430\u043b\u0438 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435*\/\r\n     unset($fields[&#039;billing&#039;][&#039;billing_company&#039;]);\r\n         unset($fields[&#039;billing&#039;][&#039;billing_country&#039;]);\r\n         unset($fields[&#039;billing&#039;][&#039;billing_address_2&#039;]);\r\n         unset($fields[&#039;billing&#039;][&#039;billing_state&#039;]);\r\n     return $fields;\r\n}\r\nadd_filter(&#039;woocommerce_billing_fields&#039;, &#039;custom_woocommerce_billing_fields&#039;);\r\nfunction custom_woocommerce_billing_fields( $fields ) {\r\n$fields[&#039;billing_address_1&#039;][&#039;class&#039;] = array( &#039;form-row-wide&#039; ); \/*\u0421\u0434\u0435\u043b\u0430\u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u043f\u043e\u043b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430*\/\r\nreturn $fields;\r\n}\r\n\r\n\/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435\r\nremove_action( &#039;woocommerce_before_main_content&#039;, &#039;woocommerce_output_content_wrapper&#039;, 10); \/\/ \u0423\u0431\u0440\u0430\u043b\u0438\r\nremove_action( &#039;woocommerce_after_main_content&#039;, &#039;woocommerce_output_content_wrapper_end&#039;, 10);\r\nadd_action(&#039;woocommerce_before_main_content&#039;, create_function(&#039;&#039;, &#039;echo &quot;&lt;div id=\\&quot;contentwrapper\\&quot;&gt;&lt;div id=\\&quot;content\\&quot;&gt;&quot;;&#039;), 10);\r\nfunction divandsidebar_function(){\r\n    echo &quot;&lt;\/div&gt;&lt;\/div&gt;&quot;;\r\n        get_sidebar(&#039;left&#039;); \/\/ \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0432\u044b\u0437\u0432\u0430\u043b\u0438 sidebar-left.php\r\n}\r\nadd_action(&#039;woocommerce_after_main_content&#039;, &#039;divandsidebar_function&#039;, 10);  \/\/ \u0421\u0432\u043e\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438\r\n\r\n\/\/\u0423\u0431\u0440\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 &quot;\u0412 \u043a\u043e\u0440\u0437\u0438\u043d\u0443&quot; \u043d\u0430 \u0432\u0438\u0442\u0440\u0438\u043d\u0435\r\nremove_action( &#039;woocommerce_after_shop_loop_item&#039;, &#039;woocommerce_template_loop_add_to_cart&#039;, 10);\r\n\r\n\/\/\u041c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043a\u0440\u0430\u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0446\u0435\u043d\u0443\r\nremove_action( &#039;woocommerce_single_product_summary&#039;, &#039;woocommerce_template_single_price&#039;, 10);\r\nremove_action( &#039;woocommerce_single_product_summary&#039;, &#039;woocommerce_template_single_excerpt&#039;, 20);\r\nadd_action( &#039;woocommerce_single_product_summary&#039;, &#039;woocommerce_template_single_price&#039;, 20);\r\nadd_action( &#039;woocommerce_single_product_summary&#039;, &#039;woocommerce_template_single_excerpt&#039;, 10);\r\nfunction HB_woocommerce_template_dimensions(){ \/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0430\u043d\u0435\u043b\u044c\u043a\u0438 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u0432\u0435\u0441\u043e\u043c\r\n   global $woocommerce, $post, $product;\r\n   $product-&gt;list_attributes();\r\n}\r\nadd_action( &#039;woocommerce_single_product_summary&#039;, &#039;HB_woocommerce_template_dimensions&#039;, 15); \/\/\u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043d\u0435\u043b\u044c\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u043a\u0440\u0430\u0442\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f\r\n\r\n\/\/\u0423\u0431\u0440\u0430\u043b\u0438 \u0445\u043b\u0435\u0431\u043d\u044b\u0435 \u043a\u0440\u043e\u0448\u043a\u0438\r\nremove_action( &#039;woocommerce_before_main_content&#039;, &#039;woocommerce_breadcrumb&#039;, 20, 0);\r\n\r\n\/\/\u0423\u0431\u0440\u0430\u043b\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 &quot;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435&quot;\r\nremove_action( &#039;woocommerce_product_tabs&#039;, &#039;woocommerce_product_attributes_tab&#039;, 20 );\r\nremove_action( &#039;woocommerce_product_tab_panels&#039;, &#039;woocommerce_product_attributes_panel&#039;, 20 );\r\n\r\n\/\/ \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443\r\nadd_filter(&#039;woocommerce_login_widget_redirect&#039;, &#039;custom_login_redirect&#039;);\r\nfunction custom_login_redirect( $redirect_to ) {\r\n     $redirect_to = &#039;\/checkout&#039;;\r\n}\r\n\r\n\/\/ \u041c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443\r\nremove_action( &#039;woocommerce_pagination&#039;, &#039;woocommerce_pagination&#039;, 10 );\r\nremove_action( &#039;woocommerce_pagination&#039;, &#039;woocommerce_catalog_ordering&#039;, 20 );\r\nfunction pre_woocommerce_pagination(){ \/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0438\u043a\u043e\u043c\r\n   echo &#039;&lt;span class=&quot;sort-pre&quot;&gt;\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430: &lt;\/span&gt;&#039;;\r\n}\r\nadd_action( &#039;woocommerce_pagination&#039;, &#039;pre_woocommerce_pagination&#039;, 5 );\r\nadd_action( &#039;woocommerce_pagination&#039;, &#039;woocommerce_catalog_ordering&#039;, 10 );\r\nadd_action( &#039;woocommerce_pagination&#039;, &#039;woocommerce_pagination&#039;, 20 );\r\n\r\n\/\/ \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u043d\u0435\u043b\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\r\nadd_action( &#039;woocommerce_before_shop_loop&#039;, &#039;pre_woocommerce_pagination&#039;, 1 );\r\nadd_action( &#039;woocommerce_before_shop_loop&#039;, &#039;woocommerce_catalog_ordering&#039;, 2 );\r\nadd_action( &#039;woocommerce_before_shop_loop&#039;, &#039;woocommerce_pagination&#039;, 3 );\r\n\r\n\/\/\u0421\u043d\u0438\u043c\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f\r\nadd_filter( &#039;woocommerce_checkout_fields&#039; , &#039;no_required_checkout_fields&#039; );\r\nfunction no_required_checkout_fields( $fields ) {\r\n     $fields[&#039;billing&#039;][&#039;billing_last_name&#039;][&#039;required&#039;] = false;\r\n         $fields[&#039;billing&#039;][&#039;billing_address_1&#039;][&#039;required&#039;] = false;\r\n         $fields[&#039;billing&#039;][&#039;billing_city&#039;][&#039;required&#039;] = false;\r\n         $fields[&#039;billing&#039;][&#039;billing_postcode&#039;][&#039;required&#039;] = false;\r\n     return $fields;\r\n}\r\n\r\n\/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0438 &quot;\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438&quot; &quot;\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437&quot; \u0432\u043d\u0438\u0437\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u043e\u0440\u0437\u0438\u043d\u044b\r\nfunction cart_more_buttons() {\r\n        echo &#039;&lt;a href=&quot;http:\/\/happybirds.ru\/shop\/&quot; class=&quot;checkout-button button second-in-cart cont&quot;&gt; \u2190 \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438&lt;\/a&gt;&lt;a href=&quot;http:\/\/happybirds.ru\/checkout\/&quot; class=&quot;checkout-button button second-in-cart&quot;&gt;\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u2192&lt;\/a&gt;&#039;;\r\n        }\r\nadd_action (&#039;woocommerce_after_cart_totals&#039;, &#039;cart_more_buttons&#039;, 5);\r\n\r\n\/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043d\u043e\u043f\u043ae &quot;\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438&quot; \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430\r\nfunction checkout_more_buttons() {\r\n        echo &#039;&lt;a href=&quot;http:\/\/happybirds.ru\/shop\/&quot; class=&quot;checkout-button button second-in-cart cont&quot;&gt; \u2190 \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0438&lt;\/a&gt;&#039;;\r\n        }\r\nadd_action (&#039;woocommerce_review_order_before_submit&#039;, &#039;checkout_more_buttons&#039;, 5);<\/pre>\n<p><a href=\"http:\/\/www.mrova.com\/adding-currency-to-woocommerce\/\" target=\"_blank\">English<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>woocommerce \u0440\u0443\u0431\u043b\u0438<\/p>\n","protected":false},"author":1,"featured_media":1464,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[115],"tags":[119],"class_list":["post-1463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-wordpress-2"],"_links":{"self":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/1463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1463"}],"version-history":[{"count":4,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/1463\/revisions"}],"predecessor-version":[{"id":1466,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/1463\/revisions\/1466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/media\/1464"}],"wp:attachment":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}