If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / PayPal Express Checkout support / Problem with array on ot_tax ? and other problems

Problem with array on ot_tax ? and other problems

Locked

Started by donnerkul on 2 Jan 2007, 9:34 PM · Views: 3,604

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
2 Jan 2007, 9:34 PM
#1
donnerkul avatar

donnerkul

New Zenner

Join Date:
Aug 2006
Posts:
10
Plugin Contributions:
0

Problem with array on ot_tax ? and other problems

Is use a php 5 version and array handling seems to be different to version 4. I already had to enter type conversion for the array_merge function, but now on returning from paypal express checkout I get this error:

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\htdocs\www.drehmahl.eu\shop\includes\modules\order_total\ot_tax.php on line 38

Warning: Variable passed to each() is not an array or object in C:\htdocs\www.drehmahl.eu\shop\includes\modules\order_total\ot_tax.php on line 39

The problem occures in the process-function:

 function process() {
      global $order, $currencies;

      reset($order->info['tax_groups']);
      while (list($key, $value) = each($order->info['tax_groups'])) {
        if ($value > 0 or STORE_TAX_DISPLAY_STATUS == 1) {
          $this->output[] = array('title' => $key . ':',
                                  'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
                                  'value' => $value);
        }
      }
    }

Any help is very welcome.:blink:

2 Jan 2007, 10:49 PM
#2
davelindsay avatar

davelindsay

New Zenner

Join Date:
Dec 2006
Posts:
2
Plugin Contributions:
0

Re: Problem with array on ot_tax ? and other problems

Take a look here:
http://www.zen-cart.com/forum/showthread.php?t=54728

They're discussing the issue. Seems like a clean install could help. I'm in the same boat.

3 Jan 2007, 12:11 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Problem with array on ot_tax ? and other problems

You might also grab the update I posted here:
http://www.zen-cart.com/forum/showthread.php?p=309246#post309246
and see if using it provides any relief to the problems you're reporting.

Feedback would be welcome -- with some more testing feedback, we'll be publishing a new zip with this included.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Jan 2007, 8:54 AM
#4
donnerkul avatar

donnerkul

New Zenner

Join Date:
Aug 2006
Posts:
10
Plugin Contributions:
0

Re: Problem with array on ot_tax ? and other problems

Thanks, I used the file and I did not have the error with the ot_tax.php file any longer.

BUT

as described before there is still a change in behavior of the array_merge function in php 5 (see http://be.php.net/array_merge) so I used the follwoing code in line 1515 of paypalwwp.php:

    // debug
    $this->zcLog('ec_step1 - 2 -submit', print_r(array_merge((array)$return_url, (array)$cancel_url, (array)$options), true));

as otherwise I got an error that item #1 and #2 are no arrays.

By the way. There is no error message any longer, but express checkout still does not work. I think it is because I do have a German and a Belgium paypal account, but no North American one. Any time I return form Paypal I enter the order process in step 1 (or get to split login if not logged in) and on step 2 (payment) I have to enter a payment option of my other two paments (paypal ipn and eurotransfer), but no express checkout....

But, thanks anyway.

Best regards
Dieter Brandenburger

3 Jan 2007, 9:53 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Problem with array on ot_tax ? and other problems

Dieter,
Thanks for the feedback on the array_merge() issue vs PHP 5. It's been corrected for the next release.

As to your other problem ... when you return from PayPal and are sent back to a login page, can you please look at your PayPal debug logs and post the data to/from PayPal for the "GetExpressCheckoutDetails" transaction? (this initiates upon return from PayPal, and plays a part in determining what page you get sent to).

You can turn on debug logging in the module's settings in Zen Cart admin.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Jan 2007, 10:33 AM
#6
donnerkul avatar

donnerkul

New Zenner

Join Date:
Aug 2006
Posts:
10
Plugin Contributions:
0

Re: Problem with array on ot_tax ? and other problems

Hi,

thanks for your help. I turned debug on and as I aspected, it is only a regional problem. Here is the text:

Message: We are sorry for the inconvenience; however, at the present time we
are unable to use PayPal to process orders from the geographic region you
selected as your PayPal address. Please continue using normal checkout and
select from the available payment methods to complete your order.

If you still need more, let me know.

Dieter

3 Jan 2007, 10:36 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Problem with array on ot_tax ? and other problems

That message appears if you have configured your PayPal module to be restricted to a certain zone, but the address you selected for shipping while on the PayPal site doesn't fit within the zone restrictions you've imposed within Zen Cart.

Try editing your PayPal Express Checkout module in Zen Cart Admin and change:
Payment Zone
to:
--none--

Then try another express checkout transaction.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.