modules/acm_cart/src/Access/CartAccess.php
public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {
    return AccessResult::allowedIf(
      $this->cartStorage->getCart() && $this->cartStorage->getCart()->getCartItemsCount() > 0
    );
  }
public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {
    return AccessResult::allowedIf(
      $this->cartStorage->getCart() && $this->cartStorage->getCart()->getCartItemsCount() > 0
    );
  }
public function access ( Route $ route , RouteMatchInterface $ route_match , AccountInterface $ account ) { return AccessResult :: allowedIf ( $ this -> cartStorage -> getCart ( ) && $ this -> cartStorage -> getCart ( ) -> getCartItemsCount ( ) > 0 ) ; }
Determine access by ensuring that the cart object has items.

@param \Symfony\Component\Routing\Route $route
The route to check against.
@param \Drupal\Core\Routing\RouteMatchInterface $route_match
The parametrized route.
@param \Drupal\Core\Session\AccountInterface $account
The currently logged in account.

@return \Drupal\Core\Access\AccessResultInterface
The access result.
Determine access by ensuring that the cart object has items .