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

custom forms - data collection

Sticky

Views: 221,970

Results 221 to 240 of 259
2 Apr 2011, 3:39 PM
#221
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

custom forms - data collection

I have not tested the referenced mod in 139h, however, I have used it as a basis to creating several diverse forms, some of which include the upload facility discussed in this thread - all of which work on 139 without problem. I recommend you read this entire thread.

Another form worth comparing is the Return Authorisation mod
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=433

thread: http://www.zen-cart.com/forum/showthread.php?t=39212

Hope this helps.

14 Apr 2011, 11:25 PM
#222
davisz avatar

davisz

Zen Follower

Join Date:
Jan 2011
Posts:
141
Plugin Contributions:
0

Re: custom forms - data collection

I am having trouble getting the form that I made show up on a new page. I even tried to create a new page and make a simple form using HTML, how can I get it to load onto a page that was not created by default by zen cart?

To be specific, I am getting a 404 error - when I thought I created all of the right files. I even edited the HTML using the define pages editor (so I got my new page to appear in that drop down box, but the page wont load).

Edit #2, just found the Wiki.. Looking at it..

25 Apr 2011, 5:51 PM
#223
lackew avatar

lackew

Zen Follower

Join Date:
Aug 2009
Location:
Tampa Bay
Posts:
223
Plugin Contributions:
1

Re: custom forms - data collection

I have created a custom form, all appears OK at the moment except when Send is clicked the page just reloads/refreshes and does Not show the success message.

I copied / edited the contact us files. Any ideas on what I may have missed????

26 Apr 2011, 3:34 PM
#224
davisz avatar

davisz

Zen Follower

Join Date:
Jan 2011
Posts:
141
Plugin Contributions:
0

Re: custom forms - data collection

Sounds like something with your 'checkout_success' page.

What does the header_php.php file that is inside modules > pages say (at the bottom).

Make sure the filename is correct

zen_redirect(zen_href_link(FILENAME_YOUR_FILE, 'action=success'));

The words YOUR_FILE should be one of the new file you made.

29 Apr 2011, 3:48 PM
#225
lackew avatar

lackew

Zen Follower

Join Date:
Aug 2009
Location:
Tampa Bay
Posts:
223
Plugin Contributions:
1

Re: custom forms - data collection

Lackew:

I have created a custom form, all appears OK at the moment except when Send is clicked the page just reloads/refreshes and does Not show the success message.

I copied / edited the contact us files. Any ideas on what I may have missed???? issue resovled - testing was fine but
Error messages are showing below the form instead of the top of page. How do I get these messages to show above. The actual form is in the defines page instead of the tpl page (could not get it to display)

29 Apr 2011, 5:11 PM
#226
lackew avatar

lackew

Zen Follower

Join Date:
Aug 2009
Location:
Tampa Bay
Posts:
223
Plugin Contributions:
1

Re: custom forms - data collection

it is my understanding that the header.php is the file I need to add my form fields to pass thru to email. However I am clueless on the formating. I get some data ok but formating the email sent has me stumped.
I need the data formatted into the email so I know what data is what specific info, any Ideas???????

29 Apr 2011, 5:50 PM
#227
lackew avatar

lackew

Zen Follower

Join Date:
Aug 2009
Location:
Tampa Bay
Posts:
223
Plugin Contributions:
1

Re: custom forms - data collection

Lackew:

I have created a custom form, all appears OK at the moment except when Send is clicked the page just reloads/refreshes and does Not show the success message.

I copied / edited the contact us files. Any ideas on what I may have missed????

never touched the success page but it appears to be working.
I simlpy copied & renamed the contact us files to build my form then added it the the define pages because it would not display/load from the tpl defualt page (prob cause of the html coding)

30 Apr 2011, 7:48 PM
#228
lackew avatar

lackew

Zen Follower

Join Date:
Aug 2009
Location:
Tampa Bay
Posts:
223
Plugin Contributions:
1

Re: custom forms - data collection

unbelievable that I finally got my custom form operational without any help. The only prob now is the Title wont display on the page and the title wont show in sidebox. I did manually ad the title to sidebox even tho it does show in Admin/config/define page status:clap:

23 Jun 2011, 10:49 PM
#229
tiffbrink avatar

tiffbrink

New Zenner

Join Date:
Feb 2008
Location:
Allen, TX
Posts:
29
Plugin Contributions:
0

Re: custom forms - data collection

I am trying to add an email cart form under the shopping cart. I did exactly how this thread started off by basically integrating the "Contact Us" functionality to the "Shopping Cart" functionality...

  1. Integrated the form on tpl_shopping_cart_default.php

  2. Integrated the html headers by prepending the contact_us to the shopping cart (just after the Breadcrumb navigation bit).
    and modifying the contact code such as redirect to shopping_cart & action=success

  3. Integrated the definitions by appending the contact form definitions to the /languages/english/shopping_cart.php

I did use the dropdown option but only because I cannot get the contact page to work without it (Previous pr og r amm e r s modifications?) so I am having to use it here too.

The cart is at :http://shop-dev.pacificnorthern.com/jewelry-display-packs/ring-pack/Accolade-3-Ring-Tower/
You will need to put something in the cart to see what I am trying to do.

