skeedo Posted January 2, 2003 Posted January 2, 2003 Would also like to be able to email customers with other order statuses if possible, anyone know how I could accomplish this?
wizardsandwars Posted January 2, 2003 Posted January 2, 2003 Actually, OSC does email customers every time their status is upgraded. Theoretically, you could create a special status called "Backorder", and when the order is updated to that, the customer would be notified automatically. On another note, how do you handle the legal ramifications of a backorder, since legally, you are not supposed to be charging people's credit cards until the day the item is being shipped. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
dreamscape Posted January 2, 2003 Posted January 2, 2003 On another note, how do you handle the legal ramifications of a backorder, since legally, you are not supposed to be charging people's credit cards until the day the item is being shipped. well if you have a "real" merchant account, you have to go in and manual transfer the money into your account when the item is shipped (or are supposed to)... you can have a hold for the amount placed on the card though so you are sure the money is there when it is time to transfer it to your account... if you are talking about paypal though, I really dunno... since it is paypal that has the merchant account in this scenario, I would think any legal issues like this (card being charged on a backorder) would fall back on them (or at least I think should)... and now here comes patrick to tell us how wonderful paypal is :) (j/k patrick... you know we have to have fun around here too :D ) The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke
wizardsandwars Posted January 2, 2003 Posted January 2, 2003 Yeah, I think that we will always offer PayPal, but it is definatly time to replace 2checkout with a real merchnat account. At over 120 transactions per month now, it going to be cheaper, al well as more flexible. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
skeedo Posted January 2, 2003 Author Posted January 2, 2003 Actually, OSC does email customers every time their status is upgraded. Naw, really? :roll: I'm talking about email ALL customers at once with a certain email that have an order or orders with the status backorder.
wizardsandwars Posted January 2, 2003 Posted January 2, 2003 I guess you might have gotten the answer you were looking for if you had included all of the criteria in the question. :roll: Ever hear of SQL? :roll: ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
skeedo Posted January 2, 2003 Author Posted January 2, 2003 I'm sure SQL would be a great solution but I do not know much of it, and I even had a Database Administration class in college that I did well in. I fear those brain cells are long destroyed. Maybe an SQL master can tell me how to do these: -Email all customers with orders containing status "X" -Remove all orders with status "X" -Change all orders with status "X" to status "Y"
wizardsandwars Posted January 3, 2003 Posted January 3, 2003 Well, the first and the third would be pretty easy. I can whip it up for you in just a few short mimutes. However, you are going to need myphpAdmin in order to facillitate these queries. The second one is a bit more complicated, and would need to be addressed by someone a bit more in the know with how OSC handles deleting an order. I know that it affects several tables, and in some tables, several rows. And do me a favor, and knock off the 'rolling eyes' icon. Your quesiton was vague, and you got a simple direct answer to it to begin with. It's irritating to help someone and get an attitude in return for your trouble. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
wizardsandwars Posted January 3, 2003 Posted January 3, 2003 OK, here's the first one. <?php require("includes/application_top.php"); $type="Backordered"; $email_order_status_subject="You order is on Backorder"; $followup_email_text="Put the text of your email here."; $order_status_query_raw = "SELECT customers.customers_firstname, customers.customers_email_address FROM customers, orders, orders_status WHERE customers.customers_id = orders.customers_id AND orders.orders_status = orders_status.orders_status_id AND orders_status.orders_status_name = $type"; $order_status_query = tep_db_query($order_status_query_raw); while ($order_status = tep_db_fetch_array($max_id_query)) { tep_mail('', $order_status['customers_email_address'], $email_order_status_subject, "Hello ".$order_status['customers_firstname'] ."," . $followup_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); } ?> I'll not accept responsibility for the outcome of this code, however, this should email all of your customers with whatever type of order status you define at the top. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
wizardsandwars Posted January 3, 2003 Posted January 3, 2003 And i may be mistaken, but I believe this is houw you would do the third, without haveing to use myphpAdmin <?php $old_status="Backordered"; $new_type="Cancelled"; $order_status_query_raw = "SELECT orders_status_id FROM orders_status WHERE orders_status_name = $old_status"; $order_status_query = tep_db_query($order_status_query_raw); while ($order_status = tep_db_fetch_array($max_id_query)) {$status_id = $order_statu['orders_status_id'];} $update_status_raw = "UPDATE orders SET orders_status = $new_type WHERE orders_status = $old_status"; $order_status = tep_db_query($update_status_raw); ?> I may need to have someone more familiar with php to verify that this will work iwth an update statement. Anyway, I'm through for the night. :roll: ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
wizardsandwars Posted January 3, 2003 Posted January 3, 2003 Looks like I may have overlooked a section of that third part. It should look more like this <?php $old_status_name="Backordered"; $new_type_name="Cancelled"; $old_order_status_query_raw = "SELECT orders_status_id FROM orders_status WHERE orders_status_name = $old_status"; $old_order_status_query = tep_db_query($old_order_status_query_raw); while ($old_order_status = tep_db_fetch_array($old_order_status_query)) {$old_status_id = $old_order_status['orders_status_id'];} $new_order_status_query_raw = "SELECT orders_status_id FROM orders_status WHERE orders_status_name = $new_status"; $new_order_status_query = tep_db_query($new_order_status_query_raw); while ($new_order_status = tep_db_fetch_array($new_order_status_query)) {$new_status_id = $new_order_status['orders_status_id'];} $update_status_raw = "UPDATE orders SET orders_status = $new_status_id WHERE orders_status = $old_status_id "; $update_status = tep_db_query($update_status_raw); ?> Although, I think this may still be partially wrog, because I don't think that 'tep_db_query' actually executes the query. However, I know for a fact that I've wasted enough time on this for tonight. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
skeedo Posted January 5, 2003 Author Posted January 5, 2003 Have you tested any of this or am I the guinea pig?
wizardsandwars Posted January 5, 2003 Posted January 5, 2003 They are both fairly straightforward. I'm pretty confident about the first one, and I have done some testing, however, they were only meant to give you something to work with. If you want a script fully developed and fully tested, with full support, you may want to hire a developer. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.