diff --git a/includes/product-functions.php b/includes/product-functions.php index c23fd64f92..7d41e2f628 100644 --- a/includes/product-functions.php +++ b/includes/product-functions.php @@ -583,4 +583,23 @@ function dokan_get_vendor_by_product( $product ) { } return dokan()->vendor->get( $vendor_id ); +} + +/** + * Get translated product stock status + * + * @since DOKAN_LITE_SINCE + * + * @param mix $stock + * + * @return string | array if stock parameter is not provided + */ +function dokan_get_translated_product_stock_status( $stock = false ) { + $stock_status = wc_get_product_stock_status_options(); + + if ( ! $stock ) { + return $stock_status; + } + + return isset( $stock_status[$stock] ) ? $stock_status[$stock] : ''; } \ No newline at end of file diff --git a/templates/products/inventory.php b/templates/products/inventory.php index 992ab53c64..2ea994d00a 100644 --- a/templates/products/inventory.php +++ b/templates/products/inventory.php @@ -20,12 +20,14 @@ array( 'instock' => __( 'In Stock', 'dokan-lite' ), - 'outofstock' => __( 'Out of Stock', 'dokan-lite' ), + 'outofstock' => __( 'Out of Stock', 'dokan-lite' ), + 'onbackorder' => __( 'On Backorder', 'dokan-lite' ), ) ), 'select' ); ?>
+ @@ -55,6 +57,7 @@ +