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

if a product is outstock, notify when in stock - preorder

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 01-06-2005, 08:51 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

i have look at the site but cant find the module for this to buy please give me the link

maxking
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #42  
Old 01-15-2005, 07:03 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

Quote:
Originally Posted by funkydunk
http://www.prodynamix.co.uk/customer/product.php?productid=14&cat=20&page=1

It is available for purchase and download online.

I cant find this Stock Notify mod there, i have the old 3.4 Mod i think and i am trying to convert it to X-Cart 4.09., a friend of mine gave me this MOD to play with. Anyway i would prefer to buy this Mod for X-cart 4.09 as this is taking a lot of my time in trying to sort it out.

I have managed to get somewhere with this modification, but problem now on the email side.

I have changed the directory position of some of the files, for example notify.php is not in shopcart/customer/notify.php as per instructions its is now in shopcart/notify.php

Also the shopcart/skin1/main/product_modify.tpl as per instructions for X-Cart 3.4 was not changed but i inserted the code into shopcart/skin1/main/product_details.tpl for X-Cart 4.09 as i beleive this is the right place for it. (Open to suggestions )

Code:
<? # START - FROM SHOPCART/PRODUCT.PHP CODE X-CART 4.09 require "./auth.php"; # # Put all product info into $product array # $product_info = func_select_product($productid, @$user_account['membership']); if (intval($cat) == 0) { $cat = $product_info["categoryid"]; } $main = "product"; $smarty->assign("main",$main); include $xcart_dir.DIR_CUSTOMER."/send_to_friend.php"; if(!empty($active_modules["Product_Configurator"])) include $xcart_dir."/modules/Product_Configurator/pconf_customer_product.php"; if(!empty($active_modules["Detailed_Product_Images"])) include $xcart_dir."/modules/Detailed_Product_Images/product_images.php"; if(!empty($active_modules["Product_Options"])) include $xcart_dir."/modules/Product_Options/customer_options.php"; if(!empty($active_modules["Upselling_Products"])) include $xcart_dir."/modules/Upselling_Products/related_products.php"; if(!empty($active_modules["Advanced_Statistics"])) include $xcart_dir."/modules/Advanced_Statistics/prod_viewed.php"; if($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; # END - FROM SHOPCART/PRODUCT.PHP CODE X-CART 4.09 require $xcart_dir."/include/categories.php"; # NOW WE START WITH THE CHANGED FUNKYDUNKS CODE if(($login)&& ($product_info != "") && ($active_modules["stock_notify"])) { // ie they are looged in and have selected a product // echo "logged and ready to roll"; $userinfo = func_userinfo($login,$login_type); # $userinfo = func_userinfo($login, $current_area, true); // echo $userinfo['email']; // deletes their email if they are already watching this product db_query("delete from `xcart_notify` where email='" . $userinfo['email'] . "' and productid = $productid"); // add them to the notify table db_query("INSERT INTO `xcart_notify` ( `email` , `productid` ) VALUES ('" . $userinfo['email'] . "', '$productid')"); } else { if (($guestemail) && ($product_info != "") && ($active_modules["stock_notify"])){ // deletes their email if they are already watching this product db_query("delete from `xcart_notify` where email='" . $guestemail . "' and productid = $productid"); // add them to the notify table db_query("INSERT INTO `xcart_notify` ( `email` , `productid` ) VALUES ('" . $guestemail . "', '$productid')"); $smarty->assign("guestlogged","true"); } else{ if ($guest!="true"){ header("Location: error_message.php?access_denied"); exit(); } } } $smarty->assign("productid", $productid); $smarty->assign("userinfo", $userinfo); $smarty->assign("product",$product_info); $smarty->assign("main","notify"); # END OF THE CHANGED FUNKYDUNKS CODE # START - FROM SHOPCART/PRODUCT.PHP CODE X-CART 4.09 AT THE END # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); # END - FROM SHOPCART/PRODUCT.PHP CODE X-CART 4.09 AT THE END ?>

Any help will be appriciated or a place where i can buy the complete version for X-cart 4.09 as this is a very good mod for x-cart.
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #43  
Old 01-15-2005, 07:10 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

Hi there

Good work so far.

I also have the old code which I am working on altering to 4.0.x as yet I havent got far, too much time spent on other things, but this is a vital mod for businesses with a number of competitors who need to grab customers as soon as new products arrive in stock.

I am going to look over this code now, as soon as I get somewhere with it I will let you know, and we can compare it to get this working.

Keep in mind when posting code, this code is someone elses intellectual property, so FD might not be too happy with it being posted about.
But I guess he will have to answer that one.
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #44  
Old 01-15-2005, 08:06 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

Quote:
Originally Posted by CC
Keep in mind when posting code, this code is someone elses intellectual property

Yes i agree with you and really need FD's permision for this. As you know all the information for this product has not posted as there are more files. I have changed the shopcart/notify.php from the standard one that FD did, and have changed the begining to the same as shopcart/product.php which came with x-cart 4.09.
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #45  
Old 01-15-2005, 08:52 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

modify away.....

i am still eternally suprised that xcart have not adopted this as a core feature of xcart.
__________________
ex x-cart guru
Reply With Quote
  #46  
Old 01-15-2005, 10:37 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

Quote:
Originally Posted by funkydunk
modify away.....
Ok because Funkydunk has allowed me to modify the product, i have been sucessful on some of the code in X-cart 4.09

This is the shopcart/notify.php file for X-Cart 4.09
Code:
<?php # # $Id: notify.php, X-Cart 4.09 2005/01/18 Maxking Exp $ # require "./auth.php"; # # Put all product info into $product array # $product_info = func_select_product($productid, @$user_account['membership']); if (intval($cat) == 0) { $cat = $product_info["categoryid"]; } $main = "product"; $smarty->assign("main",$main); include $xcart_dir.DIR_CUSTOMER."/send_to_friend.php"; if(!empty($active_modules["Product_Configurator"])) include $xcart_dir."/modules/Product_Configurator/pconf_customer_product.php"; if(!empty($active_modules["Detailed_Product_Images"])) include $xcart_dir."/modules/Detailed_Product_Images/product_images.php"; if(!empty($active_modules["Product_Options"])) include $xcart_dir."/modules/Product_Options/customer_options.php"; if(!empty($active_modules["Upselling_Products"])) include $xcart_dir."/modules/Upselling_Products/related_products.php"; if(!empty($active_modules["Advanced_Statistics"])) include $xcart_dir."/modules/Advanced_Statistics/prod_viewed.php"; if($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; require $xcart_dir."/include/categories.php"; # NOW WE START WITH THE CHANGED FUNKYDUNKS CODE if(($login)&& ($product_info != "") && ($active_modules["stock_notify"])) { // ie they are logged in and have selected a product // echo "logged and ready to roll"; if (!empty($login)) $userinfo = func_userinfo($login,$login_type); // echo $userinfo['email']; // deletes their email if they are already watching this product db_query("DELETE FROM `xcart_notify` WHERE email='".$userinfo['email']."' AND productid= '$productid'"); // add them to the notify table db_query("INSERT INTO `xcart_notify` ( `email` , `productid` ) VALUES ('".$userinfo['email']."','$productid')"); } else { if (($guestemail) && ($product_info != "") && ($active_modules["stock_notify"])){ // ie they are NOT logged in and have selected a product // echo "NOT LOGGED and ready to roll"; // echo $guestemail // deletes their email if they are already watching this product db_query("DELETE FROM `xcart_notify` WHERE email='".$guestemail."' AND productid='$productid'"); // add them to the notify table db_query("INSERT INTO `xcart_notify` ( `email` , `productid` ) VALUES ('".$guestemail."','$productid')"); // $smarty->assign("guestlogged","true"); } else{ if ($guest!="true"){ header("Location: error_message.php?access_denied"); exit(); } } } # END OF THE CHANGED FUNKYDUNKS CODE $smarty->assign("productid", $productid); $smarty->assign("userinfo", $userinfo); $smarty->assign("product",$product_info); $smarty->assign("main","notify"); # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>


If you go to
http://www.shisha.co.uk/shopcart/notify.php?productid=16246&guest=true

You will now see it works for guests and members, but not checked email side yet.

