Skip to content

Commit

Permalink
Merge pull request woocommerce#24559 from itzmekhokan/fix/24458
Browse files Browse the repository at this point in the history
Fix backordered product missing backordered label on frontend
  • Loading branch information
kloon authored Oct 2, 2019
2 parents f15353c + dcf3d71 commit c01a091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/abstracts/abstract-wc-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,8 @@ protected function get_availability_text() {
$availability = __( 'Out of stock', 'woocommerce' );
} elseif ( $this->managing_stock() && $this->is_on_backorder( 1 ) ) {
$availability = $this->backorders_require_notification() ? __( 'Available on backorder', 'woocommerce' ) : '';
} elseif ( ! $this->managing_stock() && $this->is_on_backorder( 1 ) ) {
$availability = __( 'Available on backorder', 'woocommerce' );
} elseif ( $this->managing_stock() ) {
$availability = wc_format_stock_for_display( $this );
} else {
Expand All @@ -2018,7 +2020,7 @@ protected function get_availability_text() {
protected function get_availability_class() {
if ( ! $this->is_in_stock() ) {
$class = 'out-of-stock';
} elseif ( $this->managing_stock() && $this->is_on_backorder( 1 ) ) {
} elseif ( ( $this->managing_stock() && $this->is_on_backorder( 1 ) ) || ( ! $this->managing_stock() && $this->is_on_backorder( 1 ) ) ) {
$class = 'available-on-backorder';
} else {
$class = 'in-stock';
Expand Down

0 comments on commit c01a091

Please sign in to comment.