{"id":84,"date":"2022-04-10T17:19:30","date_gmt":"2022-04-10T14:19:30","guid":{"rendered":"https:\/\/shedov.top\/ru\/?p=84"},"modified":"2025-07-08T00:32:06","modified_gmt":"2025-07-07T21:32:06","slug":"kak-skryt-knopku-podrobnee-kartochki-tovara-kotorogo-net-v-nalichii-na-sajte-s-woocommerce","status":"publish","type":"post","link":"https:\/\/shedov.top\/ru\/kak-skryt-knopku-podrobnee-kartochki-tovara-kotorogo-net-v-nalichii-na-sajte-s-woocommerce\/","title":{"rendered":"\u041a\u0430\u043a \u0441\u043a\u0440\u044b\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\", \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0442\u043e\u0432\u0430\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b AJAX \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0441 WooCommerce."},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>1. \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435, \u0432 \u0444\u0430\u0439\u043b functions.php, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b (\u043a\u043e\u0434 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 <a class=\"a_entry_style\" rel=\"noreferrer noopener\" href=\"https:\/\/woocommerce.com\/document\/hide-loop-read-more-buttons-for-out-of-stock-items\/\" data-type=\"URL\" target=\"_blank\">woocommerce<\/a>).<\/p>\n\n\n\n&nbsp;\n\n\n\n<pre class=\"wp-block-code language-php line-numbers\"><code>\/**\n * Hide loop read more buttons for out of stock items \n *\/\nif (!function_exists('woocommerce_template_loop_add_to_cart')) {\n    function woocommerce_template_loop_add_to_cart() {\n        global $product;\n        if ( ! $product-&gt;is_in_stock() || ! $product-&gt;is_purchasable() ) return;\n        wc_get_template('loop\/add-to-cart.php');\n    }\n}<\/code><\/pre>\n\n\n\n&nbsp;\n\n\n\n<p>2. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b, \u043f\u0430\u043f\u043a\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 - woocommerce\\loop\\, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 - loop, \u0444\u0430\u0439\u043b - add-to-cart.php, \u043f\u043e\u0441\u043b\u0435, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434 \u043d\u0438\u0436\u0435:<\/p>\n\n\n\n&nbsp;\n\n\n\n<pre class=\"wp-block-code language-php line-numbers\"><code>\/**\n * Loop Add to Cart\n *\n * This template can be overridden by copying it to yourtheme\/woocommerce\/loop\/add-to-cart.php.\n *\n * HOWEVER, on occasion WooCommerce will need to update template files and you\n * (the theme developer) will need to copy the new files to your theme to\n * maintain compatibility. We try to do this as little as possible, but it does\n * happen. When this occurs the version of the template file will be bumped and\n * the readme will list any important changes.\n *\n * @see         https:\/\/docs.woocommerce.com\/document\/template-structure\/\n * @package     WooCommerce\\Templates\n * @version     3.3.0\n *\/\nif ( ! defined( 'ABSPATH' ) ) {\n    exit;\n}\nglobal $product;\necho sprintf(\n    '&lt;a href=\"%s\" data-product_id=\"%s\" class=\"%s custom_button_buy\"&gt;%s&lt;\/a&gt;',\n    $product-&gt;add_to_cart_url(),\n    $product-&gt;get_id(),\n    'btn btn-black product_type_' . $product-&gt;get_type() . ' ' . ( $product-&gt;supports( 'ajax_add_to_cart' ) ? 'add_to_cart_button ajax_add_to_cart' : '' ),\n    $product-&gt;add_to_cart_text()\n);<\/code><\/pre>\n\n\n\n&nbsp;\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 WooCommerce. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e AJAX \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b - \"data-product_id=\"%s\" \u0438  %s custom_button_buy.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"1. \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435, \u0432 \u0444\u0430\u0439\u043b functions.php, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b (\u043a\u043e\u0434 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 woocommerce). &nbsp; &nbsp; 2. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0432\u0430\u0448\u0435\u0439 \u0442\u0435\u043c\u044b, \u043f\u0430\u043f\u043a\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 - woocommerce\\loop\\, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 - loop, \u0444\u0430\u0439\u043b - add-to-cart.php, \u043f\u043e\u0441\u043b\u0435, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434 \u043d\u0438\u0436\u0435: &nbsp; &nbsp; \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 [&hellip;]","protected":false},"author":1,"featured_media":332,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,9,7,6,8],"tags":[],"class_list":["post-84","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ajax","category-php","category-woocommerce","category-wordpress","category-wordpress-ajax"],"_links":{"self":[{"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":49,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":2698,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/posts\/84\/revisions\/2698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/media\/332"}],"wp:attachment":[{"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shedov.top\/ru\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}