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

Use email to receive pre-order mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 08-22-2008, 09:36 AM
 
rick2003 rick2003 is offline
 

Member
  
Join Date: Jan 2008
Posts: 20
 

Default Use email to receive pre-order mod

I have try the back in stock however i found that too dificult to modify.

However, i have found the direct product equiry form at xcartmods.co.uk,

and modify a little bit.

usefull if you have a new Comming Soon category:

and when product is out of stock,

the equiry form will appear, ask only for name and email. and it will send a

email to your specify email address.

When stock is back in stock, use email application such as Outlook to send email to those who wants the product.

download the enquiry form form here:

http://www.xcartmods.co.uk/x-cart-direct-product-enquiry-form-v4x-x-cart-mods-pr-29.html

edit equire.php, add the name of your database, username and password.

change the content of equire.tpl. delete the message field and phone field

Quote:
{capture name=dialog}

{literal}
<script language="Javascript"><!--
function XCM_enquire(){
var theForm = document.enquire;
var emailRE = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
var errMsg = "";
var setfocus = "";

if (theForm['code'].value == ""){
errMsg = "Please enter the code";
setfocus = "['code']";
}
if (theForm['questions'].value == ""){
errMsg = "Please enter a question";
setfocus = "['questions']";
}
if (!emailRE.test(theForm['email'].value)){
errMsg = "Please enter a valid email address";
setfocus = "['email']";
}
if (theForm['name'].value == ""){
errMsg = "Please enter your name";
setfocus = "['name']";
}
if (errMsg != ""){
alert(errMsg);
eval("theForm" + setfocus + ".focus()");
}
else theForm.submit();
}//-->
</script>
{/literal}

{if $js_enabled}

{if $smarty.get.sendenqok ne "1"}
<form action="enquire.php" method="post" name="enquire" id="enquire" onSubmit="XCM_enquire();return false;">
<input type="hidden" name="productid" value="{$product.productid}">
<input type="hidden" name="product" value="{$product.product}">
<input type="hidden" name="url" value="{$config.Company.company_website}">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="150">{$lng.lbl_Enquire_Name}:</td>
<td width="10"><font color="#FF0000">*</font></td>
<td><input name="name" type="text" id="name" {if $login ne ""}value="{$customer_info.firstname} {$customer_info.lastname}"{else}value=""{/if} size="30"></td>
</tr>
<tr>
<td>{$lng.lbl_Enquire_Email}:</td>
<td><font color="#FF0000">*</font></td>
<td><input name="email" type="text" id="email" {if $login ne ""}value="{$customer_info.email}"{else}value=" "{/if} size="30"></td>
</tr>
<tr>
<td>{$lng.lbl_Enquire_Code}:</td>
<td>&nbsp;</td>
<td><img src="enquire.php?captcha=yes"></td>
</tr>
{if $smarty.get.sendenqok eq "2"}
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>{$lng.lbl_Enquire_Bad_Code}</td>
</tr>
{/if}
<tr>
<td>{$lng.lbl_Enquire_Enter_Code}:</td>
<td><font color="#FF0000">*</font></td>
<td><input name="code" type="text" id="code" size="10" maxlength="5" onKeyUp="this.value=this.value.toUpperCase()" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
{include file="buttons/submit.tpl" type="input" style="button" href="javascript: return XCM_enquire();"} </td>
</tr>
</table>
</form>
{/if}

{if $smarty.get.sendenqok eq "1"}
{$lng.lbl_Enquire_Thanks}
{/if}

{else}
{$lng.lbl_Enquire_Enable_JS}
{/if}

{/capture}
{include file="dialog.tpl" title=$lng.lbl_Enquire_Ask content=$smarty.capture.dialog extra="width=100%"}

and then follow instruction, create "captcha" folder in the root directory, and CHMOD 777

open skin1/customer/main/product.tpl and after

Quote:
{if $config.Appearance.send_to_friend_enabled eq 'Y'}
<p />
{include file="customer/main/send_to_friend.tpl" }
{/if}

add

Quote:
{if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''}
{include file="customer/enquire.tpl"}
{/if}
<p />

when product is out of stock, the form will show up.

add new language variables to the database.

Quote:
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Ask','Notify Me When This Product is availiable','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Name','Name','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Email','Email','Labels');

INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Code','Code','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Enter_Code','Enter Code','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Bad_Code','Sorry, please enter the correct code.','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Enable_JS','To view this form, please enable Javascript on your browser.','Labels');
INSERT INTO xcart_languages VALUES ('US','lbl_Enquire_Thanks','Thank you for submitting your enquiry.','Labels');


upload all the files accordingly. demo please see . www.lywoo.com

out of stock page:

http://www.lywoo.com/product.php?productid=307&cat=5&page=2


full credit to xcartmods.co.uk
__________________
Version 4.1.9
Highly Modified X-cart

www.lywoo.com
Reply With Quote
  #2  
Old 08-22-2008, 11:38 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Use email to receive pre-order mod

Moving to Custom Mods
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
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 03:13 PM.

   

 
X-Cart forums © 2001-2020