public function forItem(CartItem $item)
    {
        if (config('laracart.tax_item_before_discount')) {
            return $item->subTotal(false, false, false, true) * $this->value;
        }

        return $item->price * $this->value;
    }
public function forItem(CartItem $item)
    {
        if (config('laracart.tax_item_before_discount')) {
            return $item->subTotal(false, false, false, true) * $this->value;
        }

        return $item->price * $this->value;
    }
public function forItem ( CartItem $ item ) { if ( config ( 'laracart.tax_item_before_discount' ) ) { return $ item -> subTotal ( false , false , false , true ) * $ this -> value ; } return $ item -> price * $ this -> value ; }
If an item is supplied it will get its discount value.

@param CartItem $item

@return float
If an item is supplied it will get its discount value .