Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Jan 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Custom contact forms

    I am trying to take the information in the contact form and have it populate a csv file or database instead of an email - is this possible?

  2. #12
    Join Date
    May 2010
    Posts
    17
    Plugin Contributions
    0

    Default Re: Custom contact forms

    Quote Originally Posted by raverX View Post
    i gave up on that module, it was annoying...

    just hacked up the contacts page script to do what i wanted it to do...

    you need to understand forms to some extent, tho ZenCart has functions to do most things which are pretty easy to understand..

    first look in /includes/templates/theme_name/templates/tpl_contact_us_default.php
    copy this to whatever you want your new page to be called (in my case 'vip')
    sp tpl_vip_default.php

    then edit it to suit your requirements

    then goto /includes/modules/pages/contact_us/
    copy that folder to whatever you called your previous one
    ie: /includes/modules/pages/vip/

    then edit 'header_php.php' - this will process your form when you POST to it, you will need to match the variable names to what you put in the tpl file

    you may also need to go to /includes/languages/english/html_includes and copy define_contact_us.php to define_name.php (ie: define_vip.php)

    you will also need to go to /includes/languages/english and copy contact_us.php to the same name (ie: vip.php)

    I think that's all I did.. there may have been one other file that needs changing..

    I've attached a copy of the 4 files mentioned for anyone who wants to use them as a reference.. just ignore the ladym folder as that's the source tree for the project i was working on..
    I have the above form working. Now I want to add a second drop-down menu for a different form field. I added the code to the header_php.php but all that did was put the fields for both drop-down menus in both.

    How do I end one drop-down and start a new one?

    My code is...

    // Pulldown to select a size
    // Set default selection:
    $default_pulldown_selection = '0';

    //For validation, you're looking for the contents of the $_POST['size'] variable
    // this is only set after "submit" is clicked.
    $pulldown_selected_item = (isset($_POST['size'])) ? $_POST['size'] : $default_pulldown_selection ;

    //build an array of entries to be displayed on the template for field 'size':
    $pulldown_contents[] = array('id'=>'0', 'text'=>'Please Select');
    $pulldown_contents[] = array('id'=>'standard', 'text'=>'Standard');
    $pulldown_contents[] = array('id'=>'large', 'text'=>'Large');

    // Pulldown to select a color
    // Set default selection:
    $default_pulldown_selection = '0';

    //For validation, you're looking for the contents of the $_POST['color'] variable
    // this is only set after "submit" is clicked.
    $pulldown_selected_item = (isset($_POST['color'])) ? $_POST['color'] : $default_pulldown_selection ;

    //build an array of entries to be displayed on the template for field 'color':
    $pulldown_contents[] = array('id'=>'0', 'text'=>'Please Select');
    $pulldown_contents[] = array('id'=>'red', 'text'=>'Red');
    $pulldown_contents[] = array('id'=>'blue', 'text'=>'Blue');

    I think I would have to put some code between these two lines to end one drop-down and start the next.

    $pulldown_contents[] = array('id'=>'large', 'text'=>'Large');

    End first drop-down

    Start second drop-down
    // Pulldown to select a color


    in the file tpl file I have

    <label class="inputLabel" for="size">Select a Size Request:</label>
    <?php echo zen_draw_pull_down_menu('size', $pulldown_contents, $pulldown_selected_item); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="color">Color:</label>
    <?php echo zen_draw_pull_down_menu('color', $pulldown_contents, $pulldown_selected_item); ?>
    <br class="clearBoth" />

    Can anybody tell me how to seperate the two drop down box contents? At the moment both boxes have a choice of
    Standard
    Large
    Red
    Blue

    I would like the first drop-down to have a choice of Standard and Large and the second drop-down choice of Red and Blue

  3. #13
    Join Date
    Apr 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Custom contact forms

    I'm running version 1.3.9 and noticed that there has not been any questions recently, but I will try this anyhow.
    I created all the files and place them where the folders indicated but I can't open the form.
    I have purchased and installed a template so could this have an impact as to where the forms come from? Also, could I use the "Create Account" form and do the same? What if I want to replace the "contact us" link on the header and point to my new form instead? What do I do with the Java script? It seems to point to the contact us form when that's not what I want.
    I'm new to the whole ZenCart community and technology so please forgive me for my ignorance.
    Thanks.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX
    By dbrewster in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 May 2006, 06:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •