The next functionality we need to build for the administrator is to manage the pricing per Foldagram based on range. Jordan wants to give discounts to users who buy credits (buy credits and prepay for Foldagram). Say if you are buying seven credits, you will pay less as the Foldagram price will depend on the range as follows:
1 to 4 Foldagrams: 4 USD/Foldagram or per credit
5 to 10 Foldagrams: 3.5 USD/Foldagram or per credit
11 to 20 Foldagrams: 3 USD/Foldagram or per credit
We will need to build an interface that will allow our admin to add price and also manage pricing. Let's start building an interface for to add pricing.
As you can see, the interface is quite simple; we just need to ask admin about the "from" quantity and the "to" quantity and the price for that range. Here is the Controller and View file for generating the form:
public function getadd() { return View::make('admin.add_credit')->with('title','Foldagram - Admin...