Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-12-28 05:29:28
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Custom Field: User Input Info and Shopping Carts
I am in the preliminary stages of figuring out my options for shopping carts. I have read the various shopping cart posts and thanks to everyone’s input, suggestions and guidance. Like most people, I have the need for two type of carts (one where the items are fixed) and one where the products are actual services. This posting pertains to the latter.
I need the customer (website user) to have the capability of filling in custom fields during their “check out process.” These custom fields would then get transmitted to whatever processing agent so that I would know the specifics regarding the services that they are requesting. I can standardize the dollar amount and services, but can not standardize the detail information.
In addition, to make it easy for the end user, I would not want one big text box, but multiple fields that I can specify the type of information that I am requesting and tyo make it easier and uniform for them to input.
So, I guess my questions are:
(1) Can I do this with custom fields (ie have the end user input data into them (not from the admin side)?
(2) Has anyone used a shopping cart that would support receiving this type of information? From the posts I have read, I was thinking that this was possible, but maybe I am way off base. FYI, I would prefer to use either Paypal or Google primarily becauise of their name recognition.
Sorry if this post is confusing, but hopefully someone can assist.
Any guidance would be greatly appreciated.
progre55
Offline
Re: Custom Field: User Input Info and Shopping Carts
Not sure how comfortable with php you are, but this sounds a lot like what I’ve done with zem_contact_reborn and Postmaster.
The zem_contact_reborn API allows you to create a function that will be called when a “submit” button is clicked. You can set up the input fields, etc, however you like [you’ll have to see that plugin’s documentation for specifics], giving them “name=bitOfInformation1” values (see the example below).
You would need to create a special function that takes all the submitted fields, and creates a new article in the database, and inserts all the submitted fields into the custom fields for that article. So each transaction would equal an article. You could USE all the article fields — what I’ve done below is just a brief mockup.
Does that make sense?
Here’s a pared down version of what I’ve done with Postmaster:
// ---- public-side, to register zem_contact
register_callback('progre55_zemcontact_submit','zemcontact.submit');
function progre55_zemcontact_submit()
{
global $zem_contact_form;
// somehow create a transaction title
$progre55_bitOfInformation1 = doSlash(ps('bitOfInformation1'));
$progre55_bitOfInformation2 = doSlash(ps('bitOfInformation2'));
$progre55_bitOfInformation3 = doSlash(ps('bitOfInformation3'));
$when = 'now()';
$create_sql5[] = safe_insert(
"textpattern",
"Title = 'transaction title',
Body = '',
Body_html = '',
Excerpt = '',
Excerpt_html = '',
Image = '',
Keywords = '',
Status = '4',
Posted = $when,
LastMod = now(),
AuthorID = '',
Section = '',
Category1 = '',
Category2 = '',
textile_body = '',
textile_excerpt = '',
Annotate = '1',
override_form = '',
url_title = '',
AnnotateInvite = '',
custom_1 = '$progre55_bitOfInformation1',
custom_2 = '$progre55_bitOfInformation2',
custom_3 = '$progre55_bitOfInformation3',
custom_4 = '',
custom_5 = '',
custom_6 = '',
custom_7 = '',
custom_8 = '',
custom_9 = '',
custom_10 = '',
uid = '".md5(uniqid(rand(),true))."',
feed_time = now()"
);
}
Last edited by benbruce (2006-12-29 02:06:11)
Offline
#3 2007-01-03 13:35:49
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: Custom Field: User Input Info and Shopping Carts
benbruce:
Thanks for the reply.
I am goingg to test several things out over the weekend. I hope that you don’t mind if I post (or if you prefer emaqil you) if and I am sure when I have some road blocks. I am semi comfortable with php and would consider this one of the final pieces to the puzzle for the site …
Thanks again for the assistance.
progre55
Offline