Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

No products showing up on category pages. #84

Closed barrydeveire closed 10 years ago

barrydeveire commented 10 years ago

Hi thanks Vinai for your work it's greatly appreciated, I'm using Magento version:1.7.0.2 and groups Catalog 2 version: 0.3.4, I seem to be having the issue with no products showing on each category page even with a static block created to show products in sub category pages, I am in developer mode with php errors set to display. My cache is disabled and also the compiler has been disabled since before I installed the extension. I don't see any error messages in the category pages, just a blank page with no products.

Header and footer are present and the categories show in the left side bar.

Any help is greatly appreciated as I am unsure where an how to fix this.

Thanks

Vinai commented 10 years ago

Are you able to manually run the indexer for the GroupsCatalog indexes? If you get some nondescriptive message, please check the exception log for details, and post them here, too.

barrydeveire commented 10 years ago

Yes I was able to re-index groups catalog categories and products with no error in exception.log or in magento admin.

Vinai commented 10 years ago

Please post the result from the query

SELECT * FROM core_config_data WHERE path LIKE 'netzarbeiter_groupscatalog2/%';
barrydeveire commented 10 years ago
|704|default|0|netzarbeiter_groupscatalog2/general/is_active|1
|705|default|0|netzarbeiter_groupscatalog2/general/product_mode|show
|706|default|0|netzarbeiter_groupscatalog2/general/product_default_hide|-1
|707|default|0|netzarbeiter_groupscatalog2/general/category_mode|show
|708|default|0|netzarbeiter_groupscatalog2/general/category_default_hide|-1
|709|default|0|netzarbeiter_groupscatalog2/general/entity_hidden_behaviour_guest|302-parent
|710|default|0|netzarbeiter_groupscatalog2/general/entity_hidden_behaviour_customer|404
|711|default|0|netzarbeiter_groupscatalog2/general/display_entity_hidden_msg|0
|712|default|0|netzarbeiter_groupscatalog2/general/auto_refresh_block_cache|1
|713|default|0|netzarbeiter_groupscatalog2/general/show_multiselect_field|1
== Table structure for table core_config_data

|------
|Column|Type|Null|Default
|------
|//**config_id**//|int(10)|No|
|**scope**|varchar(8)|No|default
|**scope_id**|int(11)|No|0
|**path**|varchar(255)|No|general
|value|text|Yes|NULL
Vinai commented 10 years ago

Please also add the results of the following two queries if they contain less them 10 results. Product Specific Settings:

SELECT ev.entity_id AS product_id, ev.store_id, ev.value
    FROM catalog_product_entity_text ev 
    INNER JOIN eav_attribute ea 
        ON ea.attribute_id = ev.attribute_id 
        AND ea.entity_type_id = ea.entity_type_id 
        AND ea.attribute_code = 'groupscatalog2_groups';

and Category Specific Settings:

SELECT ev.entity_id AS category_id, ev.store_id, ev.value 
    FROM catalog_category_entity_text ev 
    INNER JOIN eav_attribute ea
        ON ea.attribute_id = ev.attribute_id
        AND ea.entity_type_id = ea.entity_type_id
        AND ea.attribute_code = 'groupscatalog2_groups';
barrydeveire commented 10 years ago

Hi, First Query: Table structure for table catalog_product_entity_text

|------
|Column|Type|Null|Default
|------
|//**value_id**//|int(11)|No|
|entity_type_id|int(10)|No|0
|**attribute_id**|smallint(5)|No|0
|**store_id**|smallint(5)|No|0
|**entity_id**|int(10)|No|0
|value|text|Yes|NULL
== Dumping data for table catalog_product_entity_text

|1154|0|0,1,2,3
|1136|0|4
|931|0|-1
|1067|0|-2
|1153|0|-2
|1152|0|-2
|1133|0|-2
|1132|0|-2
|1130|0|-2
|943|0|-2
|932|0|-2
|1129|0|-2
|1096|0|-2
|1103|0|0,1
|1088|0|0,1,2,3
|1069|0|0,1
|1124|0|-2
|1110|0|-2
|1078|0|-2
|933|0|-2
|940|0|-2
|1068|0|-2
|1127|0|-2
|929|0|-2
|1155|0|-2
== Table structure for table catalog_product_entity_text

|------
|Column|Type|Null|Default
|------
|//**value_id**//|int(11)|No|
|entity_type_id|int(10)|No|0
|**attribute_id**|smallint(5)|No|0
|**store_id**|smallint(5)|No|0
|**entity_id**|int(10)|No|0
|value|text|Yes|NULL

Second query:  Table structure for table catalog_category_entity_text

|------
|Column|Type|Null|Default
|------
|//**value_id**//|int(11)|No|
|**entity_type_id**|smallint(5)|No|0
|**attribute_id**|smallint(5)|No|0
|**store_id**|smallint(5)|No|0
|**entity_id**|int(10)|No|0
|value|text|Yes|NULL
== Dumping data for table catalog_category_entity_text

