Jump to content



Photo
- - - - -

Fatal Error on some Pages


This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1   Mort-lemur

Mort-lemur
  • Members
  • 1,960 posts

Posted 09 July 2012 - 17:37

Hi,

I have started getting an error on some product pages in my development 2.3.1 site, but only on pages where the x-sell module is called up. The error is as follows:

Fatal error: Cannot use string offset as an array in /home/username/public_html/catalog/includes/functions/general.php on line 338

The offending line of code is:
if (!isset($tax_rates[$class_id][$country_id][$zone_id]['rate'])) {

Any ideas what is going on? I have googled the problem without much success.

Thanks

Now running on a fully modded 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#2   Mort-lemur

Mort-lemur
  • Members
  • 1,960 posts

Posted 09 July 2012 - 17:42

Update - this error only occurs when I try to cross sell to an item that is zero Vat rated.

Now running on a fully modded 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#3   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 09 July 2012 - 17:54

Is your X-sell Addon designed for osC 2.2x? There is a difference in the way taxes are handled between 2.2 and 2.3 -- the 2.3 version expects an array, but the 2.2 version is a string. You'll have to find the value that Xsell is passing to that function in catalog/includes/functions/general.php and correct it.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#4   altoid

altoid
  • Community Sponsor
  • 1,021 posts

Posted 09 July 2012 - 19:10

Is your X-sell Addon designed for osC 2.2x? There is a difference in the way taxes are handled between 2.2 and 2.3 -- the 2.3 version expects an array, but the 2.2 version is a string. You'll have to find the value that Xsell is passing to that function in catalog/includes/functions/general.php and correct it.

Regards
Jim


I posted an issue with what looks like an XSELL array problem here yesterday, not sure if that's related or not to this issue. As noted in that post, it only occurrs when I toggle the shop from 5.2* PHP to 5.3.
I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#5   Mort-lemur

Mort-lemur
  • Members
  • 1,960 posts

Posted 09 July 2012 - 20:53

Is your X-sell Addon designed for osC 2.2x? There is a difference in the way taxes are handled between 2.2 and 2.3 -- the 2.3 version expects an array, but the 2.2 version is a string. You'll have to find the value that Xsell is passing to that function in catalog/includes/functions/general.php and correct it.

Regards
Jim


Hi Jim,

No its a "Quick and Dirty" hack of the 2.2 version...

Now running on a fully modded 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#6   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 09 July 2012 - 21:34

Then you need to find where it's getting that string and convert it to the array that osCommerce 2.3.1 expects. Find where it's calling tep_get_tax_rate() and follow the code.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#7   Mort-lemur

Mort-lemur
  • Members
  • 1,960 posts

Posted 10 July 2012 - 21:09

@kymation

I think that this may be the offending line of code in includes/xsell.php

    $xsell_price =  $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id']));

But why would that work ok for an item that has tax applied, but not for an item with no tax applied?

Thanks

Now running on a fully modded 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#8   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,208 posts

Posted 10 July 2012 - 23:01

I have that exact line in my code. Then again, I don't have any items anywhere that are not taxable, so that may be the issue. Sorry, I don't have any more suggestions on this one.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#9   altoid

altoid
  • Community Sponsor
  • 1,021 posts

Posted 12 July 2012 - 17:12

Heather, this may be off the mark totally, but in your original post I see the message was related to an array situation. Coincidentally or not, my problem related to an array issue (which only shows with version 5.3 php) has a solution syntax of code where an array was called. Again, this may not be even close to the solution for your issue,but if want to check it out PM me.
I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.