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 59 forks source link

Issues with price filter #37

Open stevejones20 opened 11 years ago

stevejones20 commented 11 years ago

Hi,

I've installed the plugin and it works perfectly apart from one thing:

On a category listing page where you can filter by price, it seems to include all products in the menu not the ones displayed to the current user.

example: I have a product that costs £4000 which is available to a logged in group. All other publicly available products are less than £1000. If I go to the site and don't log in, the filter by price nav displays:

£0.00 - £999.99 (132) £4,000.00 And Above (1)

Clicking on the £4000.00 And Above link goes to a page saying no products in category. Which is correct as they're only available to a logged in user.

Is there a way to get the nav to only show the products available to the current user?

Thanks Steve Jones

Vinai commented 11 years ago

Thanks for your report. My problem is I can't reproduce the issue. Here are the steps I took to try to reproduce:

  1. Create a category with layered navigation turned on
  2. Create a product A with price 10, hide from none
  3. Create a product B with price 20, hide from none
  4. Create a product C with price 1000, hide from none
  5. Load category page on frontend, check price filter range includes 1000
  6. Hide product C from group NOT LOGGED IN
  7. Reload category page on frontend, check price filter range now only includes 10 - 20
  8. Turn off flat catalog product index in system config
  9. Reload category page on frontend, check price filter range still excludes product C

I don't know how else I might reproduce your issue. Please provide the exact Magento and extension versions, along with exact steps how to reproduce the issue please.

stevejones20 commented 11 years ago

Hi,

Thanks for the reply. Here's some more details: Magento Version: 1.7.0.1 GroupsCatalog2 version: 0.2.2

You can see the issue here: http://phyto5.co.uk/our-range.html

In the left nav it displays: Price £0.00 - £999.99 (132) £3,000.00 - £3,999.99 (1) £4,000.00 And Above (1)

The products in the top 2 sections (£3,000.00 - £3,999.99 (1) and £4,000.00 And Above (1)) are hidden from everything except a group called Trade. If you click on one of these, they show no products which is correct.

When logged in as a Trade user the products are displayed correctly.

This is how everything is set up: Our Range: Category Hide from groups: Use Default Layered nav turned on

The 2 products that are above £3000: Hide from groups: NOT LOGGED IN, General, Wholesale, Retailer

Any further help would be appreciated,

Thanks Steve

Vinai commented 11 years ago

Can you please upgrade to the latest version of the extension, that is 0.2.5? The version you are using, 0.2.2, is pretty old, and chances are the issue is already fixed. You can install 0.2.5 either from github or from Magento Connect.

Please let me know if that solves the issue for you. Thanks.

stevejones20 commented 11 years ago

Hi, still doesn't seem to work for me...

I've updated the plugin to 0.2.5.

See the screenshot below for the settings in the plugin:

screenshot1

For the products i have these selected: screenshot2

Thanks for the help. Steve

Vinai commented 11 years ago

Thanks for the additional info. Here some more questions:

The best way (for me) to generate that list is if you copy the following PHP sniplet into a file in the Magento root directory and call it in a browser.

<?php
umask(0);
require_once 'app/Mage.php';

Mage::app();
Mage::setIsDeveloperMode(true);

Mage::app()->setCurrentStore('default');

header('content-type: text/plain');

// List active modules
echo "############ Active Modules #############" . PHP_EOL;
$modules = Mage::getConfig()->getNode()->xpath('modules/*[active="true"]');
foreach ($modules as $module) {
    printf("%s (%s)", $module->getName(), $module->version);
    echo PHP_EOL;
}
echo PHP_EOL.PHP_EOL;

// List class rewrites
foreach (array('models', 'blocks', 'helpers') as $type) {
    echo "############ " . ucwords($type) . " Rewrites #############" . PHP_EOL;
    $rewrites = Mage::getConfig()->getNode()->xpath('//global/' . $type . '/*[rewrite]');
    foreach ($rewrites as $rewrite) {
        $classGroup = $rewrite->getName();
        foreach ($rewrite->xpath('rewrite/*') as $suffix) {
            printf("%s/%s -> %s", $classGroup, $suffix->getName(), $suffix);
            echo PHP_EOL;
        }
    }
    echo PHP_EOL;
}
stevejones20 commented 11 years ago

