Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Product Inquiry form for 4.0+

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-11-2006, 04:20 PM
 
junaid junaid is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 96
 

Default 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.
__________________
xcart 4.18 on linux
Reply With Quote
  #2  
Old 07-02-2006, 07:25 AM
 
webtron webtron is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 64
 

Default

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

Thanks.
__________________
Thanks to for your comments/help.
X-cart Version 4.0.17
Reply With Quote
  #3  
Old 07-25-2006, 06:39 PM
 
TTHTG TTHTG is offline
 

Newbie
  
Join Date: Jul 2006
Posts: 7
 

Default

Great mod,
is it possible to make this a popup?
__________________
Main Server (Dedicated)
----------------------------------------------------
Apache version 1.3.37 (Unix)
PHP version 4.4.7

Database Server (Dedicated)
----------------------------------------------------
Apache version 1.3.37 (Unix)
PERL version 5.8.8
PHP version 4.4.7
MySQL version 4.1.21-standard

X-Cart Version
----------------------------------------------------
4.0.17 Heavily Modded
Reply With Quote
  #4  
Old 09-27-2006, 08:50 PM
 
Kerbsp Kerbsp is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 95
 

Default 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);
__________________
Xcart 4.0.17 - XAOM - XRMA - Special Offer - Sales & Stats
______
www.futurevis.com
Reply With Quote
  #5  
Old 10-30-2007, 10:12 AM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default 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!
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #6  
Old 10-30-2007, 06:04 PM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default 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.
Reply With Quote
  #7  
Old 10-31-2007, 07:04 AM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default 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.
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #8  
Old 10-31-2007, 07:46 AM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default 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?
Reply With Quote
  #9  
Old 10-31-2007, 09:04 AM
 
lizlee00 lizlee00 is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default 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.
__________________
-Liz
Version 4.1.8
www.partssystems.com
Reply With Quote
  #10  
Old 10-31-2007, 09:23 AM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default 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
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020