X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Contact us form - department emails (https://forum.x-cart.com/showthread.php?t=9520)

erit 09-23-2004 01:44 PM

Contact us form - department emails
 
Hi,

Does anyone know how to modify the contact us form so that the message is sent to different deparments (different emails) depending on what the user chose in the Department drop-down?

Example, if I choose "Sales" in the department drop-down, I want it to go to sales@mycompany.com.

Thanks,
eriT

willirl 09-24-2004 04:09 AM

these are tied to the email addresses for sales, support, etc.. you enter in the General Settings - Company settings (or was it email settings?)

erit 09-25-2004 06:33 AM

Thanks for the reply, but not really... the always go to the Support email.

I know what I have to change is in includes/help.php , but I don't know how to do it.

eriT

cotc2001 09-25-2004 06:38 AM

it helps if you put the version number you are using in your signature

erit 09-25-2004 06:55 AM

Thanks!

cotc2001 09-25-2004 07:46 AM

Ok running the same 4.0.3 as you but on linux, and yes you are right it doesnt matter what email address's you change in company options so it must be a bug in codeing.

I'm off to just check the 4.0.4 changelog and see if it's been fixed.

erit 09-27-2004 05:14 AM

This is from includes/help.php:

Code:

...
func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);
...


As you can see, it sends the email to "support_department" no matter what the user selects in the drop-down. :cry:

cotc2001 10-01-2004 03:35 AM

Ok you are all going to love this!!! x-cart have a touch of the Microsoft fever i.e it's not a bug its a feature.

Quote:

>It doesnt matter what email address's you change in company options if you submit
>a contact us entry and choose different departments to send it to it always goes to
>the same email address

Our Quality department informed me that it was default behaviour. The expected scenario
is:

1. customer submits 'Contact us' form
2. X-Cart sends the message to the Support department
3. Support department forwards the messages to the appropriate department

If that is the case what is the point of being able to change the email address's for departments if it can only goto one anyway???

It worked fine and as it should of done in 3.5.x versions but as you can see above x-cart don't think it should anymore

shan 10-01-2004 04:44 AM

Quote:

Originally Posted by cotc2001
Ok you are all going to love this!!! x-cart have a touch of the Microsoft fever i.e it's not a bug its a feature.

Quote:

>It doesnt matter what email address's you change in company options if you submit
>a contact us entry and choose different departments to send it to it always goes to
>the same email address

Our Quality department informed me that it was default behaviour. The expected scenario
is:

1. customer submits 'Contact us' form
2. X-Cart sends the message to the Support department
3. Support department forwards the messages to the appropriate department

If that is the case what is the point of being able to change the email address's for departments if it can only goto one anyway???

It worked fine and as it should of done in 3.5.x versions but as you can see above x-cart don't think it should anymore


classic

cotc2001 10-01-2004 05:08 AM

I am right in thinking that they are being daft aren't I??? (creeping doubt takes hold)

erit 10-01-2004 05:13 AM

cotc2001, can you post the includes/help.php from your 3.5.x install here? If X-Cart doesn't wanna help... we're just gonna have to do things ourselves 8)

cotc2001 10-01-2004 05:25 AM

sure no problem this is from 3.5.10

Code:

