Availability with backorders not requiring notification.

This commit is contained in:
Mike Jolley 2014-08-15 15:29:10 +01:00
parent 575ba5974e
commit c51fac23e0
2 changed files with 8 additions and 2 deletions

View File

@ -593,9 +593,12 @@ class WC_Product {
break;
}
$class = 'in-stock';
} elseif ( $this->backorders_allowed() ) {
} elseif ( $this->backorders_allowed() && $this->backorders_require_notification() ) {
$availability = __( 'Available on backorder', 'woocommerce' );
$class = 'available-on-backorder';
} elseif ( $this->backorders_allowed() ) {
$availability = __( 'In stock', 'woocommerce' );
$class = 'in-stock';
} else {
$availability = __( 'Out of stock', 'woocommerce' );
$class = 'out-of-stock';

View File

@ -520,9 +520,12 @@ class WC_Product_Variation extends WC_Product {
break;
}
$class = 'in-stock';
} elseif ( $this->backorders_allowed() ) {
} elseif ( $this->backorders_allowed() && $this->backorders_require_notification() ) {
$availability = __( 'Available on backorder', 'woocommerce' );
$class = 'available-on-backorder';
} elseif ( $this->backorders_allowed() ) {
$availability = __( 'In stock', 'woocommerce' );
$class = 'in-stock';
} else {
$availability = __( 'Out of stock', 'woocommerce' );
$class = 'out-of-stock';