The quoting tool went by many names, the "Pricing Configurator" was the one used most commonly, but this was a tool I developed whilst at Splicecom to aid their clients in picking out items for their customers and calculating the price. Essentially, it was a complex version of the checkout process of most sites, including a full custom-coded CMS to add/remove projects, keep track of price changes and a change-log and create custom deals for various products or clients.
The Quoting Page includes a section with a series of categories along the left side where you can access various products to add to your quote. This opens in the form of various modals. Some of these products are nested into other products and their setup for pricing can get quite complex. Such as one product where when you order it, get a license item added for free and for every 3rd quantity of that product you get a discount on another item.
I put in a huge amount of work into making this tool both flexible, easy-to-adjust and able to work for every client who might use it. Quote-assigning features to allow multiple users to work on the same quote. Audit logs that shows every activity on a quote to log who made what change, all of this made both checking out for the user, updating the system for our administrators and resolving issues much easier.
The calculations script uses while loops and arrays to set each product and it's settings up and then calculate their total. It starts by setting a number of arrays for each product, offer and custom product. Then it proceeds to pull out the information from the relevant database tables and parse it into a format that can be inserted into the summary table. The opening section examines the offers that have been set up in the system and sees if any have been chosen for the quote. If they have it'll find out what type of offer it is and what effect this will have on the quote. For Example, a "free item" offer will add a number of free items into the quote, a discount offer will apply a discount on any defined items that are added into the quote, and an "over x pricing" offer will see if the quantity ordered is over x and then set the quantity to x and add the remainder over x to a special "over x pricing".
if ($config_bundle_item != NULL && $config_bundle_quantity != ""){ $id[] = $config_bundle_item; $type[] = 'user selected bundle'; if($original_part_quantity > 0 && $add_to_bundle_item > 0 && $apply_additional_per == 'on'){ $add_to_bundle_item=$add_to_bundle_item*$original_part_quantity; } else if ($add_to_bundle_item > 0) { $add_to_bundle_item = $add_to_bundle_item; } if($add_to_bundle_item > 0 && $apply_additional_free != 'on'){ $custom_quantity[] = $config_bundle_quantity + $add_to_bundle_item; } else { $custom_quantity[] = $config_bundle_quantity; } $custom_quantity_postcalc[] = $config_bundle_quantity + $add_to_bundle_item; $query_user_selected = "SELECT * FROM the_pricing_table WHERE id = '$config_bundle_item' AND type = '$config_type' AND price_band = '$creator_pricing_band' LIMIT 1"; $response_user_selected = mysqli_query($database_connection, $query_user_selected); //count the number of rows, if the number is equal to zero then the product has no pricing and is just a container for sub-products. So instead it goes to get the product info from the sub product pricing table instead of the product pricing table if(mysqli_num_rows($response_user_selected)==0){ $query_user_selected = "SELECT sub_product as name,number as number,sub_setup as product_setup,sub_monthly as product_monthly,sub_outright as product_outright, sub_transfer as product_transfer FROM sub_pricing as pspp INNER JOIN products as ppp ON pspp.id=ppp.id WHERE pspp.id = '$config_bundle_item' AND ppp.type = '$config_type' AND pspp.sub_band = '$creator_pricing_band' LIMIT 1"; $response_user_selected = mysqli_query($database_connection, $query_user_selected); } while ($row = mysqli_fetch_array($response_user_selected, MYSQLI_ASSOC)){ $custom_name[] = $row['name']; $custom_part[] = $row['product_part']; $custom_setup[] = $row['product_setup']; $custom_monthly[] = $row['product_monthly']; $custom_outright[] = $row['product_outright']; $custom_transfer[] = $row['product_transfer']; } }
One of the fun challenges with creating this checkout tool was that Splicecom offered multiple different price bands for different customers. A "gold" customer would get access to different pricing to a "Silver" customer. I created a system where that pricing would be automatically logged into a changelog system and then administrators could choose when to or not to release that information publically, so that clients could easily see the most recent changes to pricing. The site also contained a place where it would generate these price-lists into downloadable xls files.
Along with the client-side features, I created a price-band manager, where product pricing changes could be made and released to the public. It also allowed for the creation of an entire price band for a different currency by simply entering an exchange rate and clicking a button.
The Price Builder was a tool to allow our administrators to set up products that had pricing that was a little bit more complicated than just price x quantity. It has a series of settings and forms that apply for each product to change the way that it's price is calculated or to include additional items with it. Any options on the left that have a blue target next to them are areas where settings have already been set for a product.