X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Product Inquiry form for 4.0+ (https://forum.x-cart.com/showthread.php?t=20454)

junaid 03-11-2006 04:20 PM

Product Inquiry form for 4.0+
 
Hi,
i had managed to complete a small mod whereby a customer can enquire about a product from admin for version 4.0+.
----
this is for version 4.0+ and tested on 4.017 for older versions there is better mod here http://forum.x-cart.com/viewtopic.php?t=15362 .
--------------------------------
we would be using send to friend.php as base.

add following lines to send to friend.php before ?> .
if you could notice below text is similar to code already on file just mode changed.
Quote:

if($mode == 'enquire') {
if($email && $from && $name) {
$mail_smarty->assign ("product", $product_info);
$mail_smarty->assign ("name", $name);
$mail_smarty->assign ("query", $query);
func_send_mail ($email, "mail/querysub.tpl", "mail/queryap.tpl", $from, $query, false);
$top_message["content"] = func_get_langvar_by_name("txt_inquiry_sent");
} else {
$top_message["content"] = func_get_langvar_by_name("err_filling_form");
$top_message["type"] = "E";
}
func_header_location("product.php?productid=".$pro ductid);
}

now create following files.
mail/queryap.tpl
mail/querysub.tpl
mine are as below.

mail/queryap.tpl

Quote:

{* $Id: send2friend.tpl,v 1.2 2004/05/31 10:52:01 max Exp $ *}
{config_load file="$skin_config"}
{include file="mail/mail_header.tpl"}
{assign var=max_truncate value=$config.Email.max_truncate}{math assign="max_space" equation="x+5" x=$max_truncate}{assign var="max_space" value="%-"|cat:$max_space|cat:"s"}

{$lng.lbl_hello}

{$name} has following query about the Product "{$product.product}" at http://www.yourURL.com/shop/product.php?productid={$product.productid}

{$query}

{include file="mail/signature.tpl"}



mail/querysub.tpl
Quote:

{config_load file="$skin_config"}Inquiry about {$product.product}

Now Create a language variable which would inform customer that inquiry is sent.
txt_inquiry_sent

add form code in product.tpl you can do it via .tpl file or directly copying into product.tpl

Quote:

<TABLE width="450" border="0" class="send-friend">
<FORM action="product.php" method="post" name="enquire">
<INPUT type="hidden" name="mode" value="enquire">
<INPUT type="hidden" name="productid" value="{$product.productid}">
<INPUT id="send_to" type="hidden" size="45" name="email" value="Your email@yoursite.com">

<TR>
<TD class="FormButton">Your Name :</TD>
<TD><FONT class="Star">*</FONT></TD>
<TD><INPUT id="send_name" type="text" size="45" name="name"></TD>
</TR>

<TR>
<TD class="FormButton">Your Email :</TD>
<TD><FONT class="Star">*</FONT></TD>
<TD><INPUT id="send_from" type="text" size="45" name="from"></TD>
</TR><tr>
<td valign="top" class="FormButton">Query</td>
<td valign="top"><FONT class="Star">*</FONT></td>
<td><TEXTAREA name="query" cols="40" rows="5"></TEXTAREA></td></tr>
<TR align="center">
<TD colspan="3">

<INPUT type="submit" name="Submit" value="Submit"></TD>
</TR>

</FORM>
</TABLE>

i hope this would be of help.

webtron 07-02-2006 07:25 AM

This sounds interesting. You have it working somewhere were we can see it?

Thanks.

TTHTG 07-25-2006 06:39 PM

Great mod,
is it possible to make this a popup?

Kerbsp 09-27-2006 08:50 PM

Re: Product Inquiry form for 4.0+
 
Quote:

Originally Posted by junaid
if($mode == 'enquire') {
if($email && $from && $name) {
$mail_smarty->assign ("product", $product_info);
$mail_smarty->assign ("name", $name);
$mail_smarty->assign ("query", $query);
func_send_mail ($email, "mail/querysub.tpl", "mail/queryap.tpl", $from, $query, false);
$top_message["content"] = func_get_langvar_by_name("txt_inquiry_sent");
} else {
$top_message["content"] = func_get_langvar_by_name("err_filling_form");
$top_message["type"] = "E";
}
func_header_location("product.php?productid=".$pro ductid);
}


Replace ".$pro ductid); with ".$productid);

lizlee00 10-30-2007 10:12 AM

Re: Product Inquiry form for 4.0+
 
Hi,
I was wondering if anyone has gotten this to work on 4.1.8? I tried using the code, but when I add the above code to my send_to_friend.php file my product pages stop loading. Any ideas?

Thanks!

exsecror 10-30-2007 06:04 PM

Re: Product Inquiry form for 4.0+
 
lizlee00 you can use the product inquiry mod available at xcartmods.co.uk, we use it and it works very well for us, we have it interfaced with our internal ticket support system and it really has cut down on phone call.

lizlee00 10-31-2007 07:04 AM

Re: Product Inquiry form for 4.0+
 
Thanks for the reply Alan. I've tried the product enquiry form from xcartmods.co.uk. Phil does wonderful mods! However, with that one I have a problem with the captcha image not working in the HTML catalog. Searching through these boards it looks like someone else had the same problem, but it was never resolved. Thats why I decided to try and use this mod.

exsecror 10-31-2007 07:46 AM

Re: Product Inquiry form for 4.0+
 
Strange lizlee because we use the HTML catalog and the captcha image works fine, did you make sure the permissions on the captcha folder were correct?

lizlee00 10-31-2007 09:04 AM

Re: Product Inquiry form for 4.0+
 
I'm sure I had the captcha folder with the correct permissions. What I ended up doing is just modified the code to remove the captcha feature. Works great when I did that, and I think we'll be okay without the captcha feature.

exsecror 10-31-2007 09:23 AM

Re: Product Inquiry form for 4.0+
 
You should if not you'll definitely know, it's rather odd that it wasn't working though


All times are GMT -8. The time now is 05:46 AM.

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