You need to add the below to the SQL database.
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #47  
Old 01-16-2005, 07:41 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

I have added to the SQL database the below code and it seems to work ok, just need to sort out the emails. The above code works ok with a login user or a guest user now after adding the following SQL files.
I added these manualy in the Language section for text, email and Lables.
You just need to do one language and it replicates for the other 3 languages. (SE, FR and DE)
Code:
INSERT INTO xcart_languages VALUES ('DE', 'Notify Me', 'txt_addme_notify', 'Please enter your email in the box provided and we will notify you when stock arrives in.', 'Text'); INSERT INTO xcart_languages VALUES ('FR', 'Notify Me', 'txt_addme_notify', 'Please enter your email in the box provided and we will notify you when stock arrives in.', 'Text'); INSERT INTO xcart_languages VALUES ('SE', 'Notify Me', 'txt_addme_notify', 'Please enter your email in the box provided and we will notify you when stock arrives in.', 'Text'); INSERT INTO xcart_languages VALUES ('US', 'Notify Me', 'txt_addme_notify', 'Please enter your email in the box provided and we will notify you when stock arrives in.', 'Text'); INSERT INTO xcart_languages VALUES ('US', 'Stock Notify', 'txt_added_stock_notify', 'Thanks you will be sent a email when stock arrives back.', 'Text'); INSERT INTO xcart_languages VALUES ('SE', 'Stock Notify', 'txt_added_stock_notify', 'Thanks you will be sent a email when stock arrives back.', 'Text'); INSERT INTO xcart_languages VALUES ('FR', 'Stock Notify', 'txt_added_stock_notify', 'Thanks you will be sent a email when stock arrives back.', 'Text'); INSERT INTO xcart_languages VALUES ('DE', 'Stock Notify', 'txt_added_stock_notify', 'Thanks you will be sent a email when stock arrives back.', 'Text'); INSERT INTO xcart_languages VALUES ('DE', 'Stock Notify', 'lbl_stock_notify', 'Stock Notify', 'Labels'); INSERT INTO xcart_languages VALUES ('FR', 'Stock Notify', 'lbl_stock_notify', 'Stock Notify', 'Labels'); INSERT INTO xcart_languages VALUES ('SE', 'Stock Notify', 'lbl_stock_notify', 'Stock Notify', 'Labels'); INSERT INTO xcart_languages VALUES ('US', 'Stock Notify', 'lbl_stock_notify', 'Stock Notify', 'Labels'); INSERT INTO xcart_languages VALUES ('DE', 'Keep me updated', 'lbl_stock_notify_button', 'Keep me updated', 'Labels'); INSERT INTO xcart_languages VALUES ('FR', 'Keep me updated', 'lbl_stock_notify_button', 'Keep me updated', 'Labels'); INSERT INTO xcart_languages VALUES ('SE', 'Keep me updated', 'lbl_stock_notify_button', 'Keep me updated', 'Labels'); INSERT INTO xcart_languages VALUES ('US', 'Keep me updated', 'lbl_stock_notify_button', 'Keep me updated', 'Labels'); INSERT INTO xcart_languages VALUES ('DE', 'The following product is now back in stock and can be ordered by clicking on the link below', 'eml_stock_notification', 'The following product is now back in stock and can be ordered by clicking on the link below', 'E-Mail'); INSERT INTO xcart_languages VALUES ('FR', 'The following product is now back in stock and can be ordered by clicking on the link below', 'eml_stock_notification', 'The following product is now back in stock and can be ordered by clicking on the link below', 'E-Mail'); INSERT INTO xcart_languages VALUES ('SE', 'The following product is now back in stock and can be ordered by clicking on the link below', 'eml_stock_notification', 'The following product is now back in stock and can be ordered by clicking on the link below', 'E-Mail'); INSERT INTO xcart_languages VALUES ('US', 'The following product is now back in stock and can be ordered by clicking on the link below', 'eml_stock_notification', 'The following product is now back in stock and can be ordered by clicking on the link below', 'E-Mail');

Also added to SQL the following:

INSERT INTO xcart_modules VALUES (2,'stock_notify','Allows registered users to ask to be notified when a product is back in stock','Y');