|30|0|0,1,2,3
|31|0|0,1,2,3
|10|0|-2
|18|0|-2
|19|0|-2
|20|0|-2
|21|0|-2
|11|0|-1
|13|0|-2
|12|0|-2
|9|0|-1
|36|0|-1
|53|0|-1
|52|0|-1
|42|0|-2
|39|0|-2
|38|0|-2
|40|0|-2
|41|0|-2
|43|0|-2
|44|0|-2
|47|0|-2
|45|0|-2
|46|0|-2
|48|0|-2
|49|0|-2
|50|0|-1
|51|0|-1
|28|0|-2
|26|0|-2
|25|0|-2
|55|0|-1
|29|0|-1
|5|0|-1
== Table structure for table catalog_category_entity_text

|------
|Column|Type|Null|Default
|------
|//**value_id**//|int(11)|No|
|**entity_type_id**|smallint(5)|No|0
|**attribute_id**|smallint(5)|No|0
|**store_id**|smallint(5)|No|0
|**entity_id**|int(10)|No|0
|value|text|Yes|NULL
Vinai commented 10 years ago

In order to debug further, please post

Thanks.

Vinai commented 10 years ago

Great, no rewrite conflict. Also, two more queries to check if the indexes are created correctly please:

SELECT store_id, group_id AS groups, COUNT(catalog_entity_id) AS categories 
    FROM groupscatalog_category_idx GROUP BY store_id, group_id;

SELECT store_id, group_id AS groups, COUNT(catalog_entity_id) AS products 
    FROM groupscatalog_product_idx GROUP BY store_id, group_id;

Thanks.

barrydeveire commented 10 years ago

Hi Vinai, Again thanks for your time in helping me to resolve this. One category not showing up has an ID:11, As for the store ID there are only two stores(Admin, Default Store View) with store_id of 1 for default store view.

result query 1:  Table structure for table groupscatalog_category_idx
|------
|Column|Type|Null|Default
|------
|//**catalog_entity_id**//|int(10)|No|
|//**group_id**//|smallint(5)|No|
|//**store_id**//|smallint(5)|No|0
== Dumping data for table groupscatalog_category_idx

|1|0|47
|1|1|47
|1|4|49

Query 2:  Table structure for table groupscatalog_product_idx

|------
|Column|Type|Null|Default
|------
|//**catalog_entity_id**//|int(10)|No|
|//**group_id**//|smallint(5)|No|
|//**store_id**//|smallint(5)|No|0
== Dumping data for table groupscatalog_product_idx

|1|0|27
|1|1|27
|1|4|30

Thanks.

Vinai commented 10 years ago

That looks good. Which customer group ID is your session associated with when you access the category? Is it LOGGED OUT (ID 0)? Or is it ID 1 or 4 or maybe even something else?

barrydeveire commented 10 years ago

Hi,

Yes when logged out(0) the landing page is missing also when in user group 1 and 4.

Vinai commented 10 years ago

It seems that the extension is functioning okay - index up to date etc. Lets have a look at how you set up the categories. Can you please attach a screenshot of the backend page view of one of the categories in question? Or simply note down all the attribute options that can be set there?

Vinai commented 10 years ago

Yes, thank you, that is exactly what I needed to see. All looks fine there. Its starting to look like some other extension interfering with the collection loading. Lets narrow things down to the specific category 11, and get a count of products to display in that category (by store and group):

SELECT gpi.store_id, gpi.group_id, COUNT(*) AS products_visible 
    FROM groupscatalog_product_idx gpi
    INNER JOIN catalog_category_product ccp
        ON ccp.product_id = gpi.catalog_entity_id
        AND ccp.category_id = 11
    GROUP BY gpi.store_id, gpi.group_id;

Also, please let me know if you have the flat catalog product or flat catalog category tables feature enabled or not.

barrydeveire commented 10 years ago

Hi Vinai, Yes this is starting to look like its not a result of groups catalog, but thanks for your continued help.

Flat catalog product and flat catalog category tables feature is turned off for both.

Query Result: Table structure for table groupscatalog_product_idx

------ Column Type Null Default
//catalog_entity_id// int(10) No
//group_id// smallint(5) No
//store_id// smallint(5) No 0

== Dumping data for table groupscatalog_product_idx

|1|0|6 |1|1|6 |1|4|5 == Table structure for table groupscatalog_product_idx

------ Column Type Null Default
//catalog_entity_id// int(10) No
//group_id// smallint(5) No
//store_id// smallint(5) No 0

Thanks Barry

Vinai commented 10 years ago

According to these results, only in store ID 1 products are visible.

No products will be displayed on other store views. It seems the index is fine. Any idea what other extension or customization might be causing this?

barrydeveire commented 10 years ago

Thanks for the quick response, Yes store_id 1 is the default store view which looks correct, The thing is i didnt notice the missing category landing page until after a lot of work was done on the site so i'm not sure where to look, also the developer which implemented it is no longer with the company. Maybe the problem is in a layout file somewhere, I have a backup to compare files.

Thanks Vinai for your help I really appreciate your time, i will close this issue respectfully.

Vinai commented 10 years ago

Good Luck with your site then!

barrydeveire commented 10 years ago

Thank you and good luck in the future to you.