Beskrivelse
Woo Webalive Stock Status Premium lets you override WooCommerce's default stock messages ("In stock", "Out of stock", "Available on backorder", etc.) with fully custom text and colors — either globally, per product, or per variation.
Key features
- Custom stock status label + color + font size for each WooCommerce default status.
- Per-product override (Simple, Grouped, Bundle, Composite, Variable, Variation).
- Grouped-product listing status.
- Show/hide status in shop page, cart, checkout, order emails, WooCommerce invoices and Gutenberg product blocks.
- Move stock status below the Add-to-Cart button or before the price.
- Hide default sad-face for out-of-stock.
- Show custom stock status in Order Emails and (optionally) prefix with "Stock Status:".
- Shortcodes:
[woo_custom_stock_status product_id="123"]— output the custom status for a product.[wcss_learn_more url="…" text="Learn more"]— inline link snippet.[wcss_delivery_date days="4" excluded_days="sat,sun"]— dynamic delivery-date snippet.
- Polylang string-translation support for stock statuses.
- Compatibility integrations: WP All Import, YITH Wishlist, Yoast SEO, PDF Invoices & Packing Slips, Porto theme, OceanWP theme, WoodMart theme, B2BKing, WooCommerce Product Bundles, WPC Composite Products, AutomateWoo.
- Block support: cart & checkout blocks, related-products block.
About this fork
This plugin is a WebAlive rebrand of "Advanced Custom Stock Status" 1.6.6 by Softound Solutions (GPLv2). All upstream pro-gates (is_plugin_active( 'woo-custom-stock-status-pro/...' )) have been unlocked so previously locked branches (category-level stock status via term meta, quantity-based status, promo-free UI) run without the upstream pro plugin. Post meta keys, option keys (wc_slr_*), shortcode names, CSS classes and Store-API namespaces are preserved unchanged so activating this plugin after deactivating the upstream one migrates 1:1 without data loss.
Ændringslog
1.2.5
- Marked as tested with WordPress 7.1 and WooCommerce 11.1.0.
1.2.4 (2026-08-23)
- Change: Removed the temporary WWSMP warehouse-location integration and dependency. Row, Rack and Shelf fields are owned and rendered by Woo Webalive Smart Manager Premium.
1.2.3 (2026-08-23)
- Fix: Show the WWSMP Row, Rack and Shelf fields in the WooCommerce product editor's Inventory tab when Woo Webalive Smart Manager Premium is active.
1.2.2 (2026-08-23)
- Integration: Woo Webalive Smart Manager Premium is now a required dependency. Its existing Row, Rack and Shelf location fields (
_wwsmp_loc_row,_wwsmp_loc_rack,_wwsmp_loc_shelf) remain available in the WooCommerce product editor's Inventory tab and use WWSMP's canonical storage and save handling.
1.2.1 (2026-07-27)
- Fix: When the "Expected back in stock" restock date notice is displayed, the WWSS custom availability label (e.g. "Remote stock - 4-5 days") is now automatically hidden on the same product to avoid duplicate/contradictory messaging. Applies to Simple, Variable, Bundle, Composite and Variation product types. No effect when no restock date is set, when the date is in the past, or when the product is back in stock.
1.2.0 (2026-07-21)
- New: Built-in extra stock status set that replaces a common Danish workflow snippet. Ships five additional statuses selectable from the product edit dropdown:
pre_order— "Pre order"contact_us— "Contact us for delivery"ondemand— "Order item" (bestillingsvare)remote_1week— "Remote stock - 4-5 days"discontinued— "Discontinued" (product not purchasable, add-to-cart hidden)
- Each status gets its own frontend availability text (
woocommerce_get_availability) and admin-list stock html (woocommerce_admin_stock_html), matching the original snippet 1:1. discontinuedproducts are automatically marked not-purchasable viawoocommerce_is_purchasable+woocommerce_variation_is_purchasable, so the add-to-cart button disappears.- All new strings live in the
woo-wa-stock-statustextdomain (English source); Danish / other-language shops translate via the standard.poworkflow. - All CSS classes emitted by the module (
in-stock,out-of-stock,bestillings-vare,contact-us,on-demand) match the snippet so existing custom CSS keeps working.
1.1.6 (2026-07-13)
- Fix: The loop (shop / category / search) label "Alternative:" is now also wrapped in
_n()(with hardcoded count 1) so Poedit no longer flags the msgid as being used both with and without plural forms. Single-product and loop contexts now share one plural-aware_n('Alternative:', 'Alternatives:', $count, ...)entry.
1.1.5 (2026-07-13)
- i18n: The alternative-products label on the single product page is now singular/plural aware via
_n()— "Alternative:" when there is exactly one configured alternative, "Alternatives:" for two or more. The loop label was already singular ("Alternative:").
1.1.4 (2026-07-13)
- Change: Alternative-product thumbnail on the single product page is now 100x100 (was 60x60).
1.1.3 (2026-07-13)
- Fix: The rich alternative-products card (image + title + price + stock) is now ONLY shown on the single product page. On shop / category / search-results / other overview pages the alternative is rendered as plain text — "Alternative:
" — with only the FIRST alternative shown, matching the pre-1.1.2 loop behavior.
1.1.2 (2026-07-13)
- Improved: Alternative products are now shown as a rich card list with product image (60x60), title, price and (optional) stock status — instead of a plain inline link list.
- New: On shop / category / search result pages only the FIRST alternative is shown (with a smaller 44x44 image), keeping category cards compact. Single product pages still show all configured alternatives.
- New: Stock status for alternatives can be toggled off under WooCommerce → Settings → Custom Stock → Restock Notice → "Show stock status for alternatives" (option
wc_slr_restock_alt_show_stock, defaultyes). The alternative product’s custom WWSS stock label is honored automatically since we render viawc_get_stock_html().
1.1.1 (2026-07-13)
- New: "Settings" shortcut link on the Plugins page (next to Activate/Deactivate) pointing at WooCommerce → Settings → Custom Stock.
1.1.0 (2026-07-13)
- New: Absorbed the "Woo Webalive Stock Date" (WSD) plugin. Restock date + Alternative products are now first-class WWSS features and WSD can be deactivated.
- Per-product Inventory-panel fields (
_wwss_restock_date,_wwss_alternative_products) for simple, grouped and variable products, plus per-variation date field. - Frontend notice on single product pages (with robust triple-hook fallback:
woocommerce_single_product_summaryprio 25/35 +woocommerce_product_meta_start+woocommerce_after_single_product_summary, deduped via a static flag) so the notice also renders on discontinued products where the add-to-cart form is suppressed and on themes with custom summary templates. - Per-variation notice injection via
woocommerce_available_variation+ JS that swaps into the existing.gmrbw-variation-availabilityblock with a short-lived MutationObserver guard. - Optional shop-loop card rendering with separate color/font/spacing controls.
- New settings section WooCommerce → Settings → Custom Stock → Restock Notice (
wc_slr_restock_*options) mirroring the previous WSD settings. - Alternative products are ALWAYS shown when configured, regardless of stock status or restock-date presence — including on discontinued items — and are NOT filtered by
is_visible().
- Per-product Inventory-panel fields (
- New: One-time WSD → WWSS data migration (
WebAlive\WWSS\Infrastructure\WsdMigration). Runs onadmin_init/cron in 200-product batches: copies_wsd_restock_date→_wwss_restock_dateand_wsd_alternative_products→_wwss_alternative_productsfor both products and variations, and copies the 13wsd_*global options into thewc_slr_restock_*namespace. Idempotent (never overwrites a pre-existing WWSS-side value; setswwss_wsd_migration_done=1when finished; writes a per-run report towwss_wsd_migration_report).
1.0.6 (2026-07-11)
- New: "Discontinued" as a first-class 7th stock status. Adds a per-product checkbox in the Inventory panel (Product edit → Beholdning → Marker som udgået) that, when checked, overrides the displayed availability with the custom Discontinued label, blocks add-to-cart via
woocommerce_is_purchasable, and reportsschema.org/Discontinuedto Yoast SEO and Google Shopping.discontinuedis a full key in$status_array/$status_color_array/$status_font_size_array, so the existing settings UI (WooCommerce → Settings → Custom Stock → Stock Status) auto-renders a row for the label + color + font size, and the existing per-product custom-text loop in the product tab auto-renders a text field. Meta key_wwss_discontinuedholds the boolean flag; the label text falls back through per-productdiscontinuedpost meta → globalwc_slr_discontinuedoption → hard-coded "Discontinued". - New:
wc_slr_schema_discontinuedmapping in the schema-availability section (defaults toDiscontinued, honors the same "Auto" option as the other 6 mappings). - New: Extended
Woo_Stock_With_Yoast_Seo::determine_wc_state()to recognise the Discontinued flag before any WooCommerce state resolution, so Yoast schema + og:availability meta tags follow the flag on every product where it is set.
1.0.5 (2026-07-09)
- New: 3-tier quantity-based stock statuses. When enabled under WooCommerce → Settings → Custom Stock, the plugin picks one of three custom labels based on the stock quantity:
high_stock_status_label(qty >= high threshold),medium_stock_status_label(qty >= medium threshold),low_stock_label(qty > 0 but below medium). Useful for showing friendly text like "Godt på lager" / "Begrænset lager" / "Kun få tilbage" without exposing exact counts. The pro-only rendering code was already unlocked in 1.0.0; 1.0.5 adds the missing UI fields (checkbox + 2 number thresholds + 3 text labels). - New: Schema.org availability mapping for Yoast SEO / Google Shopping. Adds one dropdown per WooCommerce state (in_stock, only_s_left_in_stock, s_in_stock, can_be_backordered, available_on_backorder, out_of_stock) that maps to a schema.org
ItemAvailabilityvalue (InStock, OutOfStock, BackOrder, PreOrder, LimitedAvailability, InStoreOnly, OnlineOnly, SoldOut, Discontinued) or "Auto" (WooCommerce default). This lets a shop relabel e.g.out_of_stockas "Fjernlager 4-5 dage" for humans while still reportingInStock(orBackOrder) to Google, so the product doesn't drop out of shopping results. - Fix: Yoast SEO integration was writing the custom label text (e.g. "Fjernlager 4-5 dage") into
schema.org/Product.offers.availability, which only accepts fixed enum values. Google would silently reject the invalid value and fall back to WooCommerce's default (usuallyOutOfStock), so relabelled products lost their Google Shopping visibility. RewroteWoo_Stock_With_Yoast_Seo::change_schema_stock_status()to (a) determine the underlying WooCommerce state from the product object, (b) look up the admin's schema mapping for that state, (c) write a full schema.org URL (https://schema.org/InStocketc.) intoavailability. If the admin has not mapped a state, WooCommerce's original value is left untouched. Also cleaned up the og:availability / product:availability meta tag output to use the schema value with a graceful fallback to the custom text (backward-compatible with prior behavior).
1.0.4 (2026-07-09)
- Fix: The 6 default stock-status labels ("In stock", "Only %s left in stock", "(can be backordered)", "%s in stock", "Available on backorder", "Out of stock") — plus their color-picker and font-size labels — are hard-coded values inside
$status_array/$status_color_array/$status_font_size_arrayclass properties, so Poedit's static extractor could not find them. Runtime code correctly calls__( $dynamic_label, 'woo-wa-stock-status' )which DOES pick up a translation if the string is in the.mo— the bug was purely on the extraction side. Added a private no-op method_register_default_labels_for_i18n()inWoo_Stock_Basethat lists all 22 default labels wrapped in__(); it never executes at runtime (guarded byif ( true ) return;) but is scanned by Poedit's "Update from source" and adds the strings to the.pot/.po. After deploying: open Poedit, choose Catalog → Update from source, translate the newly appearing entries, Save (auto-rebuilds.mo), and re-upload the language files.
1.0.3 (2026-07-09)
- Fix: Danish (and other) translations from
languages/*.mowere not being applied becauseload_plugin_textdomain()was called synchronously fromPlugin::boot()atplugins_loadedpriority 1. Since WordPress 6.7 the recommended time to load a plugin's textdomain is on theinitaction — calling earlier triggers a_doing_it_wrongnotice and, more importantly, WooCommerce settings screens (which fire their__()calls during rendering onadmin_menu→ far later thanplugins_loaded) never saw the translations applied. Moved the textdomain loader toadd_action( 'init', ... )with priority 5. - Fix: gettext warning “Message contains an embedded URL†at class-wc-stock-general.php:189. The desc_tip for “Hide Stock Status in Woocommerce Invoice†embedded a hard-coded HTML link inside the translatable string; translators would have had to reproduce the exact tag structure. Extracted the URL and plugin name into
sprintf()placeholders so only the human-readable sentence needs translating.
1.0.2 (2026-07-09)
- Improvement: General settings are now the effective fallback for ALL product types when a product’s per-product custom stock text fields are empty. Previously the fallback chain (product meta → category meta → global option → hardcoded English) worked reliably for Simple products, but Variable / Variation products had multiple code paths where the chain never reached
wc_slr_*(global option) and dropped straight to the English hardcoded label. Fix: prime$in_stock,$out_of_stock,$only_s_left_in_stock,$s_in_stock,$can_be_backorderedand$available_on_backorderfrom the correspondingwc_slr_*option at the start ofwoo_rename_stock_status(). This makes WooCommerce → Settings → Custom Stock the true site-wide default — no per-product typing needed, works uniformly for Simple, Variable, Variation, Bundle, Composite and Grouped. - UI: Removed the disabled “Insert new status†button and its footer row from WooCommerce → Settings → Custom Stock → Stock Status (was a pro-only teaser in the upstream free plugin; misleading in our port since the pro plugin isn’t needed).
1.0.1 (2026-07-09)
- Fix: Fatal
Cannot declare class Woo_Stock_Basewhen the upstream free plugin "Advanced Custom Stock Status" is still active on the same site. The bootstrap now detects the upstream plugin (both by classes-already-declared and byis_plugin_active( 'woo-custom-stock-status/woo-custom-stock-status.php' )) and bails out early with a persistent admin notice asking the site owner to deactivate it. Prevents PHP fatal on activation while still allowing a straight 1:1 swap (deactivate old → activate new; data is preserved).
1.0.0 (2026-07-09)
- Initial WebAlive release, ported from Advanced Custom Stock Status 1.6.6.
- Rebrand: Plugin name, author, headers, PSR-4 namespace (
WebAlive\WWSS), text domain (woo-wa-stock-status), constants (WWSS_VERSION,WWSS_FILE,WWSS_PATH,WWSS_URL,WWSS_BASENAME), main runtime class (WWSS_Plugin). - Bootstrap: Minimal entry file (
woo-wa-stock-status.php) + PSR-4 autoloader +WebAlive\WWSS\Plugin::boot()onplugins_loadedpriority 1. WooCommerce-active guard moved to the bootstrap; legacy runtime lives inclass-wwss.php. - Pro-unlock: All 8
is_plugin_active( 'woo-custom-stock-status-pro/...' )checks replaced withtrue, so category-level stock statuses (term meta), quantity-based statuses and pro-only UI branches all run without an external pro plugin. - Cleanup: Removed screenshots directory, empty
index.htmlplaceholders and softound.com promo strings from the Polylang admin notice, the settings section title and the "Insert new status" footer. Dead-code promo strings behindif( ! true )gates are left in place for minimum-diff traceability but never render. - Compatibility: Declared HPOS (
custom_order_tables) and Cart/Checkout Blocks compatibility. - Updates: Delivered via the WebAlive update server at
https://updates.webalive.dk;Update URI:header points at?action=get_metadata&slug=woo-wa-stock-status. - Data continuity: All option keys (
wc_slr_*), post meta keys, term meta keys, shortcodes ([woo_custom_stock_status],[wcss_learn_more],[wcss_delivery_date]), CSS classes (.woo-custom-stock-status), block Store-API namespace (woo_custom_stock_status) and Polylang string groups are preserved unchanged for 1:1 migration from the upstream free plugin.