public function products(Basket $basket)
    {
        $products = [];

        foreach ($basket->products() as $product) {
            $products[] = [
                'sku'            => $product->sku,
                'name'           => $product->name,
                'price'          => $product->price,
                'rate'           => $product->rate,
                'quantity'       => $product->quantity,
                'freebie'        => $product->freebie,
                'taxable'        => $product->taxable,
                'delivery'       => $product->delivery,
                'coupons'        => $product->coupons,
                'tags'           => $product->tags,
                'discount'       => $product->discount,
                'attributes'     => $product->attributes,
                'category'       => $product->category,
                'total_value'    => $this->reconciler->value($product),
                'total_discount' => $this->reconciler->discount($product),
                'total_delivery' => $this->reconciler->delivery($product),
                'total_tax'      => $this->reconciler->tax($product),
                'subtotal'       => $this->reconciler->subtotal($product),
                'total'          => $this->reconciler->total($product)
            ];
        }

        return $products;
    }
public function products(Basket $basket)
    {
        $products = [];

        foreach ($basket->products() as $product) {
            $products[] = [
                'sku'            => $product->sku,
                'name'           => $product->name,
                'price'          => $product->price,
                'rate'           => $product->rate,
                'quantity'       => $product->quantity,
                'freebie'        => $product->freebie,
                'taxable'        => $product->taxable,
                'delivery'       => $product->delivery,
                'coupons'        => $product->coupons,
                'tags'           => $product->tags,
                'discount'       => $product->discount,
                'attributes'     => $product->attributes,
                'category'       => $product->category,
                'total_value'    => $this->reconciler->value($product),
                'total_discount' => $this->reconciler->discount($product),
                'total_delivery' => $this->reconciler->delivery($product),
                'total_tax'      => $this->reconciler->tax($product),
                'subtotal'       => $this->reconciler->subtotal($product),
                'total'          => $this->reconciler->total($product)
            ];
        }

        return $products;
    }
public function products ( Basket $ basket ) { $ products = [ ] ; foreach ( $ basket -> products ( ) as $ product ) { $ products [ ] = [ 'sku' => $ product -> sku , 'name' => $ product -> name , 'price' => $ product -> price , 'rate' => $ product -> rate , 'quantity' => $ product -> quantity , 'freebie' => $ product -> freebie , 'taxable' => $ product -> taxable , 'delivery' => $ product -> delivery , 'coupons' => $ product -> coupons , 'tags' => $ product -> tags , 'discount' => $ product -> discount , 'attributes' => $ product -> attributes , 'category' => $ product -> category , 'total_value' => $ this -> reconciler -> value ( $ product ) , 'total_discount' => $ this -> reconciler -> discount ( $ product ) , 'total_delivery' => $ this -> reconciler -> delivery ( $ product ) , 'total_tax' => $ this -> reconciler -> tax ( $ product ) , 'subtotal' => $ this -> reconciler -> subtotal ( $ product ) , 'total' => $ this -> reconciler -> total ( $ product ) ] ; } return $ products ; }
Process the Products

@param Basket $basket
@return array
Process the Products