Write a Simple C# function -- 2
Budget: $10 – $30 USD
NOTE: do not bid more than $25
--------------------------------------------------------
Here is the required info:
- Configurable products: products with options based on an attribute, like color and/or size.
- When one is added to a customer's cart, there will actually be 2 items added in the backend: 1 is a simple product (that has the attributes that the customer chose) and 1 configurable product (that will have the relevant price value for the item).
- the function should enter only the simple (for the inventory items), but the price may only be obtained from the configurable.
- Each related simple has either the parent_item_id equal to its corresponding configurable item_id in the same order OR the related configurable will come directly before/after the simple in the same order.
- Independent simple items do not have the parent_item_id .
Task:
Write a function to return a variable (called SaleItems) with the prices for all inventory items in an order.
- for each price I store it in the variable SaleItems[I].price, and the item id in in SaleItems[I].Item_id
- the function should take an input of ASale.items, where
- ASale.items[J] is the price of item J
- ASale.items[J].product_type is item type (eg. 'configurable or 'simple') of item J
- ASale.items[J].parent_item_id is the parent item id (if any) of item J
- ASale.items[J].item_id is the item id of item J
- ASale.items[J].sku is an indicator that the configurable comes AFTER (not before)
Write a test script to prove the function works for different combinations of inputs.
*NOTE* I will send you basically the same code in another language (which is easy to understand).
--------------------------------------------------------
Here is the required info:
- Configurable products: products with options based on an attribute, like color and/or size.
- When one is added to a customer's cart, there will actually be 2 items added in the backend: 1 is a simple product (that has the attributes that the customer chose) and 1 configurable product (that will have the relevant price value for the item).
- the function should enter only the simple (for the inventory items), but the price may only be obtained from the configurable.
- Each related simple has either the parent_item_id equal to its corresponding configurable item_id in the same order OR the related configurable will come directly before/after the simple in the same order.
- Independent simple items do not have the parent_item_id .
Task:
Write a function to return a variable (called SaleItems) with the prices for all inventory items in an order.
- for each price I store it in the variable SaleItems[I].price, and the item id in in SaleItems[I].Item_id
- the function should take an input of ASale.items, where
- ASale.items[J] is the price of item J
- ASale.items[J].product_type is item type (eg. 'configurable or 'simple') of item J
- ASale.items[J].parent_item_id is the parent item id (if any) of item J
- ASale.items[J].item_id is the item id of item J
- ASale.items[J].sku is an indicator that the configurable comes AFTER (not before)
Write a test script to prove the function works for different combinations of inputs.
*NOTE* I will send you basically the same code in another language (which is easy to understand).