Price based on quantity or selection

Discussion in 'HTML & Website Design' started by bellcom, Dec 23, 2014.

  1. #1
    I guess this could go in eCommerce, programming or content management since this is on a worpdress site.

    I need a form for ordering firewood, it doesn't need to collect payment, just email the results.

    However, I need to adjust the price based on the quantity ordered so should I just write a php form, use gravity forms or is there a woocommerce plugin that may make this easier?

    Here is how the pricing would work:

    Oak Firewood - 1 cord $100 / 1/2 cord $60 / 1/4 cord $30

    So the 1/2 cord price is slightly higher, they get a discount if they buy 1 cord.

    But lets say they order 1/2 cord of Oak, and then also another 1/2 cord of another type of wood. I would want the 1/2 cord price to drop from $60 to $50 since they are in effect ordering 1 full cord of wood.

    So 1/2 cord would be $60(a little higher than the actual 1/2 price of a cord) unless combined with 1/2 cord of any other kind of wood then all 1/2 cord items in that order would drop to the actual 1/2 cord price.

    I can't code well but I have a form already with all the prices I wrote in php that works fine but doesn't change the prices based on quantity. So mabye easier just to have someone update my current form here? http://paulbunyansfirewood.com/order-online/

    Any suggestions appreciated, thanks!
     
    bellcom, Dec 23, 2014 IP
  2. Axumata

    Axumata Greenhorn

    Messages:
    22
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    10
    #2
    You already use JQuery on your site. So use it to get what you want.
    First of all, you add classes to your option tags depending on wood quantity (1, 1/2, 1/4 correspondingly), also add prices to each select as data attributes.
    Next step: make a script tag and write a recalculation function. It must initiate two counters, one for qty, another for price. Then .each() through all selects of your wood qty section and increase your counters depending on which option is selected.
    At the end you'll get the exact qty of your wood, then all you need is to apply the discount to the total price depending on qty, format it and display to your customer.
    Then apply your recalculation function to your dropdowns using .change().
    Of course this would not affect the server side, so make sure it's recalculated on the server side (script which processes your form) in similar manner.

    Bonus points: process other parts of your form that affect price, especially the minimum quantity field.

    Bonus points X2: use JQuery Validation plugin to replace the ugly default validation.

    Bonus points X3: use JQuery Autocomplete to help users enter their ZIP with ease.

    Bonus points X4: allow users to select wood type with a dropdown too, then make only one dropdown and a More button, so if they want more wood, they press More and another dropdown appears.

    That's a lot of work, you might think. Come on, your customers should get wood when they order your wood!
     
    Axumata, Dec 23, 2014 IP
    bellcom likes this.
  3. bellcom

    bellcom Well-Known Member

    Messages:
    220
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    120
    #3
    That's a lot of work, you might think. Come on, your customers should get wood when they order your wood!

    There is a joke in there somewhere LOL>
    I will have to do some googling to figure out jquery, not sure how to do what you recommend but gives me a good idea on what I need.

    If I were to offer it in the jobs section, what would be a fair amount to offer? I don't know how long it should take.

    thanks!!
     
    bellcom, Dec 23, 2014 IP
  4. Axumata

    Axumata Greenhorn

    Messages:
    22
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    10
    #4
    Last summer I've got $200 for a similar job, by that I mean client and server side price calculation, autocompletion, form validation and making forms expandable. But I live in a 3rd world country, so I don't know if that price meets most developer's expectations.
     
    Axumata, Dec 23, 2014 IP