PHP Classes

ShoppingOptimizer: Find shopping cart items with most discounts

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 83 All time: 9,971 This week: 114Up
Version License PHP version Categories
shoppingoptimizer 1.0.0GNU General Publi...5.5PHP 5, E-Commerce


This class can find shopping cart items with most discounts.

It can take an array of items and a list of available coupons to find the those that provide the greatest discount on the whole shopping cart items total.

The class returns a list of possible cart combinations using the different discount coupons that can be applied.

Innovation Award
PHP Programming Innovation award nominee
December 2017
Number 12
Many sites implement shopping carts that support applying one or more discount coupons.

Each discount coupon may provide a better discount than others. This class is able to find which coupon of a list is better.

Manuel Lemos
Picture of Ovunc Tukenmez
  Performance   Level  
Name: Ovunc Tukenmez <contact>
Classes: 14 packages by
Country: Turkey Turkey
Age: 37
All time rank: 72111 in Turkey Turkey
Week rank: 61 Up4 in Turkey Turkey Up
Innovation award
Innovation award
Nominee: 6x


ShoppingOptimizer PHP Class

<strong>ShoppingOptimizer </strong> is a <strong>PHP</strong> class that is used to find the most profitable ways to purchase items using cart discount coupons in one or multiple cart parts.

Example script is included in the package. (example.php)<br /> <h2>Sample Outputs</h2> <ul> <li>Example with no budget limit (example_output.html) (example_output_sample.png)</li> <li>Example with budget (example_with_budget_output.html)</li> </ul>

<h2>Public Methods of Class</h2> <ul> <li>getAvailableCartSortOrders()</li> <li>getCartSortOrders()</li> <li>getCoupons()</li> <li>getDiscountedCarts()</li> <li>removeMaximumBudget()</li> <li>resetItems()</li> <li>setCartSortOrders()</li> <li>setCoupons()</li> <li>setDefaultCartSortOrders()</li> <li>setItems()</li> <li>setMaximumBudget()</li> <li>setOnlyDistinctSum()</li> </ul>

<h2>Class Requirements</h2> <ul> <li>PHP 5 >= 5.5.0</li> </ul>

Thanks for checking out this class! If you have improvement idea or bug fix, please feel free to contribute this class.<br /> <br /> <br /> Ovunc Tukenmez

  example script outputExternal page   example script with budget outputExternal page  
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Accessible without login HTML file example_output.html Output Sample output
Accessible without login Image file example_output_sample.png Data Auxiliary data
Accessible without login HTML file example_with_budget_output.html Output Sample output
Accessible without login Plain text file Doc. Documentation
Plain text file ShoppingOptimizer.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,971
This week:114Up