Hi,

I'm not using any special proxy or caching extensions. You can view the output from your code here:

############ Active Modules #############
Mage_Core (1.6.0.2)
Mage_Eav (1.6.0.0)
Mage_Page (1.6.0.0)
Mage_Install (0.7.0)
Mage_Admin (1.6.1.0)
Mage_Rule (1.6.0.0)
Mage_Adminhtml (0.7.1)
Mage_AdminNotification (1.6.0.0)
Mage_Cron (1.6.0.0)
Mage_Directory (1.6.0.1)
Mage_Dataflow (1.6.0.0)
Mage_Cms (1.6.0.0.1)
Mage_Index (1.6.0.0)
Mage_Customer (1.6.2.0.1)
Mage_Catalog (1.6.0.0.14)
Mage_CatalogRule (1.6.0.3)
Mage_CatalogIndex (1.6.0.0)
Mage_CatalogSearch (1.6.0.0)
Mage_Payment (1.6.0.0)
Mage_Sales (1.6.0.7)
Mage_CatalogInventory (1.6.0.0.2)
Mage_Shipping (1.6.0.0)
Mage_SalesRule (1.6.0.3)
Mage_Usa (1.6.0.1)
Mage_Paygate (1.6.0.0)
Mage_Checkout (1.6.0.0)
Mage_Backup (1.6.0.0)
Mage_Paypal (1.6.0.2)
Mage_Poll (1.6.0.0)
Mage_GoogleCheckout (1.6.0.1)
Mage_Log (1.6.0.0)
Mage_Review (1.6.0.0)
Mage_Rating (1.6.0.0)
Mage_Widget (1.6.0.0)
Mage_Tag (1.6.0.0)
Mage_Reports (1.6.0.0.1)
Mage_GoogleAnalytics (1.6.0.0)
Mage_Tax (1.6.0.3)
Mage_Wishlist (1.6.0.0)
Mage_PaypalUk (1.6.0.0)
Mage_Media (1.6.0.0)
Mage_GiftMessage (1.6.0.0)
Mage_Contacts (1.6.0.0)
Mage_Sendfriend (1.6.0.0)
Mage_Sitemap (1.6.0.0)
Mage_Rss (1.6.0.0)
Mage_ProductAlert (1.6.0.0)
Mage_Api (1.6.0.0)
Mage_Oauth (1.0.0.0)
Mage_Authorizenet (1.5.0.0)
Mage_Bundle (1.6.0.0.1)
Mage_Captcha (1.7.0.0.0)
Mage_Centinel (1.6.0.0)
Mage_Compiler (1.6.0.0)
Mage_Connect (1.6.0.0)
Mage_Newsletter (1.6.0.1)
Mage_Downloadable (1.6.0.0.2)
Mage_ImportExport (1.6.0.2)
Mage_Api2 (1.0.0.0)
Mage_PageCache (1.6.0.0)
Mage_Persistent (1.0.0.0)
Mage_Weee (1.6.0.0)
Mage_CurrencySymbol (1.0.0.0.0)
Mage_XmlConnect (1.6.0.0)
AW_All (2.2.1)
AW_Blog (1.1.1)
Eroi_Locator (0.1.4)
GTT_CustomZoom (1.0.0)
Gttadmin_CustomAdmin (1.0.0)
Inchoo_Notes (1.0.1)
MagicToolbox_MagicZoom ()
Netzarbeiter_GroupsCatalog2 (0.2.5)
OrganicInternet_SimpleConfigurableProducts (0.7.3)
Phoenix_Moneybookers (1.6.0.0)
Pollence_Easyexploded (0.1.0)
Raptor_Explodedmenu ()
TM_EasyCatalogImg ()
TM_EasyTabs (1.1.0)
ThemeTeam_AjaxCart ()

