PATCH for v1.4.5

6 views
Skip to first unread message

Ropu

unread,
Nov 12, 2007, 6:33:12 AM11/12/07
to Google Checkout Mod for Zen Cart Community Support Forum
Hi,, i was reported of a bug that prevents correct customer creation

The issue affected customers that have bought with GC in a ecommerce were that already had a created account. This can lead in an error when changing the state of an order from that affected merchants.

to solve this issue you must apply this patch:

googlecheckout/responsehandler.php line 197

replace:
        $db->Execute("insert into " . TABLE_CUSTOMERS_INFO . "
                                      (customers_info_id, customers_info_number_of_logons,
                                       customers_info_date_account_created)
                                 values ('" . (int) $_SESSION['customer_id'] . "', '0', now())");
        $db->Execute("insert into " . $googlepayment->table_name . " " .
                      " values ( " . $_SESSION['customer_id'] . ", " .
                      $data[$root]['buyer-id']['VALUE'] . ")");
        $new_user = true;
      }

     
      //      The user exists and is logged in
      //      Check database to see if the address exist.

with:
        $db->Execute("insert into " . TABLE_CUSTOMERS_INFO . "
                                      (customers_info_id, customers_info_number_of_logons,
                                       customers_info_date_account_created)
                                 values ('" . (int) $_SESSION['customer_id'] . "', '0', now())");
/*        $db->Execute("insert into " . $googlepayment->table_name . " " .
                      " values ( " . $_SESSION['customer_id'] . ", " .
                      $data[$root]['buyer-id']['VALUE'] . ")");*/
        $new_user = true;
      }
     
      // thx  ZachAnderson ;)
      $customer_in_gc = $db->Execute("select gct.customers_id from " .
                             $googlepayment->table_name . " gct " .
                             " where gct.buyer_id = " . makeSqlString($data[$root]['buyer-id']['VALUE']));
      if($customer_in_gc->RecordCount() == 0) {
        $db->Execute("insert into " . $googlepayment->table_name . " " .
                      " values ( " . $_SESSION['customer_id'] . ", " .
                      $data[$root]['buyer-id']['VALUE'] . ")");
      }
     
     
      //      The user exists and is logged in
      //      Check database to see if the address exist.


Unfortunately this bug cannot be reverted for old orders until those customers that had the issue do a new purchase.

This will be applied in next release

hope this helps

ropu

--
.-. --- .--. ..-
R  o  p  u

Woodymon

unread,
Dec 13, 2007, 2:21:16 AM12/13/07
to Google Checkout Mod for Zen Cart Community Support Forum
Of course this patch should also be applied to mod v.1.46

On Nov 12, 3:33 am, Ropu <rovagn...@gmail.com> wrote:
> Hi,, i was reported of a bug that prevents correct customer creation...
>
> {snipped}
>
> to solve this issue you must apply this patch:
> googlecheckout/responsehandler.php line 197
>
> {snipped}
Reply all
Reply to author
Forward
0 new messages