swissarmyknife Posted July 22, 2005 Share Posted July 22, 2005 (edited) I'm trying to get my Smart Status contrib to work, but, in checkout_confirmation.php, $order is no longer an object when it reaches my payment module. Yet, in checkout_payment.php, it is an object. :( I basically need to be able to test $order->info['shipping_method'] or figure out another way of testing whether this order needs to ship. Here's the payment module code: ?class authorizenetaim { ? ?var $code, $title, $description, $enabled; // class constructor ? ?function authorizenetaim() { ? ? ? ? global $order; ? ? ? ? ? ? ? // TESTING IF OBJECT - RETURNS NO IN CHK_PROC ? ? if (is_object($order)) { ? ? ? ? ?echo "YEP - it's an object!"; ? ? } else { ? ? ?echo "NOPE"; ? ? } ?$this->code = 'authorizenetaim'; ?$this->title = MODULE_PAYMENT_AUTHORIZENETAIM_TEXT_TITLE; ?$this->description = MODULE_PAYMENT_AUTHORIZENETAIM_TEXT_DESCRIPTION; ?$this->enabled = ((MODULE_PAYMENT_AUTHORIZENETAIM_STATUS == 'True') ? true : false); ?$this->error = ''; ? ?if ((int)MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID > 0) { ? ? if ($order->info['shipping_method'] != '') { ? ?// SHIP ITEM - MARK UNFULFILLED ? ? ?$this->order_status = MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID; ? } else { ? ?// DOWNLOAD ONLY ITEM - MARK e-FULFILLED ? ? ?$this->order_status = (MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID + 3); ? } ? ? ? } ? ? ? if (is_object($order)) $this->update_status(); ?// Change made by using ADC Direct Connection ?$this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false); ? ?} TIA for any help or pointers you can provide. :) - jeff Edited July 22, 2005 by swissarmyknife Quote Link to comment Share on other sites More sharing options...
Guest Posted July 23, 2005 Share Posted July 23, 2005 I basically need to be able to test $order->info['shipping_method'] or figure out another way of testing whether this order needs to ship. <{POST_SNAPBACK}> It is tested in checkout_shipping.php with this: if ($order->content_type == 'virtual') { if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); $shipping = false; $sendto = false; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } HTH Matti Quote Link to comment Share on other sites More sharing options...
swissarmyknife Posted July 23, 2005 Author Share Posted July 23, 2005 It is tested in checkout_shipping.php with this: ?if ($order->content_type == 'virtual') { ? ?if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); ? ?$shipping = false; ? ?$sendto = false; ? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); ?} HTH Matti <{POST_SNAPBACK}> Thanks, Matti. I'll try to work with that. The reason I'm testing for that is to determine (in the payment modules) which status to write to the db. For instance, for our download orders, I want the status to show fulfilled, but for items needing to be shipped, it should show unfulfilled. And the only place I see that the status is being written is in the payment modules. Yet, I can't retrieve the shipping info there because the $order object is dead once that function is called. Maybe I'm making this way too hard. Any suggestions? Thanks again for your help! - jeff Quote Link to comment Share on other sites More sharing options...
Guest Posted July 23, 2005 Share Posted July 23, 2005 are you using the downloads contrller contribution? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.