{"id":130945,"date":"2020-10-30T11:27:05","date_gmt":"2020-10-30T11:27:05","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/sold-out-badge-for-woocommerce\/"},"modified":"2023-05-30T19:26:32","modified_gmt":"2023-05-30T19:26:32","slug":"sold-out-badge-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/ja.wordpress.org\/plugins\/sold-out-badge-for-woocommerce\/","author":17895316,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"4.4.0","stable_tag":"4.4.0","tested":"6.2.9","requires":"5.2","requires_php":"7.2","requires_plugins":null,"header_name":"Sold Out Badge for WooCommerce","header_author":"Charlie Etienne","header_description":"Display a \"Sold Out!\" badge on out of stock products","assets_banners_color":"7e7dd0","last_updated":"2023-05-30 19:26:32","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/paypal.me\/webnancy","header_plugin_uri":"","header_author_uri":"https:\/\/web-nancy.fr","rating":4.8,"author_block_rating":0,"active_installs":9000,"downloads":108471,"num_ratings":25,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"2.0.10":{"tag":"2.0.10","author":"charlieetienne","date":"2021-01-15 22:41:03"},"2.0.4":{"tag":"2.0.4","author":"charlieetienne","date":"2020-10-30 11:26:43"},"2.0.5":{"tag":"2.0.5","author":"charlieetienne","date":"2020-10-30 12:16:12"},"2.0.6":{"tag":"2.0.6","author":"charlieetienne","date":"2020-10-30 22:09:42"},"2.0.7":{"tag":"2.0.7","author":"charlieetienne","date":"2020-11-23 22:22:05"},"2.0.8":{"tag":"2.0.8","author":"charlieetienne","date":"2020-11-29 22:55:04"},"2.0.9":{"tag":"2.0.9","author":"charlieetienne","date":"2020-12-17 21:07:25"},"2.1.0":{"tag":"2.1.0","author":"charlieetienne","date":"2021-11-26 12:30:52"},"2.2.0":{"tag":"2.2.0","author":"charlieetienne","date":"2022-02-24 08:34:00"},"3.0.0":{"tag":"3.0.0","author":"charlieetienne","date":"2022-02-24 17:57:24"},"3.0.1":{"tag":"3.0.1","author":"charlieetienne","date":"2022-02-27 12:16:12"},"3.1.0":{"tag":"3.1.0","author":"charlieetienne","date":"2022-03-02 21:39:42"},"3.2.0":{"tag":"3.2.0","author":"charlieetienne","date":"2022-03-03 10:30:18"},"3.2.1":{"tag":"3.2.1","author":"charlieetienne","date":"2022-03-03 11:38:48"},"3.2.2":{"tag":"3.2.2","author":"charlieetienne","date":"2022-03-03 12:37:43"},"4.0.0":{"tag":"4.0.0","author":"charlieetienne","date":"2022-03-09 00:15:31"},"4.1.0":{"tag":"4.1.0","author":"charlieetienne","date":"2022-03-13 21:47:49"},"4.2.0":{"tag":"4.2.0","author":"charlieetienne","date":"2022-03-22 09:05:30"},"4.3.0":{"tag":"4.3.0","author":"charlieetienne","date":"2022-03-22 21:50:44"},"4.3.1":{"tag":"4.3.1","author":"charlieetienne","date":"2022-03-30 09:07:36"},"4.3.2":{"tag":"4.3.2","author":"charlieetienne","date":"2022-06-27 12:51:02"},"4.3.3":{"tag":"4.3.3","author":"charlieetienne","date":"2022-06-27 14:54:09"},"4.3.4":{"tag":"4.3.4","author":"charlieetienne","date":"2022-09-09 08:35:16"},"4.3.5":{"tag":"4.3.5","author":"charlieetienne","date":"2022-09-09 10:42:01"},"4.3.6":{"tag":"4.3.6","author":"charlieetienne","date":"2023-03-27 20:53:10"},"4.4.0":{"tag":"4.4.0","author":"charlieetienne","date":"2023-05-30 19:26:32"}},"upgrade_notice":[],"ratings":{"1":1,"2":0,"3":0,"4":1,"5":23},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2410141,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2410141,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2782349,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-772x250.gif":{"filename":"banner-772x250.gif","revision":2782349,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2.0.10","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.2.0","3.0.0","3.0.1","3.1.0","3.2.0","3.2.1","3.2.2","4.0.0","4.1.0","4.2.0","4.3.0","4.3.1","4.3.2","4.3.3","4.3.4","4.3.5","4.3.6","4.4.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2410141,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2410141,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":2410141,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Single product page","2":"Store and categories pages","3":"Admin settings"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2305,4423,65620,192542,286],"plugin_category":[45],"plugin_contributors":[192541],"plugin_business_model":[],"class_list":["post-130945","plugin","type-plugin","status-publish","hentry","plugin_tags-badge","plugin_tags-out-of-stock","plugin_tags-sold-out","plugin_tags-wcsob","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-charlieetienne","plugin_committers-charlieetienne"],"banners":{"banner":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/banner-772x250.gif?rev=2782349","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/icon.svg?rev=2782349","icon":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/icon.svg?rev=2782349","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/screenshot-1.png?rev=2410141","caption":"Single product page"},{"src":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/screenshot-2.png?rev=2410141","caption":"Store and categories pages"},{"src":"https:\/\/ps.w.org\/sold-out-badge-for-woocommerce\/assets\/screenshot-3.png?rev=2410141","caption":"Admin settings"}],"raw_content":"<!--section=description-->\n<p>Display a \"Sold Out!\" badge on out-of-stock products.\nWhen a WooCommerce product becomes out of stock, this plugin will show a badge on thumbnail with the text you will have defined.<\/p>\n\n<p>This plugin was initially created to help people and companies selling <em>unique<\/em> products or services, like artists, artisans, real estate professionals, etc. It is often beneficial for them to keep showing sold out (out of stock) products on their websites, while displaying a message indicating that the product can't be sold anymore.<\/p>\n\n<p>However, this plugin can be used by <strong>anyone<\/strong> wanting to display <strong>any text<\/strong> in a badge when a product is out of stock.<\/p>\n\n<p>It is also possible to display a badge on backorder products.<\/p>\n\n<h3>Usage &amp; Documentation<\/h3>\n\n<p>You can customize options in <strong><em>Settings &gt; Sold Out Badge for WooCommerce<\/em><\/strong><\/p>\n\n<h4>What can I customize in this plugin ?<\/h4>\n\n<ul>\n<li><strong>Badge text<\/strong> (you can replace \"<em>Sold Out<\/em>\" with any text you want, like \"<em>Out of stock<\/em>\" or \"<em>Coming Soon<\/em>\")<\/li>\n<li><strong>Badge background color<\/strong><\/li>\n<li><strong>Badge text color<\/strong><\/li>\n<li><strong>Badge font size<\/strong><\/li>\n<li><strong>Badge width<\/strong><\/li>\n<li><strong>Badge height<\/strong><\/li>\n<li>...<\/li>\n<li>An option to <strong>hide \"<em>Sale<\/em>\" badge<\/strong> if you get an overlap (checked by default)<\/li>\n<\/ul>\n\n<h4>Resources<\/h4>\n\n<ul>\n<li><strong>WordPress Plugin:<\/strong> <a href=\"https:\/\/wordpress.org\/plugins\/sold-out-badge-for-woocommerce\">https:\/\/wordpress.org\/plugins\/sold-out-badge-for-woocommerce<\/a><\/li>\n<li><strong>GitHub Repository:<\/strong> <a href=\"https:\/\/github.com\/CharlieEtienne\/sold-out-badge-for-woocommerce\">https:\/\/github.com\/CharlieEtienne\/sold-out-badge-for-woocommerce<\/a><\/li>\n<li><strong>Support:<\/strong> <a href=\"https:\/\/github.com\/CharlieEtienne\/sold-out-badge-for-woocommerce\/issues\">https:\/\/github.com\/CharlieEtienne\/sold-out-badge-for-woocommerce\/issues<\/a><\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Install this plugin either via the WordPress.org plugin directory, or by uploading the files to your server.<\/li>\n<li>Activate the plugin.<\/li>\n<li>That's it. You're ready to go! Please, refer to the Usage &amp; Documentation section for examples and how-to information.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='is%20this%20plugin%20completely%20free%3F'><h3>Is this plugin completely free?<\/h3><\/dt>\n<dd><p>Yes.<\/p><\/dd>\n<dt id='can%20i%20use%20this%20plugin%20for%20commercial%20purposes%3F'><h3>Can I use this plugin for commercial purposes?<\/h3><\/dt>\n<dd><p>Sure, go ahead! It is completely open source.<\/p><\/dd>\n<dt id='can%20i%20change%20the%20badge%20text%3F'><h3>Can I change the badge text?<\/h3><\/dt>\n<dd><p>Yes. Go to <em>Settings &gt; Sold Out Badge for WooCommerce<\/em>, you'll find the setting you want.<\/p><\/dd>\n<dt id='what%20if%20this%20plugin%20isn%27t%20compatible%20with%20my%20theme%20or%20doesn%27t%20work%3F'><h3>What if this plugin isn't compatible with my theme or doesn't work?<\/h3><\/dt>\n<dd><p>You could uninstall this plugin and try to get the badge manually. There are two ways you could do it:<\/p>\n\n<p><strong>1. Pure CSS<\/strong><\/p>\n\n<p>If you're lucky enough, you'll have a specific CSS class for out-of-stock products.\nYou could add a SOLD OUT badge like this:<\/p>\n\n<pre><code>.product.outofstock:before {\n     content: 'SOLD OUT';\n     color: #ffffff;\n     background: #FE2121;\n     font-size: 16px;\n     padding: 4px;\n     font-weight: bold;\n     width: auto;\n     height: auto;\n     border-radius: 0;\n     z-index: 9999;\n     text-align: center;\n     position: absolute;\n     top: 6px;\n     right: auto;\n     bottom: auto;\n     left: 6px;\n}\n<\/code><\/pre>\n\n<p><strong>2. PHP + CSS<\/strong><\/p>\n\n<p>Otherwise, you could use WP hooks to add a badge. Put this code in your child theme's <code>functions.php<\/code>:<\/p>\n\n<pre><code>add_action( 'woocommerce_before_shop_loop_item_title', 'my_custom_soldout_badge_display', 10 );\nadd_action( 'woocommerce_before_single_product_summary', 'my_custom_soldout_badge_display', 30 );\n\nfunction my_custom_soldout_badge_display() {\n    global $post, $product;\n\n    if ( ! $product-&gt;is_in_stock() ) {\n        echo '&lt;span class=\"wcsob_soldout\"&gt;SOLD OUT&lt;\/span&gt;';\n    }\n}\n<\/code><\/pre>\n\n<p>Use the following CSS code to style the badge:<\/p>\n\n<pre><code>.wcsob_soldout {\n     content: 'SOLD OUT';\n     color: #ffffff;\n     background: #FE2121;\n     font-size: 16px;\n     padding: 4px;\n     font-weight: bold;\n     width: auto;\n     height: auto;\n     border-radius: 0;\n     z-index: 9999;\n     text-align: center;\n     position: absolute;\n     top: 6px;\n     right: auto;\n     bottom: auto;\n     left: 6px;\n}\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>4.4.0<\/h4>\n\n<ul>\n<li>Support PHP 8.2<\/li>\n<li>Bump Carbon Fields version to 3.6.0<\/li>\n<li>Improve docs<\/li>\n<\/ul>\n\n<h4>4.3.6<\/h4>\n\n<ul>\n<li>Fix compatibility issues with kadence blocks and woocommerce HPOS thanks to @ataypamart<\/li>\n<\/ul>\n\n<h4>4.3.5<\/h4>\n\n<ul>\n<li>Fix missing hook in Elementor page builder<\/li>\n<\/ul>\n\n<h4>4.3.4<\/h4>\n\n<ul>\n<li>Fix related and upsells products in some themes like Divi<\/li>\n<\/ul>\n\n<h4>4.3.1<\/h4>\n\n<ul>\n<li>Adds compat with Elementor Archive posts widget<\/li>\n<\/ul>\n\n<h4>4.3.0<\/h4>\n\n<ul>\n<li>Allows displaying badge on backorder products instead of\/in addition to out of stock products<\/li>\n<\/ul>\n\n<h4>4.2.0<\/h4>\n\n<ul>\n<li>Adds WPML compatibility<\/li>\n<\/ul>\n\n<h4>4.1.0<\/h4>\n\n<ul>\n<li>Fixes Text Domain Path<\/li>\n<li>Fixes single product position settings being ignored<\/li>\n<\/ul>\n\n<h4>4.0.0<\/h4>\n\n<ul>\n<li>Major code refactor (nothing is supposed to change unless you made custom dev using this plugin hooks or classes )<\/li>\n<li>Added compatibility with Lay Theme<\/li>\n<\/ul>\n\n<h4>3.2.2<\/h4>\n\n<ul>\n<li>Minor fixes<\/li>\n<\/ul>\n\n<h4>3.2.1<\/h4>\n\n<ul>\n<li>Fixes and improves alternative method<\/li>\n<li>Improves compatibility with Divi Builder on single product pages<\/li>\n<\/ul>\n\n<h4>3.2.0<\/h4>\n\n<ul>\n<li>Adds an alternative method (pure CSS). Useful for some themes like Divi.<\/li>\n<\/ul>\n\n<h4>3.1.0<\/h4>\n\n<ul>\n<li>Adds badge in search results<\/li>\n<li>Ability to turn off the badge on a per-product basis<\/li>\n<\/ul>\n\n<h4>3.0.1<\/h4>\n\n<ul>\n<li>Fix missing \"position: absolute\" CSS rule<\/li>\n<\/ul>\n\n<h4>3.0.0<\/h4>\n\n<ul>\n<li><strong>Potential breaking change (in other words, do a backup before upgrading)<\/strong> : Adds settings options to control appearance (width, height, border-radius, etc.)<\/li>\n<\/ul>\n\n<h4>2.2.0<\/h4>\n\n<ul>\n<li>Move to Singleton pattern to let other developpers unhook actions and filters.\nIf you want to unhook something, use it like this, for example: <code>remove_filter( 'woocommerce_get_stock_html', [ WCSOB::get_instance(), 'replace_out_of_stock_text' ], 10, 2 );<\/code><\/li>\n<\/ul>","raw_excerpt":"Display a &quot;Sold Out!&quot; badge on out-of-stock products. Show the text and colors you want. Perfect for artists, artisans, real estate professionals...","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/130945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=130945"}],"author":[{"embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/charlieetienne"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=130945"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=130945"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=130945"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=130945"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=130945"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ja.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=130945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}