<?php
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart                                                                      |
| Copyright (c) 2001-2004 Ruslan R. Fazliev <rrf@rrf.ru>                      |
| All rights reserved.                                                        |
+-----------------------------------------------------------------------------+
| PLEASE READ  THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" |
| FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE  |
| AT THE FOLLOWING URL: http://www.x-cart.com/license.php                    |
|                                                                            |
| THIS  AGREEMENT  EXPRESSES  THE  TERMS  AND CONDITIONS ON WHICH YOU MAY USE |
| THIS SOFTWARE  PROGRAM  AND  ASSOCIATED  DOCUMENTATION  THAT  RUSLAN  R. |
| FAZLIEV (hereinafter  referred to as "THE AUTHOR") IS FURNISHING  OR MAKING |
| AVAILABLE TO YOU WITH  THIS  AGREEMENT  (COLLECTIVELY,  THE  "SOFTWARE").  |
| PLEASE  REVIEW  THE  TERMS  AND  CONDITIONS  OF  THIS  LICENSE AGREEMENT |
| CAREFULLY  BEFORE  INSTALLING  OR  USING  THE  SOFTWARE.  BY INSTALLING, |
| COPYING  OR  OTHERWISE  USING  THE  SOFTWARE,  YOU  AND  YOUR  COMPANY |
| (COLLECTIVELY,  "YOU")  ARE  ACCEPTING  AND AGREEING  TO  THE TERMS OF THIS |
| LICENSE  AGREEMENT.  IF  YOU    ARE  NOT  WILLING  TO  BE  BOUND BY THIS |
| AGREEMENT, DO  NOT INSTALL OR USE THE SOFTWARE.  VARIOUS  COPYRIGHTS  AND |
| OTHER  INTELLECTUAL  PROPERTY  RIGHTS    PROTECT  THE  SOFTWARE.  THIS |
| AGREEMENT IS A LICENSE AGREEMENT THAT GIVES  YOU  LIMITED  RIGHTS  TO  USE |
| THE  SOFTWARE  AND  NOT  AN  AGREEMENT  FOR SALE OR FOR  TRANSFER OF TITLE.|
| THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT.      |
|                                                                            |
| The Initial Developer of the Original Code is Ruslan R. Fazliev            |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2004          |
| Ruslan R. Fazliev. All Rights Reserved.                                    |
+-----------------------------------------------------------------------------+
\*****************************************************************************/

#
# $Id: help.php,v 1.33.2.1 2004/02/05 12:25:46 mclap Exp $
#

if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

if (!empty($login))
        $userinfo = func_userinfo($login,$login_type);

if (empty($section)) $section = "";

if ($REQUEST_METHOD=="POST" and $action=="contactus") {
#
# Send mail to support
#
        $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);

        while (list($key,$val) = each($HTTP_POST_VARS))
                $contact[$key]=$val;

    $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

        if(!$fillerror) {
                $contact["b_statename"]= func_get_state($contact["b_state"], $contact["b_country"]);
                $contact["b_countryname"]= func_get_country($contact["b_country"]);

                $mail_smarty->assign("contact",$contact);

                func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);

                func_header_location("help.php?section=contactus");
        } else {
                $userinfo = $HTTP_POST_VARS;
                $userinfo["login"] = $userinfo["uname"];
        }
}
#
# Recover password
#
if ($REQUEST_METHOD=="POST" and $action=="recover_password") {

$accounts = func_query("select login, password, usertype from $sql_tbl[customers] where email='$email' and status='Y'");

#
# Decrypt passwords
#
if($accounts) {
        foreach($accounts as $key=>$account)
                $accounts[$key]["password"]=text_decrypt($accounts[$key]["password"]);

        $mail_smarty->assign("accounts",$accounts);

        func_send_mail($email, "mail/password_recover_subj.tpl", "mail/password_recover.tpl", $config["Company"]["support_department"], false);

        func_header_location("help.php?section=Password_Recovery_message&email=".urlencode($email));
}
else
        func_header_location("help.php?section=Password_Recovery_error&email=".urlencode($email));

}

if ($section=="contactus") {
        include $xcart_dir."/include/states.php";
        include $xcart_dir."/include/countries.php";
}

$smarty->assign("userinfo",@$userinfo);
$smarty->assign("fillerror",@$fillerror);

$smarty->assign("main","help");
$smarty->assign("help_section",$section);

?>


and for reference this is from 3.3.3 which i know for a fact worls as it should

Code:

