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

mail notification in func_place_order(),func_process_order()

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-04-2003, 12:18 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default mail notification in func_place_order(),func_process_order()

I'm trying to limit the number of extraneous e-mail notifications sent to the store admin in xcart 3.3.1. I see two functions in the /include/func.php file where I could edit this functionality. I'm not sure which function contains the appropriate code though, or which function is called during customer checkout. Could someone please clue me into the difference in these two functions? I've already edited the func_place_order() for functionality that depends on order success and failure, but I can't really tell when the func_process_order() comes into play. Both functions appear to send e-mail notifications, but why would one function contain some of the same notifications as the other. Are both functions called during customer checkout or is only the func_place_order() called during checkout?
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #2  
Old 02-04-2003, 03:00 PM
 
TeeJay TeeJay is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: UK
Posts: 85
 

Default Support message that I received on a similar problem

Here are instructions how to eliminate email notifications about initially plased orders (orders with status I):

You can fix this issue for X-cart version 3.3.X in a following way:

Edit script include/func.php
find the following piece of code (it is located in the function func_place_order() line 116:

====
func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $userinfo["email"], true, true);

func_send_mail($userinfo["email"], "mail/order_customer_subj.tpl", "mail/order_customer.tpl", $config["Company"]["orders_department"], false);
====
and comment these 2 lines (symbol #):
====
#func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $userinfo["email"], true, true);

#func_send_mail($userinfo["email"], "mail/order_customer_subj.tpl", "mail/order_customer.tpl", $config["Company"]["orders_department"], false);
====
X-cart will stop sending you notifications of orders preplacement.
__________________
X-Cart 4.0

Windoze XP Pro
Sick and tired of figuring out code just wanna get on with my life and selling my goods, it\'s raining here too
Reply With Quote
  #3  
Old 02-05-2003, 11:48 AM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default thanks, but...

Thanks for the help. Unfortunately, this doesn't quite answer my question. It would be really nice if we could talk the x-cart developers into writing a brief explanation of how the checkout process works. I've been tweaking this cart for months and built entire modules without fully understanding the way x-cart places orders.

It seems like xcart first calls the func_place_order() and does all the payment processing.

Then it looks like xcart calls the func_process_order() function and does some more stuff.

Then there's another function called func_complete_order() which does some other stuff, but from what I can tell, is never called by anything during a normal checkout.

What I'd like, is some kind of explanation of how all the functions are supposed to work together. Like a walkthrough that explains what happens with each function depending on what the $status and $order_status variables are set to.

At the moment, I'm trying to reimplement a digital subscription module that does things if an order is successfully processed. I have put the conditional inside the func_place_order() function, which worked great in xcart 3.1.3a, but now in version 3.3.1, it no longer works. Here's the old code that worked in version 3.1.3a:

Inside the func_place_order() function I added the following code below the regular subscription module code...
Code:
# # Insert into subscription_customers table (for subscription products) # if ($active_modules["Subscriptions"]) include "../modules/Subscriptions/subscriptions_cust.php"; # Insert into digital_subscription_customers table (for digital subscription products) # if ($active_modules["DigitalSubscriptions"] && ($order_status=="P" || $order_status=="C")) include "../modules/DigitalSubscriptions/digital_subscriptions_cust.php";

I've also tried changing the conditional to test $status instead of $order_status, but to no avail.

I'm wondering if this code should be placed in the func_process_order() function instead, but I can't tell since I don't know how the orders are really being placed. Anyone?
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:36 PM.

   

 
X-Cart forums © 2001-2020