logo
Previous Thread
Next Thread
Print Thread
#145114 06/27/03 04:51 PM
Joined: Jan 2005
Posts: 1
Newbie
OP Offline
Newbie
Joined: Jan 2005
Posts: 1
Hi,
I am trying to create some asp code for a instant quote on a website.
Basically what I need to know is, how to code a lookup table.
Example: If someone orders 10 shirts and want 2 colors on the front, I need to beable to look up how much it will cost per shirt to have 2 colors.
10 shirts - 2 colors would be 3.10, but 13 shirts with 3 colors would be 3.00 and so on (12 colors and 11 different quantity fields, which total 132 different amounts).
Can this be easily done with a if then statement?


M.L.
Sponsored Post Advertisement
#145115 07/14/03 01:59 PM
Joined: Sep 2004
Posts: 1
Newbie
Offline
Newbie
Joined: Sep 2004
Posts: 1
You can't just look it up - you'd have to create a gigantic array with every single combination in it! That would be a nightmare.

The way that most people would do this is to handle each condition separately.

So first, you determine the price for a single shirt. Say that a shirt costs $7.50 base. You would say

shirt = 7.50

then say that each additional color you add on adds another 40 cents to the shirt. So you would say

ColorAdd = ColorCount * .40

and

Shirt = Shirt + ColorAdd

Now you know how much that shirt costs with however many colors the user wanted. Finally, you just multiply times the number of shirts they want

ShirtTotal = Shirt * ShirtCt


P. Pureheart

Moderated by  Lisa LowCarb 

Link Copied to Clipboard
Brand New Posts
Mother's Day Gift Ideas to Sew
by Cheryl - Sewing Editor - 04/24/24 06:08 PM
Astro Women - Birthdays
by Mona - Astronomy - 04/24/24 03:37 PM
2024 - on this day in the past ...
by Mona - Astronomy - 04/24/24 03:33 PM
Check Out My New Website Selective Focus
by Angela - Drama Movies - 04/24/24 01:47 PM
Psalm for the day
by Angie - 04/23/24 04:45 PM
Inspiration Quote
by Angie - 04/23/24 04:43 PM
Sew a Garden Flag
by Cheryl - Sewing Editor - 04/17/24 01:24 PM
Review - Notion for Pattern Designers: Plan, Organ
by Digital Art and Animation - 04/17/24 12:35 AM
Review - Create a Portfolio with Adobe Indesign
by Digital Art and Animation - 04/17/24 12:32 AM
Useful Sewing Tips
by Cheryl - Sewing Editor - 04/10/24 04:55 PM
Sponsor
Safety
We take forum safety very seriously here at BellaOnline. Please be sure to read through our Forum Guidelines. Let us know if you have any questions or comments!
Privacy
This forum uses cookies to ensure smooth navigation from page to page of a thread. If you choose to register and provide your email, that email is solely used to get your password to you and updates on any topics you choose to watch. Nothing else. Ask with any questions!


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2022 Minerva WebWorks LLC. All rights reserved.


Powered by UBB.threads™ PHP Forum Software 7.7.5