Jump to content



Latest News: (loading..)

- - - - -

Fatal Error on some Pages


  • Please log in to reply
8 replies to this topic

#1   Mort-lemur

Mort-lemur
  • Members
  • 1,195 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 09 July 2012 - 05:37 PM

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 my store is the way I want it - Secure, working well, and good Google Ranks - Thanks to all for the help given.

If you want to see the mods I have installed, then see my profile.

#2   Mort-lemur

Mort-lemur
  • Members
  • 1,195 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 09 July 2012 - 05:42 PM

Update - this error only occurs when I try to cross sell to an item that is zero Vat rated.
Now my store is the way I want it - Secure, working well, and good Google Ranks - Thanks to all for the help given.

If you want to see the mods I have installed, then see my profile.

#3   kymation

kymation

    Believers

  • Community Sponsor
  • 6,688 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 09 July 2012 - 05:54 PM

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 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#4 ONLINE   altoid

altoid
  • Community Sponsor
  • 738 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 09 July 2012 - 07:10 PM

View Postkymation, on 09 July 2012 - 05:54 PM, said:

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,195 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 09 July 2012 - 08:53 PM

View Postkymation, on 09 July 2012 - 05:54 PM, said:

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 my store is the way I want it - Secure, working well, and good Google Ranks - Thanks to all for the help given.

If you want to see the mods I have installed, then see my profile.

#6   kymation

kymation

    Believers

  • Community Sponsor
  • 6,688 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 09 July 2012 - 09:34 PM

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 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#7   Mort-lemur

Mort-lemur
  • Members
  • 1,195 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 10 July 2012 - 09:09 PM

@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 my store is the way I want it - Secure, working well, and good Google Ranks - Thanks to all for the help given.

If you want to see the mods I have installed, then see my profile.

#8   kymation

kymation

    Believers

  • Community Sponsor
  • 6,688 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 10 July 2012 - 11:01 PM

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 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#9 ONLINE   altoid

altoid
  • Community Sponsor
  • 738 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 12 July 2012 - 05:12 PM

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.