Magento Expert Forum - Improve your Magento experience

Results 1 to 3 of 3

Set the product disable in new products block but still can be seen on others page.

  1. #1
    New member
    Join Date
    May 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Set the product disable in new products block but still can be seen on others page.

    I try to add a product rather than as a new product but still be accessible from other pages such as categories or related products. In the admin panel, Set Product as New from Date and Set Product as New to Date has been filled in correctly. But the product still exists in the block of new products on the home page.

    File edited from public_html/app/code/core/Mage/Catalog/Block/Product/New.php

    This the code :

    PHP Code:
    $collection Mage::getResourceModel("catalog/product_collection'); $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
            
    $collection = $this->_addProductAttributesAndPrices($collection)
                ->addStoreFilter()
                // this is the code i've edited
                ->addAttributeToFilter('is_new_product', array('eq' => 1)) 
                ->addAttributeToSort('news_from_date', 'asc')
                ->setPageSize(
    $this->getProductsCount())
                ->setCurPage(1)
            ; 
    Can someone please explain?

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Jun 2016
    Location
    Bhavnagar, Gujarat, India
    Posts
    1,125
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Try adding insert ->addAttributeToSelect('*') in your custom code and check again. Also try with original code of New.php means revert your customization code for product collection.

  3. #3
    Expert
    Join Date
    Mar 2016
    Location
    india
    Posts
    570
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hi,

    Goto admin>CMS>page> select your home page and then goto it design tab

    There check is exiting or not

    <reference name="content">
    <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
    <action method="addPriceBlockType"><type>bundle</type>
    <block>bundle/catalog_product_price</block>
    <template>bundle/catalog/product/price.phtml</template>
    </action>
    </block>
    </reference>

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •