• I was planning to do website like this, but couldn’t grasp the idea behind it.

    [ redundant link removed ]
    If you click ‘Start Ordering’, it will bring you to the next page, ‘location’ page. Once you key in your location, it will bring you the next page, ‘vehicle’. From here I notice the URL have captured the location data from previous page. And this continue up until the payment page, each selected input by user is capture onto the URL. I am sure this capture URL data will be render as Purchase Order for seller.

    I am asking the expert to point me to the right direction for this two major question;
    1. How do I integrate data from the database that I stored. (List of car battery and Car)
    2. How do I capture the user input data and render it as a final Purchase Order.

    Best Regards,
    Dean

    • This topic was modified 5 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    If a form element’s method attribute is “GET”, submitting the form to the subsequent page will append field values to the URL without you needing to do anything special. The browser handles everything.

    In a page’s PHP that handles such a request, the passed field values are available in the $_GET super global array. Once a car is selected and passed on to the next page, after getting the car data from $_GET, use it to query the database for appropriate batteries. Output the query results as part of that page’s form fields so the user can select their preference. (assuming there are more than one possible match, like several price points).

    The final order form can then be submitted to an confirmation page that also saves order data to the DB and maybe emails someone as notification to fulfill the order.

    There are e-commerce plugins that can help you manage customers, orders, fulfillment, payment, etc. You may still need to custom build the battery selection sequence, but at least some of the other elements are handled for you.

    Thread Starter SaifDean93

    (@saifdean93)

    Thank you bcworkz.

    I forgot to mention that I am not really that fluent in outside of default WordPress. I mostly did standard static WordPress and business listing.

    It would be great if you could walk me through the process and flow on how exactly to do that kind of website. The advance form.

    Moderator bcworkz

    (@bcworkz)

    Create a sequence of pages to collect user input. The first (after clicking start ordering) can be a typical WP page to collect location data. For now just collect typed user input without fancy maps, auto-suggest and verification, that can be built later. Subsequent pages need to be based on a custom page template with code to handle data sent from previous pages.

    To collect car make and model info, ideally you’d have a database of current information from which a series of cascading dropdowns can be created. Maybe such queries could be made from your battery table? Again, maybe just collect typed user input for now. Work on the dropdowns later. Also place data from previous pages in current form fields (hidden or visible) so that submitting the current form passes all data on to the next page.

    Continue in a similar manner for the rest of the pages all the way to order acknowledgement. Custom page template code handles whatever needs to be done on each page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Advance form integrating with database?’ is closed to new replies.