Code:
CREATE TABLE xcart_notify ( email char(128) NOT NULL , productid int(11) NOT NULL , KEY email_proudct (email, productid), ) TYPE=MyISAM;
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #48  
Old 01-16-2005, 07:47 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

Hehe I see you have been buzzing on this.

I havent even looked at it in detail yet.
I get the feeling you will be done before I get started.

I am copying all these notes for when I look into it, if you have it working already by then I will at least look to see if we can add to it in anyway.
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #49  
Old 01-16-2005, 07:57 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

Quote:
Originally Posted by funkydunk
modify away.....

i am still eternally suprised that xcart have not adopted this as a core feature of xcart.
They are probably saving it for one of their $99.95 addons when they hope we have all forgotten about this thread.
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #50  
Old 01-16-2005, 07:57 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

The new template files you need are:
skin1/modules/stock_notify/addedtolist.tpl
Code:
{* addedtolist.tpl funkydunk.net 2003 *} {$lng.txt_added_stock_notify}

skin1/modules/stock_notify/stocknotify.tpl
Code:
{* stocknotify.tpl funkydunk.net 2003 - changed by Maxking *} {capture name=dialog} {if ($login ne "") or ($guestlogged ne "")} {include file="modules/stock_notify/addedtolist.tpl"} {else} {include file="check_email_script.tpl"} {include file="check_required_fields_js.tpl"} {$lng.txt_addme_notify} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var requiredFields = new Array(); requiredFields[0] = new Array('guestemail', "{$lng.lbl_send_your_email|strip_tags|replace:'"':'\"'}", false); </SCRIPT> <TABLE border="0"> <FORM action="notify.php" method="post" name="notify"> <INPUT type="hidden" name="mode" value="notify"> <INPUT type="hidden" name="productid" value="{$productid}"> <TR><TD class="FormButton">{$lng.lbl_send_your_email}:</TD> <TD><FONT class="Star">*</FONT></TD> <TD><INPUT value"Enter Your Email" id="guestemail" type="text" size="45" name="guestemail" onchange="javascript: checkEmailAddress(this);"></TD> </TR> <TR> <TD> {include file="buttons/submit.tpl" style="button" button_title=$lng.lbl_stock_notify_button href="javascript: if(checkRequired('')) document.notify.submit();"}</TD> </TR> {/if} </FORM> </TABLE> {/capture} {include file="dialog.tpl" title=$lng.lbl_stock_notify content=$smarty.capture.dialog extra="width=100%"}

skin1/modules/stock_notify/notifyme.tpl
Code:
{* notifyme.tpl funkydunk.net 2003 *} {if $login ne ""} {include file="buttons/notifyme.tpl"} {else} {include file="buttons/notifyme.tpl"} {/if}

skin1/buttons/notifyme.tpl
Code:
<font class=FormButton>{$lng.lbl_stock_notify_button} [img]{$ImagesDir}/notifyme.gif[/img]</font>

skin1/mail/stock_notify.tpl
Code:
{* $Id: signin_admin_notification.tpl,v 1.4.2.1 2003/02/11 09:03:02 svowl Exp $ *} {$lng.lbl_hello} {$userinfo.firstname}, {$lng.eml_stock_notification}: {$product.product} =========================================== {$product.descr} {$lng.eml_please_click_link}: {$http_location}/customer/product.php?productid={$product.productid} {include file="mail/signature.tpl"}

skin1/mail/html/stock_notify.tpl
Code:
{* $Id: Stock Notify (html) - Maxking Exp $ *} {config_load file="$skin_config"} {include file="mail/html/mail_header.tpl"} {$lng.lbl_hello} {$userinfo.firstname}, {$lng.eml_stock_notification}: {$lng.eml_please_click_link}: {$http_location}/customer/product.php?productid={$product.productid} {$lng.eml_please_click_link} {include file="mail/html/signature.tpl"}

skin1/mail/stock_notify_subj.tpl

Code:
{config_load file="$skin_config"}{ $config.Company.company_name }: Product back in stock !!
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
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:56 AM.

   

 
X-Cart forums © 2001-2020