X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   mail notification in func_place_order(),func_process_order() (https://forum.x-cart.com/showthread.php?t=1385)

minorgod 02-04-2003 12:18 PM

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?

TeeJay 02-04-2003 03:00 PM

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 1168):

====
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.

minorgod 02-05-2003 11:48 AM

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?


All times are GMT -8. The time now is 08:27 AM.

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