In Progress

Configurable pricing class - php5 (No MySQL) OOP Specialist

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 = '0.77';

$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.

Skills: PHP, Software Architecture, Zen Cart

See more: zen writing, zen programming, x cart programming, types of programming errors, types of data structures in c, types of data structures, types data structures, set of pairs, set data structures, return oriented programming, programming variable types, programming class, php programming hiring, php object oriented programming, php5.0, OOP programming, object oriented programming in php with examples, object oriented programming examples, object oriented programming example, object oriented programming class, new pricing, need alone writing, manufacturer prices, list in data structures, list data structures

About the Employer:
( 18 reviews ) Roulette, United States

Project ID: #4389508

Awarded to:


hi phpfixer, I can do it for you ... I'm an expert software engineer with more than 7 years of experience in PHP/OOP/Design Patterns .. You can check my profile for more details about me ... looking forward to w More

$77 USD in 2 days
(133 Reviews)

6 freelancers are bidding on average $139 for this job


Hi, I'm an expert php developer.

$90 USD in 2 days
(223 Reviews)

**** Hi sir, I'm very experienced in OOP. I'm a Web Developer having worked for 5+ years with PHP, Java, Solr/Lucene, Sphinx Search, Smarty, MySQL, SQL Server, ASP, JavaScript, Ajax, JQuery and CSS. Please check your More

$75 USD in 3 days
(49 Reviews)

I can do it.

$200 USD in 3 days
(4 Reviews)

ready to start.

$250 USD in 2 days
(9 Reviews)

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

$140 USD in 3 days
(1 Review)

I'm professional PHP programmer, can help you out with this. If you can provide both the markup array examples and desired output (along with explanation about what those HiCentsArray/LoCentsArray actually mean), then More

$200 USD in 5 days
(0 Reviews)