<?
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart                                                                      |
| Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved.            |
+-----------------------------------------------------------------------------+
| The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized  |
| reproduction of software or use of illegally obtained software. Making      |
| illegal copies of software is prohibited. Individuals who violate copyright |
| law and software licensing agreements may be subject to criminal or civil  |
| action by the owner of the copyright.                                      |
|                                                                            |
| 1. It is illegal to copy a software, and install that single program for    |
| simultaneous use on multiple machines.                                      |
|                                                                            |
| 2. Unauthorized copies of software may not be used in any way. This applies |
| even though you yourself may not have made the illegal copy.                |
|                                                                            |
| 3. Purchase of the appropriate number of copies of a software is necessary  |
| for maintaining legal status.                                              |
|                                                                            |
| DISCLAIMER                                                                  |
|                                                                            |
| THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY  |
| EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE      |
| DISCLAIMED.  IN NO EVENT SHALL Ruslan R. Fazliev OR ITS          |
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,      |
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,        |
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,    |
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR    |
| OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF      |
| ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                  |
|                                                                            |
| The Initial Developer of the Original Code is Ruslan R. Fazliev.          |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002          |
| Ruslan R. Fazliev. All Rights Reserved.                                    |
+-----------------------------------------------------------------------------+
\*****************************************************************************/

#
# $Id: help.php,v 1.26 2002/11/14 07:58:19 zorg Exp $
#

$userinfo = func_userinfo($login,$login_type);

if ($REQUEST_METHOD=="POST" and $action=="contactus") {
#
# Send mail to support
#
        $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);

        while (list($key,$val) = each($HTTP_POST_VARS))
                $contact[$key]=$val;

    $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

        if(!$fillerror) {
                $contact["b_statename"]= array_pop(func_query_first("SELECT $sql_tbl[states].state  FROM $sql_tbl[customers], $sql_tbl[states] WHERE $sql_tbl[states].code='$contact[b_state]'"));
                $contact["b_countryname"]= array_pop(func_query_first("SELECT $sql_tbl[countries].country FROM $sql_tbl[customers], $sql_tbl[countries] WHERE $sql_tbl[countries].code='$contact[b_country]'"));

                $mail_smarty->assign("contact",$contact);

                func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);

                header("Location: help.php?section=contactus");
                exit;
        } else {
                $userinfo = $HTTP_POST_VARS;
                $userinfo["login"] = $userinfo["uname"];
        }
}
#
# Recover password
#
if ($REQUEST_METHOD=="POST" and $action=="recover_password") {

$accounts = func_query("select login, password, usertype from $sql_tbl[customers] where email='$email' and status='Y'");

#
# Decrypt passwords
#
if($accounts) {
        foreach($accounts as $key=>$account)
                $accounts[$key]["password"]=text_decrypt($accounts[$key]["password"]);

        $mail_smarty->assign("accounts",$accounts);

        func_send_mail($email, "mail/password_recover_subj.tpl", "mail/password_recover.tpl", $config["Company"]["support_department"], false);

        header("Location: help.php?section=Password_Recovery_message&email=".urlencode($email));
}
else
        header("Location: help.php?section=Password_Recovery_error&email=".urlencode($email));

}

require "../include/states.php";
require "../include/countries.php";

$smarty->assign("userinfo",$userinfo);
$smarty->assign("fillerror",$fillerror);

$smarty->assign("main","help");
$smarty->assign("help_section",$section);

?>


cotc2001 10-28-2004 12:35 AM

Ok got a final response from x-cart on this, no budging on the fact that the contact us form departments are NOT tied in with the company details, see below.

Quote:

Dear Adam,

> In that case what is the point of being able to set different email address's in
> the admin for departments if they all goto the same person as deafault? it
> didn't work that way in 3.5.x versions.
> It is a bug your quality department just don't want to admit it, I'll forward
> your reply to the x-cart forums and see if other x-cart customers agree with me.
>
> Thanks for letting me know.

Due to the consideration we decided that there should be a responsive person
(or even a group of persons) who redirects customer messages to the appropriate
departments. So this is just the standard X-Cart behavior which X-Cart architects
consider to be the most suitable. We resolved not to implement the feature you
described into standard X-Cart.

However since X-Cart is open source software it can be customized to meet your needs.
You can modify the cart by yourself (if you are familiar with php
programming and know x-cart architecture) or order our custom development service.

If you decide to order the service it will cost you from 25 USD depending on
complexity of the required modifications. Please, let us know your decision
and we'll forward your message to the Quote manager. He will discuss the details
of the project with you and issue you a quote.
--
Sincerely yours,
Sergey Kashkirov,
Technical support engineer


All times are GMT -8. The time now is 06:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.