Jump to content

Trying to display parent categorie.. Illegal String Offset error


TomvV

Recommended Posts

Hello all,

 

First of all if anyone can help.. you already made my day! I've been trying to figure out what goes wrong for a while but I have no idea. I am in the process of starting a website and I've been using osclass, a free php script, for making a website displaying classifieds. My website is here: marketplacesxm.com . Now as you can see on the website, it displays the latest listings. However, if was showing from which 'sub'category those listings were instead of the parent category. I asked one of the guys there ad he gave me a script to put in there to display the parent categories.. It seems to be working now, except I also get an error displayed on my website as you can see.

 

Does anyone have any ideas on how to fix this? I added some attachments so you can see what I've been doing.

 

Thanks!

 

 

post-203313-0-58601100-1485056538_thumb.jpg

post-203313-0-28600300-1485056542_thumb.jpg

Link to comment
Share on other sites

Hi mate,

 

Not being rude but nobody will go to your site to look for the issue. Not that they just don't want to. Lots of people are nervous of possible infections.

Your best bet is to post your code here and also the error you are getting so people who are experienced with the script you are using can help.

Link to comment
Share on other sites

Ok,
 
This is happening. I entered this code:

<?php
$_category = osc_item_category();
if(isset($_category['fk_i_parent_id']) && !is_null($_category['fk_i_parent_id'])) {
$_category = Category::newInstance()->findRootCategory(osc_item_category_id());
}
echo $_category['s_name'];
?>

And I'm now getting this error displayed on my website:

 

Warning: Illegal String Offset

 

 

 

Anyone?

 

Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.