private function getNonAppliedAutomaticCoupons(CartInterface $cart)
    {
        $automaticCoupons = $this
            ->couponRepository
            ->findBy([
                'enforcement' => ElcodiCouponTypes::ENFORCEMENT_AUTOMATIC,
            ]);

        $loadedAutomaticCoupons = $this
            ->cartCouponManager
            ->getCoupons($cart);

        return array_udiff(
            $automaticCoupons,
            $loadedAutomaticCoupons,
            function (CouponInterface $a, CouponInterface $b) {
                return $a->getId() != $b->getId();
            }
        );
    }
private function getNonAppliedAutomaticCoupons(CartInterface $cart)
    {
        $automaticCoupons = $this
            ->couponRepository
            ->findBy([
                'enforcement' => ElcodiCouponTypes::ENFORCEMENT_AUTOMATIC,
            ]);

        $loadedAutomaticCoupons = $this
            ->cartCouponManager
            ->getCoupons($cart);

        return array_udiff(
            $automaticCoupons,
            $loadedAutomaticCoupons,
            function (CouponInterface $a, CouponInterface $b) {
                return $a->getId() != $b->getId();
            }
        );
    }
private function getNonAppliedAutomaticCoupons ( CartInterface $ cart ) { $ automaticCoupons = $ this -> couponRepository -> findBy ( [ 'enforcement' => ElcodiCouponTypes :: ENFORCEMENT_AUTOMATIC , ] ) ; $ loadedAutomaticCoupons = $ this -> cartCouponManager -> getCoupons ( $ cart ) ; return array_udiff ( $ automaticCoupons , $ loadedAutomaticCoupons , function ( CouponInterface $ a , CouponInterface $ b ) { return $ a -> getId ( ) != $ b -> getId ( ) ; } ) ; }
Get current cart automatic coupons.

@param CartInterface $cart Cart

@returns CouponInterface[] Array of non applied coupons
Get current cart automatic coupons .