Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7408953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:59:58+00:00 2026-05-29T05:59:58+00:00

I am over writing the product list in my extension but when I write

  • 0

I am over writing the product list in my extension but when I write the collection it add extra filter of category that i dont need.

Here is my code:

$collection = Mage::getResourceModel('catalog/product_collection');
$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$collection->addAttributeToSelect($attributes)
           ->addMinimalPrice()
           ->addFinalPrice()
           ->addTaxPercents()
           ->addStoreFilter();

$collection->addIdFilter($result);
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
$collection->printlogquery(true);

You can see i did not add any category filter check but when i print the query i got this:

    SELECT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`,
           `price_index`.`final_price`, IF(`price_index`.`tier_price`,
           LEAST(`price_index`.`min_price`, `price_index`.`tier_price`),
           `price_index`.`min_price`) AS `minimal_price`,
           `price_index`.`min_price`, `price_index`.`max_price`, 
           `price_index`.`tier_price`,
           `cat_index`.`position` AS `cat_index_position`
      FROM `mage_catalog_product_entity` AS `e`
INNER JOIN `mage_catalog_product_index_price` AS `price_index`
        ON price_index.entity_id = e.entity_id
       AND price_index.website_id = '1'
       AND price_index.customer_group_id = 0
INNER JOIN `mage_catalog_category_product_index` AS `cat_index`
        ON cat_index.product_id=e.entity_id
       AND cat_index.store_id='1'
       AND cat_index.visibility IN(2, 4)
       AND cat_index.category_id='3'
     WHERE (e.entity_id in ('724', '729', '733', '737', '741', '745', '749', '755',
                            '759', '766', '770', '775', '780', '785', '920', '921',
                            '923', '927', '957', '958', '959', '960', '961', '962',
                            '963', '964', '965', '966', '967', '1146', '1147', '1185', 
                            '1186', '1187', '1188', '1189', '1190', '1191', '1192', 
                            '1193', '1194', '1195', '1196', '1274', '1275', '1276', 
                            '1277', '1278', '1279', '1280', '1281', '1282', '1283', 
                            '1284', '1285', '1286', '1287', '1288', '1289', '1290', 
                            '1291', '1292', '1293', '1294', '1295', '1310', '1311', 
                            '1312', '1313', '1314', '1315'))

Here you see that in query it is printing the cat_index.category_id='3' which i dont need. I need to know that how can i remove this category filter there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:59:59+00:00Added an answer on May 29, 2026 at 5:59 am

    The category filter is added when you use

    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
    

    Instead, remove that line, and replace it with:

    $collection->addAttributeToFilter('visibility', array('in' => array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG, Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an algorithm that iterates over a list of points, calculates the distance
I need a function that functions in a similar manner as itertools.product, but without
I'm writing an iOS app that streams video and audio over the network. I
I'm writing a client that talks to a remote server over HTTP. I would
I am writing an HTML program that will be accessed by over 500 people
I'm currently writing an application using Vala that requires me to send data over
I am writing a shopping cart effect. When user add the product to shopping
I'm writing an installer that will tune the configuration of the product for the
I am writing a licensing application that is specific to our product. It is
I find that I need to frequently favor composition over inheritance and consequently a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.