Results 1 to 10 of 408

Threaded View

  1. #11
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Contest System [support thread]

    Figured it out..It was a SMALL change needed in the:
    includes/templates/custom_template/templates/tpl_contest_default.php file to make it all work.

    So altogether now..

    If you want the contest form to fill in the name and e-mail address for users who are logged in make the following change in the:
    includes/templates/custom_template/templates/tpl_contest_default.php file:
    Around line 212 find the following code and make the change highlighted in red (add this to this file):
    Code:
    <label class="inputLabel" for="email-address"><?php echo FORM_FIELD_ENTRY_EMAIL; ?></label>
    <?php echo zen_draw_input_field('entry_email_address', $email, ($error ? $_POST['entry_email_address'] : $entry_email_address), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
    <br class="clearBoth" /><br />
    Then in the includes/modules/pages/contest/header_php.php around line 18, make the changes outlined below.

    The form will now automatically fill in the name and address for customers who are logged in.. I thought this was a nice edition to the customer validation code added by BEAZLEYBUB.

    Hope others find this useful..

    Now I only need to resolve my one remaining issue:
    Issue:
    Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??


    Quote Originally Posted by DivaVocals View Post
    Mod Version: 1.6.2
    Zen Cart Version: 1.3.8a

    FYI.. None of the defined pages appeared in the Define Pages Editor until I copied them to the includes/languages/english/html_includes folder too. So now the define pages for this mod are stored in two locations as follows:

    • includes/languages/english/html_includes
    • includes/languages/english/html_includes/YOUR_TEMPLATE

    I wanted to share this in case anyone else was having the same issue I was. This is pretty a cool module.. Now that I've got it all working I have one issue and I need some help with a change I'm trying to make...

    Issue:
    Add Entries for Existing Customers does not add customers to the contest. My test contest dates are 01/01/2009 - 12/31/2009, and there are sales during this period. Yet when I click the "Add Customers" button, no customers are added. Is there a fix for this??

    Change:
    I am trying to get the contest entry form to fill out the customer information (name and e-mail address) when a customer is logged in. I took a look at the contact us form to see how it was done there.. Based on this, in the includes/modules/pages/contest/header_php.php around line 18 I added the following:

    PHP Code:
        // auto complete when logged in
        
    if($_SESSION['customer_id']) {
          
    $sql "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
                  FROM " 
    TABLE_CUSTOMERS 
                  WHERE customers_id = :customersID"
    ;
          
          
    $sql $db->bindVars($sql':customersID'$_SESSION['customer_id'], 'integer');
          
    $check_customer $db->Execute($sql);
          
    $customer_email$check_customer->fields['customers_email_address'];
          
    $customer_name$check_customer->fields['customers_firstname'] . ' ' $check_customer->fields['customers_lastname'];
        } else {
          
    $customer_email NOT_LOGGED_IN_TEXT;
          
    $customer_name NOT_LOGGED_IN_TEXT;
        }

    // default email and name if customer is logged in
    if($_SESSION['customer_id']) {
      
    $sql "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " 
    TABLE_CUSTOMERS 
              WHERE customers_id = :customersID"
    ;
      
      
    $sql $db->bindVars($sql':customersID'$_SESSION['customer_id'], 'integer');
      
    $check_customer $db->Execute($sql);
      
    $email$check_customer->fields['customers_email_address'];
      
    $name$check_customer->fields['customers_firstname'] . ' ' $check_customer->fields['customers_lastname'];

    This gets the name in the name field, but not the e-mail address.. I am a bit over my head here, and could use a hand.. What do I need to add, subtract, multiply or divide to get me the rest of the way there..
    Last edited by DivaVocals; 29 Nov 2009 at 08:51 PM.

 

 

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 22
    Last Post: 26 Jan 2026, 06:47 AM
  2. ZX Slideshow support thread
    By balihr in forum All Other Contributions/Addons
    Replies: 766
    Last Post: 18 Oct 2025, 11:23 AM
  3. v151 Help with contest system mod
    By tod4life in forum General Questions
    Replies: 1
    Last Post: 15 Dec 2012, 05:26 PM
  4. SnapShot [support thread]
    By skipwater in forum All Other Contributions/Addons
    Replies: 32
    Last Post: 26 Oct 2012, 08:38 PM
  5. Contest System addon Error
    By ruralcraftsman in forum All Other Contributions/Addons
    Replies: 18
    Last Post: 5 Feb 2010, 04:12 PM

Posting Permissions

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