Author Topic: [Solved] Order status defaulting to confirmed  (Read 3144 times)

Mike B.

  • Beginner
  • *
  • Posts: 10
[Solved] Order status defaulting to confirmed
« on: August 14, 2008, 23:04:48 pm »
Does anyone know how to change the default order status to 'pending'?

Everything was working fine on my version 1.1.1 site until I upgraded to 1.1.2 last week.  Since then it seems all my orders are defaulting to 'confirmed' status -- this is not good!

I use virtuemart to track inventory on an Intranet site -- All products have zero cost and all orders are 'charged' to COD and use the standard shipping module. 

I swear I remember a setting for default order status, but I can't find it anywhere.

Any help is greatly appreciated.

Thanks,

Mike

Mike B.

  • Beginner
  • *
  • Posts: 10
Re: Order status defaulting to confirmed
« Reply #1 on: August 26, 2008, 23:10:17 pm »
I've fixed my problem.  Since I'm using VM for inventory tracking only, all my products are "free" -- actually have zero in the price, not blank.

The updated code in /administrator/components/com_virtuemart/classes/ps_checkout.php (in version 1.1.2) changed the order status to Confirmed when the price is zero.  I replaced this code with code from version 1.1.0

If anybody's interested I can detail the fix.

-- Mike

leonie

  • Beginner
  • *
  • Posts: 7
Re: [Solved] Order status defaulting to confirmed
« Reply #2 on: September 05, 2008, 06:07:33 am »
Hi Mike,

Can you please detail the fix as i have this problem - although none of our products are priced at zero!

Many thanks

Leonie

christopher.is.me

  • Beginner
  • *
  • Posts: 2
Re: [Solved] Order status defaulting to confirmed
« Reply #3 on: September 06, 2008, 06:22:22 am »
Yes mike, can you please detail the fix for us.

Mike B.

  • Beginner
  • *
  • Posts: 10
Re: [Solved] Order status defaulting to confirmed
« Reply #4 on: September 08, 2008, 17:59:00 pm »
Here's what I did -- at line 1176 of ps_checkout.php I replaced this code:
      // Only completed payments return true!
      $update_order = false;
      if( $enable_processor == "Y" ) {
         if( defined($_PAYMENT->payment_code.'_VERIFIED_STATUS')) {
                 $d['order_status'] = constant($_PAYMENT->payment_code.'_VERIFIED_STATUS');
                 $update_order = true;
            }
        } elseif( $order_total == 0.00 ) {
           // If the Order Total is zero, we can confirm the order to automatically enable the download
           $d['order_status'] = ENABLE_DOWNLOAD_STATUS;
           $update_order = true;
        }
      if ( $update_order ) {
         require_once(CLASSPATH."ps_order.php");
         $ps_order =& new ps_order();
         $ps_order->order_status_update($d);
      }
      

with this code from the earlier file:

      // Only completed payments return true!

      if( $enable_processor == "Y" ) {
         if( defined($_PAYMENT->payment_code.'_VERIFIED_STATUS')) {
                 $d['order_status'] = constant($_PAYMENT->payment_code.'_VERIFIED_STATUS');
                 $update_order = true;
            }
            else {
               $update_order = false;
            }
         if ( $update_order ) {
            require_once(CLASSPATH."ps_order.php");
            $ps_order =& new ps_order();
            $ps_order->order_status_update($d);
         }
      }
      
Anyway, this worked perfectly for me -- I hope it helps you to.

Good Luck!

Mike

Mamoune

  • Beginner
  • *
  • Posts: 1
Re: [Solved] Order status defaulting to confirmed
« Reply #5 on: February 21, 2010, 13:36:15 pm »
I also need to comment out the following part :
        } elseif( $order_total == 0.00 ) {
           // If the Order Total is zero, we can confirm the order to automatically enable the download
           $d['order_status'] = ENABLE_DOWNLOAD_STATUS;
           $update_order = true;


But, it would be better to add a test that if all the products are downloadable and if the order total is zero then the order could be updated, else no !