{"id":29517,"date":"2018-11-05T00:00:00","date_gmt":"2018-11-04T18:30:00","guid":{"rendered":"https:\/\/git-staging.wpastra.com\/?post_type=docs&#038;p=29517"},"modified":"2024-02-09T16:34:14","modified_gmt":"2024-02-09T11:04:14","slug":"change-woocommerce-out-of-stock-text","status":"publish","type":"docs","link":"https:\/\/git-staging.wpastra.com\/es\/docs\/change-woocommerce-out-of-stock-text\/","title":{"rendered":"Cambiar Woocommerce Texto Fuera de Stock"},"content":{"rendered":"<p>Astra a\u00f1ade un texto \"Fuera de stock\" para los productos WooCommerece que tienen 'Estado de stock' como fuera de stock. A continuaci\u00f3n se muestra la captura de pantalla de c\u00f3mo se muestra el texto en el front-end en el producto -.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1655\" height=\"841\" src=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/11\/out-of-stock-woo.png\" alt=\"Out of Stock WooCommerce\" class=\"wp-image-29521\" srcset=\"https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/11\/out-of-stock-woo.png 1655w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/11\/out-of-stock-woo-300x152.png 300w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/11\/out-of-stock-woo-768x390.png 768w, https:\/\/git-staging.wpastra.com\/wp-content\/uploads\/2018\/11\/out-of-stock-woo-1024x520.png 1024w\" sizes=\"(max-width: 1655px) 100vw, 1655px\" \/><\/figure>\n\n\n\n<p>Puede cambiar el texto \"Fuera de stock\" por cualquier texto personalizado que desee, tanto en el Cat\u00e1logo de productos (p\u00e1gina Tienda) como en las p\u00e1ginas de Producto individual, utilizando filtros. <\/p>\n\n\n\n<p>Para ello, debe a\u00f1adir los siguientes filtros al archivo functions.php de su tema hijo:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A\u00f1ada el siguiente c\u00f3digo para cambiar el texto \"Fuera de stock\" en el Cat\u00e1logo de Productos (p\u00e1gina de la Tienda):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted lang:php decode:true\">add_filter( 'astra_woo_shop_out_of_stock_string', 'out_of_stock_callback' );\nfunction salida_de_stock_callback( $\u00edtulo ) {\nreturn '<strong>VENDIDO<\/strong>';\n}<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A\u00f1ada el siguiente c\u00f3digo para cambiar el texto \"Fuera de stock\" en las p\u00e1ginas de productos individuales:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted lang:php decode:true\">add_filter( 'woocommerce_get_availability', 'change_out_of_stock_text_woocommerce', 1, 2 );\nfunction change_out_of_stock_text_woocommerce( $availability, $product_to_check ) {\n\/\/ Cambiar texto fuera de stock\nif ( ! $product_to_check-&gt;is_in_stock() ) {\n    $availability['disponibilidad'] = __('<strong>VENDIDO<\/strong>', 'woocommerce');\n}\nreturn 1TP21Disponibilidad;\n}<\/pre>\n\n\n\n<p>Ambos c\u00f3digos sustituir\u00e1n al <span style=\"font-size: 1rem;\">\"Texto \"Fuera de stock<\/span> con \"VENDIDO\". Puede modificar esto sustituyendo la palabra \"VENDIDO\" en negrita en ambos c\u00f3digos por su texto personalizado.<\/p>\n\n\n\n<p>Si no tiene instalado el tema infantil, compruebe lo siguiente <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/install-astra-child-theme\/\" target=\"_blank\" rel=\"noreferrer noopener\">este art\u00edculo<\/a> sobre c\u00f3mo hacerlo. Y, si usted no est\u00e1 seguro de c\u00f3mo agregar este c\u00f3digo, por favor revise esto <a href=\"https:\/\/git-staging.wpastra.com\/es\/docs\/add-custom-php-code\/#3.-in-child-theme\" target=\"_blank\" rel=\"noreferrer noopener\">art\u00edculo<\/a>. <\/p>","protected":false},"excerpt":{"rendered":"<p>Astra a\u00f1ade un texto \"Fuera de Stock\" para los productos WooCommerece que tienen 'Estado de Stock' como fuera de stock. A continuaci\u00f3n se muestra la captura de pantalla de c\u00f3mo se muestra el texto en la parte delantera en el producto - Puede cambiar el \"Fuera de Stock\" texto con cualquier texto personalizado que desee, tanto en el [...]<\/p>","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","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":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","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":""}},"footnotes":""},"docs_category":[2112],"docs_tag":[],"class_list":{"0":"post-29517","1":"docs","2":"type-docs","3":"status-publish","5":"docs_category-woocommerce-filters"},"spectra_custom_meta":{"_wp_old_slug":[""],"_wp_page_template":["default"],"wpil_links_inbound_internal_count_data":["a:0:{}"],"wpil_links_outbound_internal_count_data":["a:2:{i:0;a:9:{s:3:\"url\";s:75:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/#3.-in-child-theme\";s:8:\"url_real\";s:75:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/#3.-in-child-theme\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:32:\"child theme's functions.php file\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}i:1;a:9:{s:3:\"url\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:8:\"url_real\";s:57:\"https:\/\/git-staging.wpastra.com\/docs\/add-custom-php-code\/\";s:4:\"host\";s:11:\"wpastra.com\";s:9:\"host_real\";s:11:\"wpastra.com\";s:8:\"internal\";b:1;s:7:\"post_id\";i:0;s:6:\"anchor\";s:27:\"How to Add Custom PHP Code?\";s:15:\"added_by_plugin\";b:0;s:10:\"post_title\";s:0:\"\";}}"],"wpil_links_outbound_external_count_data":["a:0:{}"],"_edit_lock":["1707718883:89"],"_edit_last":["89"],"onesignal_meta_box_present":["1"],"onesignal_send_notification":[""],"wpil_sync_report3":["1"],"site-sidebar-layout":["default"],"site-content-layout":["default"],"theme-transparent-header-meta":["default"],"_yoast_wpseo_content_score":["90"],"wpil_links_inbound_internal_count":["0"],"wpil_links_outbound_internal_count":["2"],"wpil_links_outbound_external_count":["0"],"wpil_sync_report2_time":["2019-09-05T12:01:38+00:00"],"_ppc_meta_key":["a:8:{s:20:\"ppc_key5d92f85d42273\";s:60:\"Images &amp; Names Correctly. Title &amp; Alt Tags are Given\";s:8:\"ppc_key4\";s:15:\"Formatting Done\";s:8:\"ppc_key2\";s:23:\"Featured Image Assigned\";s:8:\"ppc_key3\";s:17:\"Category Selected\";s:8:\"ppc_key5\";s:15:\"Title is Catchy\";s:8:\"ppc_key6\";s:22:\"Social Images Assigned\";s:8:\"ppc_key8\";s:28:\"Spelling and Grammar Checked\";s:8:\"ppc_key7\";s:8:\"Done SEO\";}"],"tap_disable_autolinker":["no"],"tap_autolink_inside_heading":["global"],"tap_autolink_random_placement":["global"],"tap_post_autolinker_limit":["0"],"_yoast_wpseo_title":["How to Change WooCommerce out of Stock Text with Astra?"],"_ht_kb_post_views_count":["11"],"_ht_kb_usefulness":["0"],"_ht_article_order_103":["29517"],"wp_last_modified_info":["February 23, 2022 @ 4:58 PM"],"wplmi_shortcode":["[lmt-post-modified-info]"],"views":["6841"],"helpful":["25"],"unhelpful":["21"],"redirects":["11"],"_yoast_wpseo_estimated-reading-time-minutes":["2"],"_lmt_disableupdate":["no"],"_wplmi_last_modified":["2021-09-08 21:24:13"],"rank_math_title":["How to Change WooCommerce out of Stock Text with Astra?"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_analytic_object_id":["962"],"rank_math_seo_score":["14"],"rank_math_internal_links_processed":["1"],"rank_math_og_content_image":["a:2:{s:5:\"check\";s:32:\"502e9bcce91575ebcd59e47539306816\";s:6:\"images\";a:1:{i:0;i:29521;}}"],"_wpml_media_duplicate":["1"],"_trp_automatically_translated_slug_es_ES":["cambiar-woocommerce-texto-fuera-de-stock"],"rank_math_primary_docs_category":["2112"],"_uag_custom_page_level_css":[""],"ast-site-content-layout":["default"],"adv-header-id-meta":[""],"stick-header-meta":[""],"astra-migrate-meta-layouts":["set"],"pfd_related_docs":[""],"_uag_page_assets":["a:9:{s:3:\"css\";s:2495:\".wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-top svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-top .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape-bottom svg{width: calc( 100% + 1.3px );}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__shape.uagb-container__shape-bottom .uagb-container__shape-fill{fill: rgba(51,51,51,1);}.wp-block-uagb-container.uagb-block-debf2792 .uagb-container__video-wrap video{opacity: 1;}.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1200px);max-width: var(--inner-content-custom-width);width: 100%;flex-direction: column;align-items: center;justify-content: center;flex-wrap: nowrap;row-gap: 0px;column-gap: 0px;}.wp-block-uagb-container.uagb-block-debf2792{box-shadow: 0px 0px   #00000070 ;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;overflow: visible;border-color: inherit;row-gap: 0px;column-gap: 0px;}@media only screen and (max-width: 976px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 1024px);max-width: var(--inner-content-custom-width);width: 100%;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}@media only screen and (max-width: 767px) {.wp-block-uagb-container.uagb-is-root-container .uagb-block-debf2792{max-width: 100%;width: 100%;}.wp-block-uagb-container.uagb-is-root-container.alignfull.uagb-block-debf2792 > .uagb-container-inner-blocks-wrap{--inner-content-custom-width: min( 100%, 767px);max-width: var(--inner-content-custom-width);width: 100%;flex-wrap: wrap;}.wp-block-uagb-container.uagb-block-debf2792{padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;margin-top: 0px !important;margin-bottom: 0px !important;margin-left: 0px;margin-right: 0px;}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:7:{i:0;s:14:\"core\/paragraph\";i:1;s:10:\"core\/image\";i:2;s:9:\"core\/list\";i:3;s:14:\"core\/list-item\";i:4;s:17:\"core\/preformatted\";i:5;s:14:\"uagb\/container\";i:6;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1776687159\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"Nikhil Chavan","author_link":"https:\/\/git-staging.wpastra.com\/es\/author\/nikhilc\/"},"uagb_comment_info":0,"uagb_excerpt":"Astra adds a text &#8220;Out Of Stock&#8221; for the WooCommerece products that have &#8216;Stock status&#8217; as out of stock. Below is the screenshot of how the text displays in the front end on the product &#8211; You can change the &#8220;Out Of Stock&#8221; text with any custom text you want, on both the Product Catalog&hellip;","_links":{"self":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/29517"}],"collection":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/comments?post=29517"}],"version-history":[{"count":0,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs\/29517\/revisions"}],"wp:attachment":[{"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/media?parent=29517"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_category?post=29517"},{"taxonomy":"docs_tag","embeddable":true,"href":"https:\/\/git-staging.wpastra.com\/es\/wp-json\/wp\/v2\/docs_tag?post=29517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}