Zen Cart Logo
Forums / All Other Contributions/Addons / custom forms - data collection

custom forms - data collection

Sticky

Views: 221,970

Results 101 to 120 of 259
10 Jan 2008, 11:48 PM
#101
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

custom forms - data collection

I am trying to update one of text fields of the form to be a dropdown field populated with a result of my slq. I already asked couple days ago - http://www.zen-cart.com/forum/showthread.php?t=84820), but no suggestion yet, so I thought I would ask here.. This is what I have;

<?
$query = mysql_query("SELECT products_description.products_name'
        . ' FROM products_description LEFT JOIN products_to_categories ON products_description.products_id = products_to_categories.products_id'
        . ' WHERE (((products_to_categories.categories_id)=13))'
        . ' ORDER BY products_description.products_name" ); 
$result = mysql_query ($query);
?>    
 <label class="inputLabel" for="band_name"><?php echo 'Select a Painting: '; ?></label>
<?php echo zen_draw_pull_down_menu('band_name', $result) . ' ' . (zen_not_null(ENTRY_REQUIRED_SYMBOL) ? '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>': '');?>
<br class="clearBoth" />

obviously I am missing something/lot (I tried different things by emulating my ASP code which I can work with), but no luck. I even tried to actually code in the values (since there will be only few at any given time), but even that did not work for me. Can some please give me help?

Thanks Veronika

7 Aug 2008, 11:23 PM
#102
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

Anyone have this working on 1.3.8a?

I just installed and it loads fine but when you click send it just refreshes the page and no mail is sent.

I need to create 3 custom forms for the same site so I would appreciate any advice/ tips or help.

Thanks in advance.

7 Aug 2008, 11:35 PM
#103
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

timed out!

Scrub my last request as I got it to work.

The problem was with the T and C's acceptance at the bottom of the page was commented out.
I removed it and now it works fine.

8 Aug 2008, 9:30 PM
#104
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

Bit of an update. I have everything working great except I need to add a dropdown selection.

What is the dropdown equivalent of a checkbox?

<?php echo zen_draw_checkbox_field('option1', 'Option 1', false, 'id="checkbox"');?>
9 Aug 2008, 12:10 AM
#105
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

OK, update again!

(once I get this working I'll post the results)

I got the pull down working but can only get it to use the manufacturers as an array (taken from the advanced search):

<?php echo zen_draw_pull_down_menu('bedrooms', zen_get_manufacturers(array(array('id' => '', 'text' => TEXT_PULLDOWN))), $sData['bedrooms']); ?>

Anyone know how I can point this to use another array besides the manufacturers?
Preferably one built in the header_php.php file with this mod.

11 Aug 2008, 8:58 PM
#106
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

I'm still stuck with this one.
Put simply I can get the pull down to display but it has no content.

I tried using the pull downs in advanced search and tried to adapt them, but nothing.

Anyone?

17 Aug 2008, 11:08 AM
#107
ramblas avatar

ramblas

New Zenner

Join Date:
Mar 2006
Posts:
15
Plugin Contributions:
0

Re: custom forms - data collection

Hi
I have looked at your code and although I do not have a solution for you I altered the snippet to my requirements and it does work
Mine goes like this
<label class="inputLabel" for="book_category">Category:</label>

<?php echo zen_draw_pull_down_menu('book_category03', zen_get_categories(array(array('id' => '', 'text' => CATEGORY))), $sData['bedrooms']); ?>

My Categories do show up in the Drop down box for the User to select. The only Problem I have with this currently is that when I receive the Email with the Form Date I does not show the Category NAme but ID Nr i.e. 7 or 28 etc.
Any Idea how I can fix it
Other than that the Form works great and I have adjusted it to my needs with help from this forum and also looking at the specialorders example on the freshabundance.com site.
Regards
Manfred
Jeffreys Bay

17 Aug 2008, 12:33 PM
#108
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: custom forms - data collection

Getting anything already built in, categories, manufacturers for example is no problem.
Getting a custom list, so far for me, is a problem.

20 Aug 2008, 1:36 AM
#109
glennnz avatar

glennnz

New Zenner

Join Date:
May 2008
Location:
New Zealand
Posts:
32
Plugin Contributions:
0

Re: custom forms - data collection

DrByte:

The contact us form consists of the following files:

This one handles the layout, including all the fields you want to collect info for.
I'd take out the "SEND_TO_TEXT" one, and set the default like you do in your regular email form.
Then everything from "ENTRY_NAME" down to "ENTRY_ENQUIRY" would get replaced with your form.

This file checks for logic, errors, etc, and if OK, sends the message off to you, by joining all the fields together into the $message variable. It reads info from the form as $_POST['variable'] names.

This contains the display-text variables to be put into your template.

Is this useful fr me to research as a way of implementing this as a module?

Thanks

Glenn

23 Aug 2008, 11:34 PM
#110
jjgtrading avatar

jjgtrading

New Zenner

Join Date:
Aug 2008
Location:
Utah
Posts:
28
Plugin Contributions:
0

Re: custom forms - data collection

Hi,

I was able to successfully install the band form on 1.3.8. I've customized it to how I wanted it. I'm having two problems though, they should be easy fixes. When Zen Cart attempts to give the success message it directs the user to a page that is non existent. Should I create an EZ page and direct it there? If so how can I do that?

Also, when I receive the email. Only 3 out of the 7 fields I am using are filled in. The customer name and email both show "Not logged in".

Oh, and one more thing. I didn't notice the question about what to replace ENTRY_REQUIRED_SYMBOL with if you dont need the customer to fill out that field get answered. Anybody have any instructions on what to do?

Thanks!

23 Aug 2008, 11:56 PM
#111
jjgtrading avatar

jjgtrading

New Zenner

Join Date:
Aug 2008
Location:
Utah
Posts:
28
Plugin Contributions:
0

Re: custom forms - data collection

Looks like I fixed the album and sku fields but I'm still having problem with the Name and Email. Could it be that I changed those fields to customer_name and customer_email?

24 Aug 2008, 1:51 AM
#112
jjgtrading avatar

jjgtrading

New Zenner

Join Date:
Aug 2008
Location:
Utah
Posts:
28
Plugin Contributions:
0

Re: custom forms - data collection

I fixed most of the problems. I did notice that the form only actually requires you to fill in name and address, even if you have the flags on. I'll look into this later. I've been going through too much code and too many changes to worry about it now.

The one major problem I'm still having though is that the name and email are still coming in with the not logged in message instead of what the customers input.

Any suggestions?

edit: I think I see what it is, I have my customer name and customer email fields (I have no clue about proper php terms), the same as the Office Use Only Login Name and Login Email

24 Aug 2008, 2:07 AM
#113
jjgtrading avatar

jjgtrading

New Zenner

Join Date:
Aug 2008
Location:
Utah
Posts:
28
Plugin Contributions:
0

Re: custom forms - data collection

UPDATE: FIXED IT! I changed what I was using to store the customer name and email from customer_ to spclorder_

Now just to figure out why it really doesn't check to see if anything is entered in the other fields.

26 Aug 2008, 3:56 PM
#114
swanriver avatar

swanriver

New Zenner

Join Date:
Apr 2008
Location:
Cape Cod, Massachusetts, USA
Posts:
26
Plugin Contributions:
0

Re: custom forms - data collection

1st, many thanks to Dr Byte for a great contrib. I am using the band signup form, and it has produced excellent results.

My question: Are there any files for an admin side interface? (My client would like to do their own updates, and that would make my life a bit easier too.) If not, what files would be required and perhaps I can come up with them.

9 Sep 2008, 9:43 PM
#115
mmand avatar

mmand

New Zenner

Join Date:
Aug 2008
Posts:
9
Plugin Contributions:
0

Re: custom forms - data collection

Finally! After days of searching (and worrying about my upcoming deadline), I've found what I need. At least it seems to be what I need.

This is an excellent add-on, and I thank you profusely for it.

I did come across one small problem in ZenCart v1.3.8 (final I guess...). The class inputLabel is overridden with the default stylesheet.css in the "Classic" template.

I doubt this is a big problem, because most people make their own styles anyway, but I figure I should report it.

Again, a big THANK YOU! for this, as I am still trying to muddle my way through ZenCart's...extensive...definition system.

Mike

10 Sep 2008, 9:17 PM
#116
mmand avatar

mmand

New Zenner

Join Date:
Aug 2008
Posts:
9
Plugin Contributions:
0

Re: custom forms - data collection

I'm sorry for the double post, I cannot see any way to edit my previous.

I am wondering, where does this form submit to? Looking at the HTML, it submits to itself, but I don't see any place that processes the information to email or insert into a database. Has anyone used this to have a band sign themselves up so they could upload their own music? My client has requested something like this, but I honestly cannot figure out Zen Cart for the life of me. I have multiple years of PHP programming under my belt, and dozens designing webpages, but this seems to be a completely new language to me...O.o

Thanks,
Mike

12 Sep 2008, 6:37 PM
#117
nedtinlin avatar

nedtinlin

New Zenner

Join Date:
Jul 2008
Posts:
2
Plugin Contributions:
0

Re: custom forms - data collection

Hi I wonder if anyone can help. I have downloaded this form and added it to my site http://www.jcraftz.co.uk/index.php?main_page=send_direct. I would however like it to be an HTTPS page because ioof the nature of the information names and addresses etc. I have tried adding the code as suggested in this thread http://www.zen-cart.com/forum/showthread.php?t=100796 which worked and ensured the form was secure. But then the form would not send because it would not validate. I removed the code
//force redirect to secure page
if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
and the form worked again.
Can anyone help? I would rather that this form was sent securely. While I have the begging bowl out I wonder if anyone could possibly point me to a way of defaulting an item in the shopping cart to a field in this form.

Thanks in advance
Ned

14 Sep 2008, 11:52 AM
#118
nedtinlin avatar

nedtinlin

New Zenner

Join Date:
Jul 2008
Posts:
2
Plugin Contributions:
0

Re: custom forms - data collection

Well I have solved the validation problem. I should have put the code to redirect on the template for the form and not the form itself. I even managed to get the form to redirect correctly after submitting by copying some code from the shopping cart page. I feel so smug now.
However, I would still like to be able to default some fields in the form so if anyone out there knows how to do that Please let me know.

4 Mar 2009, 8:05 PM
#119
tinadad avatar

tinadad

New Zenner

Join Date:
Apr 2008
Posts:
39
Plugin Contributions:
0

Re: custom forms - data collection

Well folks I have followed this tread closely but have one little question on the successful completion of the form and email process how can I add a link to either a category or product. We have several products that require a lot of information before purchase and after the form is complete we need to send the customer to a hidden product or category. How and where can I accomplish this.

4 Mar 2009, 8:20 PM
#120
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: custom forms - data collection

If I recall correctly, (I've not looked at this code in ages) after the zen_mail() function call, there is a zen_redirect() call. Change that call to go to the page you desire.

Or, if there is a "thank you your message has been sent" page, add your link to that thank-you text. (this requires no "programming")