This is to be done in php5 and ONLY a stand alone piece - no frameworks or integrations.
We need to have done a php class (Object Oriented Programming) that takes specified data input, and returns a final price,
along with a couple of "flags" (0, 1, 2)
We need to be able to call this class such as :
$price = new PricingClass($manu_id);// Just an example, whatever data needs to be initialized is fine, manu_id will be 2-3 letter text code, not a number
$cost = $price->Calculate_Cost($price,$manufacturer,$discount_code,$logger);//Logger is a separate class we have, we'll give you the call to use - for debugging and logging.
$sell_price = $price->Do_Markup($cost,$manufacturer,$weight,$free_ship,$logger);
Return values of Do_Markup should be an array containing final price and the free ship flag (Boolean), at a minimum.
Calculate_Cost should return just the final cost as calculated from settings.
The following settings must be configurable by calling the class - either by using a Set() method,
or directly by setting the variable.
$price->Set_Markup_Array($markup_array); (This would be an array of pairs - PriceBreak => Markup value - used to determine whether a given cost should take a specific markup %)
$price->Discount_Codes = array('A'=>30,'B'=>40,'C'=>25,'N'=>0); (Translates the discount code from price list to the correct discount % - not ethat it must be able to handle possible division by zero issues so it needs to check if the discount multiplier is 0 , and simply return the price value it was handed unchanged. )
$price->MinPrice = '[url removed, login to view]';
$price->HiCentsArray = array('.77','.87','.97');
$price->LoCentsArray = array('.37','.47','.57');
Background: We have been working on a project for a highly customized zen cart. The resulting price will be used not only to create/update
product prices within the cart, but also will be used in writing 2 different types of text files. (we have that already - CSV and space separated files)
We have most of this done, but as the busy season is now upon us, we have no time to write the pricing code we need.
The reason we need a class is because each manufacturer has different price structures, so we need to be able to load the
correct markup array (we can provide examples) and also handle the markup process for each separately - However, since we will only do one price file at a time, persistence of some data is perfectly fine.
For one example:
Manufacturer A - we do not have a cost, it must be calculated from the given price less the discount (see above discount codes)
Manufacturer B - Has a low margin, we want to meet a minimum markup % for this one
Manufacturer C - Better margin, so we can sometimes do a lower markup than MSRP
Manufacturer D - For this one, we also want to be able to look at item weight, if less than x ounces, we add $[url removed, login to view] and return the free ship flag as 1, along with the price.
The winning bidder will be provided sample data for each case, and along with that, the desired results that the code should output.
- All code MUST have error trapping, and check for valid data ranges and types (For example, if a letter is passed where a number expected) - We will also provide a class call (Note the $logger value being passed in examples above) which will be run in the event of any errors or related issues.
The logger code is proprietary, but we do want to have the call inserted to the class. (It is a class itself.) - Class should be able to be tested without the logger code (I.E. if class is not available,
it can write a var_dump)
This project may lead to a hiring on an hourly basis.
6 freelancers are bidding on average $139 for this job
Hi, I have read over your project description and I'm interested in completing your task. I have a 12+ years experience in programming. 8+ experience in PHP