calculateSingleItemCost: Single item cost

Description Usage Arguments Value

Description

Function calculates a cost for a specified amount of single item including regular price and special price for buying a set amount of items

Usage

1
calculateSingleItemCost(itemName, itemCount, products)

Arguments

itemName

name of an item for which the price will be calculated

itemCount

total amount of item to purchase

products

a data.frame contaning all available products with their regular prices and special prices

Value

Function returns a data.frame with 4 columns ("Item", "Count", "Discount" and "Cost") and 1 or 2 rows (1 row if only regular or special price is used, 2 rows if both of these prices are used)


komisarczyks/CheckoutComponent documentation built on May 20, 2019, 12:55 p.m.