############ Models Rewrites #############
catalog/product_type_configurable_price -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Configurable_Price
catalog/product_type_simple -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Simple
catalog/product_type_virtual -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Virtual
catalog/product_type_configurable -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Configurable
catalog/product -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product
catalog_resource/category_flat -> Netzarbeiter_GroupsCatalog2_Model_Catalog_Resource_Category_Flat
catalogindex/data_configurable -> OrganicInternet_SimpleConfigurableProducts_CatalogIndex_Model_Data_Configurable
catalogsearch_resource/fulltext_collection -> Netzarbeiter_GroupsCatalog2_Model_CatalogSearch_Resource_Fulltext_Collection
wishlist_resource/item_collection -> Netzarbeiter_GroupsCatalog2_Model_Wishlist_Resource_Item_Collection
sitemap/sitemap -> AW_Blog_Model_Sitemap
catalogrule_mysql4/rule -> OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Mysql4_Rule
cataloginventory_mysql4/indexer_stock_configurable -> OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Mysql4_Indexer_Stock_Configurable
catalog_resource_eav_mysql4/product_collection -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
catalog_resource_eav_mysql4/product_indexer_price_configurable -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Configurable
catalog_resource_eav_mysql4/product_indexer_price -> OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price

############ Blocks Rewrites #############
adminhtml/notification_window -> AW_All_Block_Notification_Window
adminhtml/catalog_product_edit_tab_super_config_grid -> OrganicInternet_SimpleConfigurableProducts_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid
catalog/product_view_type_configurable -> OrganicInternet_SimpleConfigurableProducts_Catalog_Block_Product_View_Type_Configurable
catalog/product_price -> OrganicInternet_SimpleConfigurableProducts_Catalog_Block_Product_Price
catalog/product_view_media -> OrganicInternet_SimpleConfigurableProducts_Catalog_Block_Product_View_Media
catalog/product_view_attributes -> OrganicInternet_SimpleConfigurableProducts_Catalog_Block_Product_View_Attributes
checkout/cart_item_renderer -> OrganicInternet_SimpleConfigurableProducts_Checkout_Block_Cart_Item_Renderer
rss/wishlist -> OrganicInternet_SimpleConfigurableProducts_Rss_Block_Wishlist
rss/catalog_tag -> OrganicInternet_SimpleConfigurableProducts_Rss_Block_Catalog_Tag
rss/catalog_special -> OrganicInternet_SimpleConfigurableProducts_Rss_Block_Catalog_Special
rss/catalog_new -> OrganicInternet_SimpleConfigurableProducts_Rss_Block_Catalog_New
rss/catalog_category -> OrganicInternet_SimpleConfigurableProducts_Rss_Block_Catalog_Category

############ Helpers Rewrites #############

Thanks

Vinai commented 11 years ago

The OrganicInternet_SimpleConfigurableProducts extension (SCP) modifies the price indexer. I'll have to set up a testbed instance to check if that is causing the issue, but since I'm currently travelling it might be a few days until I get a chance.

If you want to, you could try if the issue goes away when you deactivate the SCP extension and then reindex the prices, just to pinpoint if that is the cause. To deactivate the extensions set <active>false</active> in the file app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml

stevejones20 commented 11 years ago

I've tried that and it didn't seem to make any difference...

stevejones20 commented 11 years ago

Hi Vinai,

Did you manage to get any further looking into this?

Thanks

Vinai commented 11 years ago

No, not so far. I'm afraid still can't reproduce the issue. Until I have time to experiment with having different extensions installed, there isn't much I can do.

Vinai commented 10 years ago

Please let me know if the issue persists in today's release 0.3.3. I'm still not able to reproduce the issue here, at least not on Magento 1.8.0.0.

stevejones20 commented 10 years ago

Hi, I've upgraded the plugin and still having the same problem. Thanks