2

I need to create a form that allows customers to select various rental items from a large list of products.

Users will be able to select the quantity of each item they require and then hit submit. Upon submitting the form no special inventory or e-commerce functionality needs to take place. An email simply needs to be sent to an admin with the requested items. They'll then contact the customer directly.

Here is an exact example of what we're trying to replicate: http://www.quixote.com/get_a_quote#.URIvJE_bpAN

I immediately thought of Freeform. But there are still a few issues there will be a large number of products that will probably need to be paginated. We'd need to be able to retain the user's selections across pages?

We also need to be able to import the product info weekly via .csv file upload. For this I was planning on using DataGrab.

I'm trying to figure out the best way to achieve this. Any suggestions would be appreciated.

3 Answers 3

2

We did this sort of thing with Safecracker and a post-submit template.

If you create a template with PHP enabled, you can set your redirect URL in your Safecracker form to be that template. You can include the new entry's ID in the segment variables. (Not sure if we used an add-on for that or it's built-in.)

That PHP template, set to run on output, can grab the new entry with exp:channel:entries. You can then run PHP against that data. You can send it by email, send a confirmation email, post it to APIs, etc.

In that PHP template, you do a PHP redirect (header('Location: /thank-you-page'); exit;) to the page you want the user to see - The page you would have otherwise used as your redirect URL.

In that "processor" template, it's possible to accomplish this with EE tags, using add-ons to send the email. It doesn't matter what you do in that template. The idea is that you enable a "processor" template to run post-submit, and redirect from that template to the page you want the user to see. I set up a PHP solution first because oftentimes a custom solution needs custom work.

That addresses the first part of your question - Sending an email on submit.

For the pagination and storing the user's selections - I wonder if you could also do this with Safecracker? Set the prev/next buttons to be submit buttons that submit the form in progress. Instead of redirecting through your "processor" template, redirect them to the next page in the pagination. You would maintain the user's "session" through an entry in your submissions channel. You could have a status field that you leave set to "in-progress" and restore their form on a later visit. You could have a cron job that sweeps in-progress entries periodically and deletes old ones.

Note that you can submit a partial entry form using Safecracker, but you will need some core fields, such as title, url_title, entry_date. You can make those hidden fields.

You may also want to look at Postmaster. I have not used it, but it touts being able to configure sending of emails based on a number of triggers and variables.

1
  • This is pretty close to what we ended up running with. Thanks Mark.
    – Andy Homan
    Feb 20, 2013 at 0:27
1

For the email notifications, I suggest you checkout my add-on Postmaster. It's definitely the definitive solution for email with virtually any trigger. It's highly customizable and completely extendible using the open API's.

https://www.objectivehtml.com/articles/read/postmaster-v1.2

Let me know if you have any questions. I use Postmaster with virtually every EE instal and has proved to be a huge resource to me any my clients. v1.3 is on the way with even more powerful notication features.

0

You might have a look at Joel Bradbury's Shortlist add-on. It may get you a chunk of the way there. It's specifically to allow user-generated lists of items. Whether it will support item + quantity, if the question, but he does reference amazon wish lists among his inspirations, and I believe they include quantities as well, or if it doesn't, perhaps he could customize it for you.

1
  • Thanks @JeanSt-Amand, it doesn't look as though Shortlist does handle quantities unfortunately. Ignoring the session storage aspect for a moment have you any thoughts on the best way to get the selected data into an email using Freeform or similar?
    – Andy Homan
    Feb 6, 2013 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.