Jump to content

Recommended Posts

Hello...

I have an issue that when pressing on the category it show there is no product's.. and it's not shown the subcategories also

I don't have any products under the main categories!! There is just subcategories and under it there is the product's.

How I can show the subcategories when press on the category?

Thank you in advance

Joe

 

Share this post


Link to post
Share on other sites

admin > Modules > Content > Sub Category List

If it doesn't show, you may have to install it. 


Always back up before making changes.

Share this post


Link to post
Share on other sites

also - check you don't have a product in there with status 0 - the  categories won't show then either


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
7 hours ago, ecartz said:

admin > Modules > Content > Sub Category List

If it doesn't show, you may have to install it. 

thank you @ecartz , but it's installed,,, 
and here is the error on log file
 

PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /home/shop545/public_html/includes/modules/content/index_nested/cm_in_category_listing.php:41
Stack trace:
#0 /home/shop545/public_html/includes/classes/osc_template.php(146): cm_in_category_listing->execute()
#1 /home/shop545/public_html/index.php(54): oscTemplate->getContent('index_nested')
#2 {main}
  thrown in /home/shop545/public_html/includes/modules/content/index_nested/cm_in_category_listing.php on line 41

 and the line 41 is
 

      $category_name  = $OSCOM_category->getData($current_category_id, 'name');

 

Edited by joe122joe

Share this post


Link to post
Share on other sites
30 minutes ago, BrockleyJohn said:

also - check you don't have a product in there with status 0 - the  categories won't show then either

Thank you @BrockleyJohn
there is some  product's in the subcategories with status 0.. but not in the main categories ..
I think when the customer press on categories  it should show the subcategories until if there is some product's in the subcategories with status 0..
 

Share this post


Link to post
Share on other sites

The error will stop things working! You may be caught midway between two sets of changes to Phoenix.

That line number makes me wonder what version you are running, but anyway the execute method should begin

    function execute() {
      global $oscTemplate, $current_category_id, $OSCOM_category;
      

If it already does, then $OSCOM_category is not being set in your store - it used to get set in the categories box.

However, in the latest version of Phoenix that code has been changed both to rename the variable and not to make it global, and this module no longer matches. In the latest version you can add before line 41

      $OSCOM_category = new category_tree();

since there is no need for it to be global as the category data is static and it should work


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
28 minutes ago, BrockleyJohn said:

The error will stop things working! You may be caught midway between two sets of changes to Phoenix.

That line number makes me wonder what version you are running, but anyway the execute method should begin


    function execute() {
      global $oscTemplate, $current_category_id, $OSCOM_category;
      

If it already does, then $OSCOM_category is not being set in your store - it used to get set in the categories box.

However, in the latest version of Phoenix that code has been changed both to rename the variable and not to make it global, and this module no longer matches. In the latest version you can add before line 41


      $OSCOM_category = new category_tree();

since there is no need for it to be global as the category data is static and it should work

the version what I have something between EDGE , Frozen and hooks system 😲😲🙄 ,

    function execute() {
      global $oscTemplate, $current_category_id, $OSCOM_category;
      

I have the same execute method ..
after adding this line

      $OSCOM_category = new category_tree();

the  subcategories still not shown but the error gone and and comes now new errors 

PHP Warning:  mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/shop545/public_html/includes/functions/database.php on line 100
PHP Warning:  session_set_save_handler(): Cannot change save handler when headers already sent in /home/shop545/public_html/includes/functions/sessions.php on line 76
PHP Warning:  session_name(): Cannot change session name when headers already sent in /home/shop545/public_html/includes/functions/sessions.php on line 164
PHP Warning:  session_save_path(): Cannot change save path when headers already sent in /home/shop545/public_html/includes/functions/sessions.php on line 191
PHP Warning:  session_set_cookie_params(): Cannot change session cookie parameters when headers already sent in /home/shop545/public_html/includes/application_top.php on line 153


 

Share this post


Link to post
Share on other sites

Hmm, I guess $current_category_id must be set or you'd be getting other errors. Are the lines following the old 41

      $category_level = $OSCOM_category->setMaximumLevel(1);
      $category_array = $OSCOM_category->buildBranchArray($current_category_id, $category_level);

?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
On 2/27/2020 at 2:12 AM, ecartz said:

admin > Modules > Content > Sub Category List

If it doesn't show, you may have to install it. 

@ecartz

I realized i have the same issue.

Using Phoenix 1.0.5.0

There is no module like this in admin > Modules > Content > Sub Category List

Any help pls


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites
29 minutes ago, Peper said:

There is no module like this in admin > Modules > Content > Sub Category List

Did you click the Install Module button and look under index_nested?  After checking that it isn't already installed of course. 


Always back up before making changes.

Share this post


Link to post
Share on other sites
21 minutes ago, ecartz said:

Did you click the Install Module button and look under index_nested?  After checking that it isn't already installed of course. 

@ecartz

Ok, i missed it, my word..:blush:

However it was enabled so i removed it and reinstalled module

There are no products in this category, only contains products in it's sub categories (9)

Still showing There are no products available in this category.


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites
Posted (edited)
13 minutes ago, Peper said:

Still showing There are no products available in this category.

This means that you are looking at a category that has products.

As both osCommerce and Phoenix stand, a category can contain subcategories OR products.  Not both.

I can see that you believe your category has only subcategories, but I ask you to check again that there are no products in the category, not even inactive products.  You can also check in phpmyadmin at the categories_to_products table to make sure there is no orphaned entries showing for the category id.

Edited by burt

Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

@burt

Strange thing i have another category also with many sub categories - showing fine
The other category shows "There are no products available in this category."
There are no products in this main category, only sub categories then with products in the subs

 


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Fixed
So after a while knowing my admin is showing no products in that category i went to check the database itself in phpmyadmin.
Check first the main category number in admin that is causing the problem, mine was 209 example
Check phpmyadmin table products_to_categories and sort categories_id
Check then if there is a product_id assigned to category_id 209

My case there was 1 product with id 2192 - maybe corrupted sometime or so, 2192 product_id was also not found in table products - so safe to delete  
Deleted that row, checked  front end and bam - working correctly

Would be absolutely nice to have a check system build into osc for products/categories for possible issues

Hope this helps someone

xample.JPG


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×