Mort-lemur Posted July 9, 2012 Share Posted July 9, 2012 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, Mobile Friendly 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. Link to comment Share on other sites More sharing options...
Mort-lemur Posted July 9, 2012 Author Share Posted July 9, 2012 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, Mobile Friendly 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. Link to comment Share on other sites More sharing options...
♥kymation Posted July 9, 2012 Share Posted July 9, 2012 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 See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥altoid Posted July 9, 2012 Share Posted July 9, 2012 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. Link to comment Share on other sites More sharing options...
Mort-lemur Posted July 9, 2012 Author Share Posted July 9, 2012 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, Mobile Friendly 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. Link to comment Share on other sites More sharing options...
♥kymation Posted July 9, 2012 Share Posted July 9, 2012 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 See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Mort-lemur Posted July 10, 2012 Author Share Posted July 10, 2012 @@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, Mobile Friendly 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. Link to comment Share on other sites More sharing options...
♥kymation Posted July 10, 2012 Share Posted July 10, 2012 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 See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥altoid Posted July 12, 2012 Share Posted July 12, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.