When submit it should have a &success at the end of the URL but does not :(
and hence, no email.

Please any help? I feel so close!

24 Jun 2011, 2:13 PM
#230
tiffbrink avatar

tiffbrink

New Zenner

Join Date:
Feb 2008
Location:
Allen, TX
Posts:
29
Plugin Contributions:
0

Re: custom forms - data collection

I figured it out. I just needed to reposition my form in the document.

24 Jun 2011, 2:23 PM
#231
tiffbrink avatar

tiffbrink

New Zenner

Join Date:
Feb 2008
Location:
Allen, TX
Posts:
29
Plugin Contributions:
0

Re: custom forms - data collection

So why do I have to reposition my form? I am not real happy with where it is. How do I get around that?

I love Zencart... just sayin'

24 Jun 2011, 5:42 PM
#232
drbyte avatar

drbyte

Sensei

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

Re: custom forms - data collection

tiffbrink:

So why do I have to reposition my form? I am not real happy with where it is. How do I get around that?

You can't nest multiple <form> elements inside each other.
You have to close one before you can open another.

ie: This is bad:

<form><form></form></form>

this is good:

<form></form><form></form>
24 Jun 2011, 6:44 PM
#233
tiffbrink avatar

tiffbrink

New Zenner

Join Date:
Feb 2008
Location:
Allen, TX
Posts:
29
Plugin Contributions:
0

Re: custom forms - data collection

I checked form in the source code but did not see any. I tried inserting an extra close form to be safe but still no luck. Is it invisible : ) a ghost in the machine?

4 Sep 2011, 11:02 PM
#234
jenchord avatar

jenchord

New Zenner

Join Date:
May 2011
Posts:
68
Plugin Contributions:
0

Re: custom forms - data collection

ladybugmom:

I received an email back from the UPLOAD-POINT in regards to selecting only certain file extensions to be uploaded and this was his reply. I have not used it yet, but wanted to pass it on to those who wanted to used it.

In index.php after line 306 is: // Path from domain name to upload
directory and line 315 is: // Redirect to upload page.

Replace the current code between these lines with this:

$file_ext = basename($_FILES['ftp_file']['name']);
$ext = substr($file_ext, strrpos($file_ext, '.') + 1);
$upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/");
$target_path = $upload_dir . basename( $_FILES['ftp_file']['name']);
if (($ext == "ai") || ($ext == "eps") || ($ext == "psd") || ($ext ==
"pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext
== "rar") || ($ext == "7z") || ($ext == "zip")) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'], $target_path)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name']), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name']). "$p2";
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2";
}

The new line 311:
if (($ext == "ai") || ($ext == "eps") || ($ext == "psd") || ($ext ==
"pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext
== "rar") || ($ext == "7z") || ($ext == "zip")) {

is where you can add or remove file types. If you just want .jpg files
then it should be:
if (($ext == "jpg")) {





This form's working great so far (many thanks to ladybugmom!). The only problem is when I tried limiting the type of file uploads. 

I did the above instructions. Here's how my code turned out:

// Upload
// Path from domain name to upload directory and line
$file_ext = basename($_FILES['ftp_file']['name']); 
$ext = substr($file_ext, strrpos($file_ext, '.') + 1); 
$upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/"); 
$target_path = $upload_dir . basename( $_FILES['ftp_file']['name']); 
if (($ext == "jpg") || ($ext == "jpeg") || ($ext == "psd") || ($ext == 
"pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext 
== "cdr") || ($ext == "eps") || ($ext == "tiff") || ($ext == "bmp") || ($ext == "ai")) { 
  if (move_uploaded_file($_FILES['ftp_file']['tmp_name'], $target_path)) { 
  chmod($upload_dir . basename( $_FILES['ftp_file']['name']), 0644); 
  echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
  } else { 
  echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
  } 
} else { 
  echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
}
// Redirect to upload page.  



But when I finished uploading an image, this message appeared briefly: 

Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 307

Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 310

Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 321
There was a problem uploading

Automatically redirecting to the Upload-Page

-----------------------------------------------

Uploading then failed. I have about zero knowledge of php. Can somebody enlighten me?

It would be much appreciated!

Grateful zencarter
5 Sep 2011, 4:58 AM
#235
jenchord avatar

jenchord

New Zenner

Join Date:
May 2011
Posts:
68
Plugin Contributions:
0

Re: custom forms - data collection

Scratch that, alternative in post 217 is much easier....guess I should read through all the posts before I go posting myself. :cool:

17 Nov 2011, 4:06 PM
#236
littlekid440 avatar

littlekid440

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: custom forms - data collection

How can you add checkbox field and dropdown field to this?
:unsure:

20 Nov 2011, 4:53 AM
#237
littlekid440 avatar

littlekid440

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: custom forms - data collection

If I did some reading and analyzing the code I would have not needed to post.
:lamo:
:clap:

13 Jan 2012, 8:57 PM
#238
clsmky avatar

clsmky

New Zenner

Join Date:
Jul 2011
Posts:
23
Plugin Contributions:
0

Re: custom forms - data collection

Ok sorry If I missed it, but I read this entire thread and couldnt find my answer.

Has anyone figured out how to send a confirmation email to the customer after the "you message has been sent" success page?

I have no complaints other than now I want to have a confirmation email sent. I'm using this for a physical catalog request (you can see it here) and I've got it to work perfectly. I get all the correct info and everything lands where its supposed to when its sent. It even checks if the patron is logged into the site to fill in some of the fields. Once the form is submitted, it goes to a page that states that the request has been sent. I would like it to send a confirmation email to the customer thanking them for their interest in the company and so on.

How do I do that? Just need to be pointed in the right direction is all.

13 Jan 2012, 11:16 PM
#239
drbyte avatar

drbyte

Sensei

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

Re: custom forms - data collection

Add another zen_mail() function call using the customer's email address instead of yours, and some different content of course.

13 Jan 2012, 11:32 PM
#240
clsmky avatar

clsmky

New Zenner

Join Date:
Jul 2011
Posts:
23
Plugin Contributions:
0

Re: custom forms - data collection

DrByte:

Add another zen_mail() function call using the customer's email address instead of yours, and some different content of course.

Really its that simple? ok I'll give it a shot. Thanks Dr.Byte.