einstein101 Posted January 28, 2008 Share Posted January 28, 2008 Hi. I need to know how to develop a similar page like the one below. If you click on a different item and put the sizes in, it puts the price in automatically. How is this done using php? Do they use a database? Something other than php on the front end? Can anyone give me an example of how it would be done? http://www.customfilters.grainger.com/index.php/fgCatalog/main/set=HVACPL40STC Thanks in advance for your help. I'm really confused as to how this would be done. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/ Share on other sites More sharing options...
hitman6003 Posted January 28, 2008 Share Posted January 28, 2008 Most likely they take the total area of the filter (WxL), along with a modifier for the thickness, and compute the price that way. So, if the total area is 100 in^2 (10 in x 10 in), with a thickness of 2 inches, and the standard price for a 2 inch thick filter is 25 cents per square inch, the final price would be .25 * 100 = $25. Although there are a lot of different ways...maybe they have a general price for size ranges. Maybe they have some fat guy on the other end that sees the request and makes up a number. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451480 Share on other sites More sharing options...
laffin Posted January 28, 2008 Share Posted January 28, 2008 it's done using javascript. u can find some examples here Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451490 Share on other sites More sharing options...
hitman6003 Posted January 28, 2008 Share Posted January 28, 2008 it's done using javascript. The implementation he is referring to does not use javascript to show the price...it requires a page submit (at least for me) to update the price per filter. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451498 Share on other sites More sharing options...
laffin Posted January 28, 2008 Share Posted January 28, 2008 oh, i took a quick look at it. yep, php, prolly tied to a db. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451501 Share on other sites More sharing options...
einstein101 Posted January 28, 2008 Author Share Posted January 28, 2008 Yes. It looks like when you click on a filter it loads a different page. So, they probably send the information to the server to calculate. I am getting the picture now. But, the values are probably not in a database then. Example: Filter 1 page has, as the previous post suggested a set multiplier. $filter1 = .25 and if you plug in 10 x 10 you multiply by the factor and place the value into the price. Does that make sense? It seems that if it used a database would it load a new page for each filter? Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451503 Share on other sites More sharing options...
Psycho Posted January 28, 2008 Share Posted January 28, 2008 Why would you think it isn't in a database? I would rather have pricing information in a database with an administration opage where it can be easily editied as opposed to having it hard-coded in a server-side file. The fact that the info is or is not in a database has nothing to do with whether or not a new page is loaded. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451518 Share on other sites More sharing options...
laffin Posted January 28, 2008 Share Posted January 28, 2008 exactly, the db can also state if pricing goes by square feet (such as sheets) or by pieces (such as tiles). and adjust the calculators to follow suit. Quote Link to comment https://forums.phpfreaks.com/topic/88238-how-is-this-done-using-php/#findComment-451520 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.