Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2007
    Location
    italy
    Posts
    90
    Plugin Contributions
    2

    Default "Ask A Question":add the manufacturer in the emails

    Using the module "Ask A Question", as admin, how I can receive the manufacturer name in received emails?
    http://www.zen-cart.com/downloads.php?do=file&id=109
    This module work perfectly also on ZC 1.5...

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,832
    Plugin Contributions
    124

    Default Re: "Ask A Question":add the manufacturer in the emails

    Ciao, Matteo! In ./includes/modules/pages/ask_a_question/header_php.php, line 87
    after

    Code:
          $email_body .= sprintf(EMAIL_TEXT_INTRO,$from_name, $product_info->fields['products_name'], $product_info->fields['products_model']) . "\n\n";
    add something like

    Code:
         $email_body .= zen_get_products_manufacturers_name($_GET['products_id']) . "\n\n";
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Mar 2007
    Location
    italy
    Posts
    90
    Plugin Contributions
    2

    Default Re: "Ask A Question":add the manufacturer in the emails

    My most similar line is the number 85:
    Code:
     $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Product: </b><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a><br />' . strip_tags($_POST['enquiry']);
    I have also tryed to change your suggested line into:
    Code:
     $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Manufacturer: </b>' . zen_get_products_manufacturers_name($_GET['products_id']) . "\n\n";
    but it doesn't work.

    my actual /includes/modules/pages/ask_a_question/header_php.php file is:

    Code:
    <?php
    /**
     * Ask a Question Page (based on Contact Us Page)
     *
     * @package page
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: header_php.php 3230 2006-03-20 23:21:29Z drbyte $
     */
    
    
      $valid_product = false;
      if (isset($_GET['products_id'])) {
        $product_info_query = "select pd.products_name, p.products_image, p.products_model
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_status = '1'
                               and p.products_id = '" . (int)$_GET['products_id'] . "'
                               and p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
        $product_info = $db->Execute($product_info_query);
    
        if ($product_info->RecordCount() > 0) {
          $valid_product = true;
        }
      }
    
      if ($valid_product == false) {
        zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' . $_GET['products_id']));
      }
    
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    
    $error = false;
    if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
      $name = zen_db_prepare_input($_POST['contactname']);
      $email_address = zen_db_prepare_input($_POST['email']);
      $enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
    
      $zc_validate_email = zen_validate_email($email_address);
    
      if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
        // 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';
          $customer_name='Not logged in';
        }
    
        // use contact us dropdown if defined
        if (CONTACT_US_LIST !=''){
          $send_to_array=explode("," ,CONTACT_US_LIST);
          preg_match('/\<[^>]+\>/', $send_to_array[$_POST['send_to']], $send_email_array);
          $send_to_email= preg_replace ("/>/", "", $send_email_array[0]);
          $send_to_email= trim(preg_replace("/</", "", $send_to_email));
          $send_to_name = trim(preg_replace('/\<[^*]*/', '', $send_to_array[$_POST['send_to']]));
        } else {  //otherwise default to EMAIL_FROM and store name
        $send_to_email = trim(EMAIL_FROM);
        $send_to_name =  trim(STORE_NAME);
        }
    
        // Prepare extra-info details
        $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email);
        // Prepare Text-only portion of message
        $text_message = OFFICE_FROM . "\t" . $name . "\n" .
        OFFICE_EMAIL . "\t" . $email_address . "\n" .
        PROD_NAME . "\t" . $product_info->fields['products_name'] . "\n" .  
        zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) .
        "\n\n" .  
    
        '------------------------------------------------------' . "\n\n" .
        strip_tags($_POST['enquiry']) .  "\n\n" .
        '------------------------------------------------------' . "\n\n" .
        $extra_info['TEXT'];
        // Prepare HTML-portion of message
        $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Product: </b><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a><br />' . strip_tags($_POST['enquiry']);
        $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Manufacturer: </b>' . zen_get_products_manufacturers_name($_GET['products_id']) . "\n\n";
        
        
        $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')';
        $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
        // Send message
        // reuse contact_us form so we get the correct reply-to and don't have
        // to change includes/functions/functions_email.php (which has special
        // hooks for contact_us.
        zen_mail($send_to_name, $send_to_email, EMAIL_SUBJECT, $text_message, $name, $email_address, $html_msg,'contact_us');
    
        zen_redirect(zen_href_link(FILENAME_ASK_A_QUESTION, 'action=success&products_id='.$_GET['products_id']));
      } else {
        $error = true;
        if (empty($name)) {
          $messageStack->add('contact', ENTRY_EMAIL_NAME_CHECK_ERROR);
        }
        if ($zc_validate_email == false) {
          $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
        }
        if (empty($enquiry)) {
          $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
        }
      }
    } // end action==send
    
    // 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'];
    }
    
    if (CONTACT_US_LIST !=''){
      foreach(explode(",", CONTACT_US_LIST) as $k => $v) {
        $send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
      }
    }
    
    // include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_ASK_A_QUESTION, 'false');
    
    $breadcrumb->add(NAVBAR_TITLE);
    ?>

  4. #4
    Join Date
    Jul 2012
    Location
    Russia, Kazan
    Posts
    6
    Plugin Contributions
    0

    Default Re: "Ask A Question":add the manufacturer in the emails

    Hello
    How to make a field of the text message ($enquiry) not the obligatory?

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,832
    Plugin Contributions
    124

    Default Re: "Ask A Question":add the manufacturer in the emails

    @Produced - Welcome to the Zen Cart forum. When asking a new question, please start a new post - it's easier if there's one topic of discussion per thread. Thanks.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,832
    Plugin Contributions
    124

    Default Re: "Ask A Question":add the manufacturer in the emails

    @Matteo - can you switch admin to getting plain text emails and try my solution?
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Mar 2007
    Location
    italy
    Posts
    90
    Plugin Contributions
    2

    Default Re: "Ask A Question":add the manufacturer in the emails

    Quote Originally Posted by swguy View Post
    @Matteo - can you switch admin to getting plain text emails and try my solution?
    I can switch the admin getting text emails from here or from where in the admn panel?
    configuration.php?gID=12

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,832
    Plugin Contributions
    124

    Default Re: "Ask A Question":add the manufacturer in the emails

    Yes that is the correct page.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #9

    Default Re: "Ask A Question":add the manufacturer in the emails

    Quote Originally Posted by swguy View Post
    Yes that is the correct page.
    here configuration.php?gID=12&cID=262&action=edit
    Email Format Admin is set on TEXT.

    I don't find the line that you wrote, I get this code around the changes place at the end:
    Code:
      $extra_info['TEXT'];
        // Prepare HTML-portion of message
        $html_msg['EMAIL_MESSAGE_HTML'] = '<b>Product: </b><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']) . '">' . $product_info->fields['products_name'] . '</a><br />' . strip_tags($_POST['enquiry']);
        $email_body .= zen_get_products_manufacturers_name($_GET['products_id']) . "\n\n";
    	
        $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')';
        $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
    And it doeanst work, I receive the same email like first.
    www.lescaleachiocciola.eu = THE SPIRAL STAIRS

  10. #10
    Join Date
    Mar 2007
    Location
    italy
    Posts
    90
    Plugin Contributions
    2

    Default Re: "Ask A Question":add the manufacturer in the emails

    Email Format Admin is set on TEXT.
    I added that line and nothing happen, admin receive always the same emails. do you want my ftp data?

 

 

Similar Threads

  1. Change "Manufacturer" to "Artis" throughout the entire site
    By gv7660 in forum Customization from the Admin
    Replies: 6
    Last Post: 16 Sep 2013, 07:17 PM
  2. remove the border around "call for price" and reposition "ask us" button
    By b90702098 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 2 May 2012, 10:45 AM
  3. Replies: 5
    Last Post: 1 Oct 2011, 08:04 PM
  4. Replies: 0
    Last Post: 17 Mar 2010, 05:24 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR