I recently wrote in about a bug in the order_express screen, I submitted
a patch, but it never seemed to make the CVS, well I've found another
problem in order_express, it is also in the actions/SET_ORDER_INFO file
.. this one occurs if you make a mistake in the billing part of the
forms, if the Shipping Address checks out OK, but there is a problem in
the billing section, it will send you to the order_billing screen, but
it doesn't record the shipping info ...

this is OK, that was what was intended, but when you fill out the
billing section correctly, you will then get to the order_confirm
screen, and there won't be any items in the invoice, and if you say
confirm the order, it will then send you back to a screen where you have
to fill out the shipping info again, and from there you will be sent to
the order_billing screen, then you will finally be able to check out ...
and all the items will show up in the invoice then.

Here is a patch to fix this behavior, it needs to be applied after the
other patch I sent in prior to this, that patch fixed the Tax and
Shipping which were incorrectly applied when going through the
express_checkout screen...

This looks like a big patch, but it actually only changes a few lines of
code, it just moves all the shipping related info above the code that
starts looking at the billing info, which is where the problem is, it
doesn't write the shipping info if the billing address has a problem,
but it will send you to the billing_info screen, which it shouldn't

patch to fix order_express:

--- SET_ORDER_INFO.original Thu Aug 31 21:28:05 2000
+++ SET_ORDER_INFO Wed Sep 13 02:40:26 2000
@@ -81,77 +81,6 @@
   }
  }

-
- if($continue)
- {
-  $billingAddress = getAddressFromEnvironment("Ecom_BillTo_");
-
-  $AddressIsGood = verifyAddress(
-   array("Name_First",
-    "Name_Last",
-    "Street1",
-    "City",
-    "StateProv",
-    "CountryCode",
-    "PostalCode",
-    "Email",
-    "Phone1"),
-   $billingAddress, &$ErrorText);
-
-  if(!$AddressIsGood)
-  {
-   //prefix ActionResults with error message
-   $ActionResults[] =  L_SETORDERINFO_INBILLING . "<BR>" . $ErrorText;
-   $continue = FALSE;
-  }
- }
-
-
- /*
- ** Check that the credit card is not expired
- */
- if($continue)
- {
-  if(($Ecom_Payment_Card_ExpDate_Year==0) OR
($Ecom_Payment_Card_ExpDate_Month==0))
-  {
-   $ActionResults[] =  L_VALIDATEORDER_WEIRD_DATES;
-   $continue = FALSE;
-   $SCREEN = "order_billing";
-  }
-  elseif((date("Y") > $Ecom_Payment_Card_ExpDate_Year) OR
-   ((date("Y") == $Ecom_Payment_Card_ExpDate_Year) AND
-    (date("m") > $Ecom_Payment_Card_ExpDate_Month))
-   )
-  {
-   $continue = FALSE;
-   $ActionResults[] =  L_VALIDATEORDER_EXPIRED;
-   $SCREEN = "order_billing";
-  }
-  else
-  {
-   $Ecom_Payment_Expiration =
-    $Ecom_Payment_Card_ExpDate_Year .
-    "-" .
-    $Ecom_Payment_Card_ExpDate_Month .
-    "-01 00:00:00";
-  }
- }
-
-
- /*
- ** Validate the credit card.
- */
- if ($continue)
- {
-  if(!($Ecom_Payment_Card_Type =
validateCard($Ecom_Payment_Card_Number)))
-  {
-   //Card didn't validate
-   $ActionResults[] = L_SETORDERINFO_INVALID;
-   $continue = FALSE;
-  }
- }
-
-
  /*
  ** Check that the user has an invoice in progress
  */
@@ -301,6 +230,96 @@
   calculateTotal($UserInfo['Invoice'], TRUE);
  }

+ if ($continue)
+ {
+  //update all SKUs
+  $Query = "UPDATE invoice_sku ";
+  $Query .= "SET Shipping = $shipping ";
+  $Query .= "WHERE Invoice = " . $UserInfo['Invoice'] . " ";
+  $DatabaseResult = mysql_query($Query, $DatabaseLink);
+  if(!$DatabaseResult)
+  {
+   print("<!--\n");
+   print("$Query \n");
+   print(mysql_errno() . ": " . mysql_error() . "\n");
+   print("-->\n");
+
+   $ActionResults[] = L_SETORDERINFO_ERROR_3;
+  }
+ }
+
+ if($continue)
+ {
+  $billingAddress = getAddressFromEnvironment("Ecom_BillTo_");
+
+  $AddressIsGood = verifyAddress(
+   array("Name_First",
+    "Name_Last",
+    "Street1",
+    "City",
+    "StateProv",
+    "CountryCode",
+    "PostalCode",
+    "Email",
+    "Phone1"),
+   $billingAddress, &$ErrorText);
+
+  if(!$AddressIsGood)
+  {
+   //prefix ActionResults with error message
+   $ActionResults[] =  L_SETORDERINFO_INBILLING . "<BR>" . $ErrorText;
+   $SCREEN = "order_billing";
+   $continue = FALSE;
+  }
+ }
+
+
+ /*
+ ** Check that the credit card is not expired
+ */
+ if($continue)
+ {
+  if(($Ecom_Payment_Card_ExpDate_Year==0) OR
($Ecom_Payment_Card_ExpDate_Month==0))
+  {
+   $ActionResults[] =  L_VALIDATEORDER_WEIRD_DATES;
+   $continue = FALSE;
+   $SCREEN = "order_billing";
+  }
+  elseif((date("Y") > $Ecom_Payment_Card_ExpDate_Year) OR
+   ((date("Y") == $Ecom_Payment_Card_ExpDate_Year) AND
+    (date("m") > $Ecom_Payment_Card_ExpDate_Month))
+   )
+  {
+   $continue = FALSE;
+   $ActionResults[] =  L_VALIDATEORDER_EXPIRED;
+   $SCREEN = "order_billing";
+  }
+  else
+  {
+   $Ecom_Payment_Expiration =
+    $Ecom_Payment_Card_ExpDate_Year .
+    "-" .
+    $Ecom_Payment_Card_ExpDate_Month .
+    "-01 00:00:00";
+  }
+ }
+
+
+ /*
+ ** Validate the credit card.
+ */
+ if ($continue)
+ {
+  if(!($Ecom_Payment_Card_Type =
validateCard($Ecom_Payment_Card_Number)))
+  {
+   //Card didn't validate
+   $ActionResults[] = L_SETORDERINFO_INVALID;
+   $SCREEN = "order_billing";
+   $continue = FALSE;
+  }
+ }
+
+

  /*
  ** Validate and set coupons
@@ -315,7 +334,7 @@
     //problems with the coupons, so try again
     $continue = FALSE;
     $ActionResults[] = "An error occurred while using your coupons!";
-    $SCREEN="order_express";
+    $SCREEN="order_billing";
    }
   }
   else
@@ -323,7 +342,7 @@
    //problems with the coupons, so try again
    $continue = FALSE;
    $ActionResults[] =  $Reason;
-   $SCREEN="order_express";
+   $SCREEN="order_billing";
   }
  }

@@ -332,23 +351,7 @@
  ** Do billing and stuff.
  */
  if ($continue)
- {
-  //update all SKUs
-  $Query = "UPDATE invoice_sku ";
-  $Query .= "SET Shipping = $shipping ";
-  $Query .= "WHERE Invoice = " . $UserInfo['Invoice'] . " ";
-  $DatabaseResult = mysql_query($Query, $DatabaseLink);
-  if(!$DatabaseResult)
-  {
-   print("<!--\n");
-   print("$Query \n");
-   print(mysql_errno() . ": " . mysql_error() . "\n");
-   print("-->\n");
-
-   $ActionResults[] = L_SETORDERINFO_ERROR_3;
-   $SCREEN = "order_info";
-  }
-
+ {
   /*
   ** Wipe out any other billing records for this invoice
   */
@@ -371,7 +374,7 @@
   {
    //could not create the billing record!
    $ActionResults[] =  L_SETORDERINFO_CREATEBILL;
-   $SCREEN = "order_express";
+   $SCREEN = "order_billing";
   }
   else
   {








------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to