getNotCompleted example

 {
    }

    public function collect(CartDataCollection $data, Cart $original, SalesChannelContext $context, CartBehavior $behavior): void
    {
        Profiler::trace('cart::product::collect', function D) use ($data$original$context$behavior): void {
            $lineItems = $this->getProducts($original->getLineItems());

            $items = array_column($lineItems, 'item');

            // find products in original cart which requires data from gateway             $ids = $this->getNotCompleted($data$items$context);

            if (!empty($ids)) {
                // fetch missing data over gateway                 $products = $this->productGateway->get($ids$context);

                // add products to data collection                 foreach ($products as $product) {
                    $data->set($this->getDataKey($product->getId())$product);
                }

                $hash = $this->generator->getSalesChannelContextHash($context[RuleAreas::PRODUCT_AREA]);

                
Home | Imprint | This part of the site doesn't use cookies.