aslanstudios Posted February 23, 2004 Posted February 23, 2004 I have both actual shipped products and downloaded products. Is it possible to have the Order Status update to Delivered for the download products only, thereby allowing instant downloads? I look at the Download Contoller Contribute, but it's not working properly and from the post it looks like the SQL error is pretty unanimous and no one is quite sure how to get past it. I was hoping there was a straight forward solution out there somewhere. Any advice?
Guest Posted February 25, 2004 Posted February 25, 2004 I have both actual shipped products and downloaded products. Is it possible to have the Order Status update to Delivered for the download products only, thereby allowing instant downloads? I look at the Download Contoller Contribute, but it's not working properly and from the post it looks like the SQL error is pretty unanimous and no one is quite sure how to get past it. I was hoping there was a straight forward solution out there somewhere. Any advice? We recently did this on our site; when a customer purchases only download items we change the status to delivered. We do not actually have downloading of the product as a part of the order (ie, via the download Controller, etc.) on this cart since you can download for free and we just email a serial # upon purchase for unlocking the game. Not sure how much help this will be, but here is my code for doing this: // if all products ordered have regkeys sent, then we can set status to 'Delivered' if ( count($products_reg_array) == $total_product_count ) { // get the status value for the 'delivered' status (using english reference) $mystatus_query = "select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Delivered'"; $status_query = tep_db_query($mystatus_query); $status_code = tep_db_fetch_array($status_query); if (empty($status_code)) { echo REG_ERROR_STATUS; break; } // change status on order to 'delivered' $myorder_query = 'update ' . TABLE_ORDERS . ' set orders_status='.$status_code['orders_status_id'].' where orders_id='.$orders['orders_id']; $order_query = tep_db_query($myorder_query); if (empty($order_query)) { echo REG_ERROR_STATUS_UPDATING; break; } // add status change to history file $sql_data_array = array('orders_id' => $orders['orders_id'], 'orders_status_id' => $status_code['orders_status_id'], 'date_added' => 'now()', 'customer_notified' => 'no', 'comments' => 'Product Registration Keys emailed.'); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); } This code is at the bottom of "checkout_success.php" just before: $content = CONTENT_CHECKOUT_SUCCESS; require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE); require(DIR_WS_INCLUDES . 'application_bottom.php');
Recommended Posts
Archived
This topic is now archived and is closed to further replies.