Forums / Templates, Stylesheets, Page Layout / Products do not show in Category

Products do not show in Category

Views: 678

Results 1 to 10 of 10
7 Sep 2011, 8:36 PM
#1
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Products do not show in Category

I have v1.3.9h and barebones template

I have placed many items in several categories and they all show in "New Products..." and "All Products..." but they do not show in the categories.
When I click a category in the menu, it goes to the correct path but nothing is there. :no:

I know it must be a setting that needs to be changed and I have looked everywhere but cannot find something that looks like it is the correct thing to change.

I could not find something similar in Tutorials or other threads.

Does any one know how to fix this problem please?

Thank you
Ivanna

7 Sep 2011, 8:54 PM
#2
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

I think it is something I have done wrong with category set up. When I look at sub-categories pages, the footer is missing also.

8 Sep 2011, 7:46 PM
#4
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

Thank you Steve,

Wow, I did not know about these error logs. I have 186 logs with the same message. :blink:

[07-Sep-2011 11:03:06] PHP Parse error: syntax error, unexpected $end in /catalog/includes/templates/barebones/templates/tpl_index_product_list.php on line 212 line 212 is empty. line 211 has the final </div>

I found very many errors from yesterday. Yesterday I only look at Categories/Products, so the error is generated when the page is viewed perhaps.

I found two other errors also but only for one time so I think perhaps that error is gone??? :unsure:

My questions:

  1. How can I find what $end is? All <div> are ended with </div> and <?php ended with ?> so it is not that. is it because of the extra line (line 212)
  2. If an error only shows one time, is that error now gone or will it perhaps return?
  3. Can I have error go to email when they generate?

thank you
Ivanna

8 Sep 2011, 8:17 PM
#5
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

I can find only one reference to $end in Developers Toolkit

/catalog/includes/modules/shipping/usps.php
Line #510 : $end = strpos($body, '</Package>');

but I do not have USPS shipping module installed so it cannot be this either. :no:

8 Sep 2011, 8:43 PM
#6
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

I think I have made a BIG mistake. :frusty:

For the line 212, it has nothing on it, but there is an error for this line, so I decide to remove the last blank line - line 212

When I look at the website, I do not see a difference
Now I go to My Debug logs and find two new errors

text/x-sql zc_d6616cb5f4c2cb55d422ea67feb723b0.sql
ISO-8859 text, with very long lines, with CRLF line terminators

and

text/x-sql zc_e830bfcec88106453506f54ff42fc580.sql
ASCII text, with very long lines, with no line terminators

Both files have a lot of other stuff in there also.

I think I can reload this file from backup but first I need help and advice please.

thank you
Ivanna

9 Sep 2011, 11:00 AM
#7
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Products do not show in Category

Replace the file with a fresh copy from the template_default/templates folder. If that fixes things, it's likely you added a line or character to the end of the file when you edited it. That often happens when you edit a PHP file with something other than a text editor.

9 Sep 2011, 2:40 PM
#8
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

I have changed the file but it does not make a difference to the first problem (items do not show in categories, only All Products and New products, Footer does not show in sub-categories)

Tutorials state I must work from oldest error first. The oldest error is :-
PHP Parse error: syntax error, unexpected $end in /catalog/includes/templates/barebones/templates/tpl_index_product_list.php on line 212 line

nearly all errors are this.

Line 212 has nothing on it (that is why I remove it). It did not make a change. Those new files I found, are always there - I just did not see them. They are a copy of sql configuration in the database)

I have replaced /catalog/includes/templates/barebones/templates/tpl_index_product_list.php with the file from /catalog/includes/templates/template_default/templates but there is no change.

So now I am back to the beginning again.

What I do not understand is "unexpected $end" There is no reference to it in either file.

From Developers Toolkit I find $end is a variable assigned in the USPS module. So why does it come into this page?? My PHP is very limited but cannot find anything on this page that calls this variable so I have one more thought.

Which file calls tpl_index_product_list.php ??? Does that file also try to pull $end ???

Now I am clutching at straw. I am really lost.

Also, I use Crimson Editor for my text editor. It was recommended on this forum. I do not use anything else. Is Crimson Editor ok for me to use?

Thank you
Ivanna

9 Sep 2011, 2:57 PM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Products do not show in Category

The 'unexpected end' is part of the error message. You won't find it in any file.

Try downloading a new copy of the Zencart zip file, unzip it, and get a copy of that file from there.

9 Sep 2011, 6:45 PM
#10
ivanna avatar

ivanna

Zen Follower

Join Date:
Jan 2011
Location:
Texas, USA
Posts:
171
Plugin Contributions:
0

Re: Products do not show in Category

Steve, I have found the problem. I downloaded Zen Cart once again and took my file from there and now it works. :clap: :clap:

The error is line 34 not line 212. The bad line is :-

<div id="indexProductListCatDescription" class="content"></div>

The good line is :-

<div id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></div>

There is nothing on this page that is necessary to edit so I do not know why it is bad. :no:

Now I can check through the other errors. I think there are only two that are not the same.

So now I have learned a lot of things about logs and errors and also, most important, not to trust backup files - perhaps they are corrupt also !!! :smartalec:

I have other questions about error logs but I think it correct to open a new thread for them.

Thank you for your help to resolve this problem
Ivanna.