src/Backend/Modules/Commerce/Domain/Cart/Cart.php
/**
     * Check if all the products are in stock.
     */
Check if all the products are in stock.
Check if all the products are in stock .
public function isProductsInStock(): bool
    {
        if (!isset($this->allProductsInStock)) {
            $inStock = true;
            foreach ($this->getValues() as $value) {
                if (!$value->isInStock()) {
                    $inStock = false;
                }
            }
            $this->allProductsInStock = $inStock;
        }
        return $this->allProductsInStock;
    }
public function isProductsInStock ( ) : bool { if ( ! isset ( $ this -> allProductsInStock ) ) { $ inStock = true ; foreach ( $ this -> getValues ( ) as $ value ) { if ( ! $ value -> isInStock ( ) ) { $ inStock = false ; } } $ this -> allProductsInStock = $ inStock ; } return $ this -> allProductsInStock ; }
Check if all the products are in stock.
Check if all the products are in stock .