Magento : show new products on home page - magento

I am working on my first Magento project. I want to display new products to the home page
I have researched and added this code
{{block type="catalog/product_new" column_count="6" products_count="3" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
And it worked until I added products from a category to same home page. Code is
{{block type="catalog/product_list" category_id="8" template="catalog/product/bestlist.phtml"}}
Now it shows products from category but not new products. I have disabled cache and also flushed all the existing cache.
I have tried and checked many ways but coulnt figure it out.
Can some body help me with a solution for this please?
PS: I am using latest version of magento 1.7.X
Thanks in advance,
Kiran

First, go to “CMS” > “Pages” > select “Home Page” (URL Key: home).
Click on “Design”
Paste the following XML update into the field provided:
<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>
<action method="setColumnCount"><columns>4</columns></action>
<action method="setProductsCount"><count>4</count></action>
</block>
</reference>
If you would like to increase/decrease the amount of products per column, please change
<action method="setColumnCount"><columns>4</columns></action>
to
<action method="setColumnCount"><columns>6</columns></action>
Also if you would like to limit the amount of products shown, change
<action method="setProductsCount"><count>4</count></action>
to
<action method="setProductsCount"><count>3</count></action>
Please note: For the products to show on the homepage you MUST ensure you have marked the products as new by setting “Set Product as New from Date” and “Set Product as New to Date” options in the “General” tab.

First, go to “CMS” > “Pages” > select “Home Page” (URL Key: home). Click on “Content” Paste the following Code
{{widget type="catalog/product_widget_new" display_type="new_products" show_pager="1" products_per_page="50" products_count="50" template="catalog/product/widget/new/content/new_grid.phtml"}}
Its working for me;
also we can set product limit on single page.

The code you used is for categories only. If you want to add a new module like new products in your magneto store , you have to search a Magento extension from http://www.magentocommerce.com/magento-connect/

Related

List 8 latest products on homepage - Magento 1.9.2.1

I know this question gets asked quite a bit and seems straight forward but I can't seem to find a post which states an answer that works.
There a few with solutions on how to list products marked with a 'new from' date in the backend and there are solutions which list the latest products from a specific category but I just need the 8 most recently added products to the catalog full stop.
Currently I am manually adding the products to a 'latest products' category with an ID of 116
and have this in the content of my home page CMS page:
{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="116" template="catalog/product/list-latest.phtml"}}
Then in the list-latest.phtml template file, I have some code to get the collection:
<?php
$_productCollection=$this->getLoadedProductCollection()->setPageSize(10);
$_productCollection->clear(); //this will unset the loaded items.
$_productCollection->getSelect()->limit(10); //set a new limit
$_productCollection->getSelect()->reset(Zend_Db_Select::ORDER); //reset the order
$_productCollection->getSelect()->order('cat_index_position asc');//force order by position in category
$_productCollection->load();
$_helper = $this->helper('catalog/output');
?>
And then it loops through the collection and works fine but I need a way to get the latest products from ALL categories and automatically put the latest 8 products on the homepage.
Is there a way to alter this code to do this?
Please try the following code
Place below code in you home page via admin login cms->select your home page->
design->Layout Update XML
<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>
<action method="setColumnCount"><columns>4</columns></action>
<action method="setProductsCount"><count>8</count></action>
</block>
The above code will show you new product with four columns per row and total 8 product limit.
Let me know if you have any query
I did this using a widget. Create a widget with:
type:Catalog new products list
Display On: where you want it
In the Widget Options tab: Display Type: all products (you can select New Products but then you have to mark products as new rather than the latest you added)
There are other options that are self-explanatory.
You will probably have to theme your widget but it shouldn't be too different to a normal product displays.

Magento mini-cart not updating on product pages

I am having an issue in my magento mini cart .
when i go to a product page and click on Add to cart , my mini cart does not update and show the product items on the product page but the products are added to cart once i go to the cart page.
I am creating a local.xml file for my theme and having this code here
<block type="checkout/cart_sidebar" name="custom_mini_cart" template="checkout/cart/mini.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
<label>Shopping Cart Sidebar Extra Actions</label>
</block>
</block>
and on my header.phtml
I am calling this like
$cart_html = $this->getChildHtml('custom_mini_cart');
It works fine when i go to cart page or checkout page.
product quantity and items don't show up on product page in minicart
any help will be appreciated
Thanks
Theres a slug that defines which pages this will work on.
In this case, it should be under the slug
<default>
Your code goes here.
</default>
My guess is that you have it under:
<checkout_cart_index translate="label">
I believe you probably have it under this one.
</checkout_cart_index>
What this states is that even though you're adding your content to the header. You will only be adding it to pages that are part of the cart_index
Hope this solves your issue

Get latest or new products on home page in magento with layout update

I create new theme in Magento and want to show latest or new products on home page with pagination and number of show product. I copied catalog/product/list.phtml from it's cored file to my template so that i can customize it.
Below is code in layout update in homepage:
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>3</category_id></action>
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/></block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</reference>
It work well with is code, but only with category I set in layout update.
<action method="setCategoryId"><category_id>3</category_id></action>
What I want is get all latest or new product from all category.
Question: how can I get latest or new products with layout update with all category or multiple category?
Open Magento admin panel
Go to CMS > Pages > Home page
Switch to the content tab
Insert the following code:
{{block type="catalog/product_new" column_count="6" products_count="12" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/list.phtml"}}
Where:
column_count="6" – number of the product columns
products_count="12" – number of the displayed products
You can use
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
Here you can ‘Set Product as New from Date’ and ‘Set Product as New to Date’ options in the ‘General’ product information page in the admin tool will be shown.
The best way to do that is by using Magento Widget.
From your CMS homepage, go to content and clic on the second item in wysiwyg menu: Insert widget.
Then, a popin appear, choose in Widget Type: Catalog New Products List.
Clic on Insert widget and it's done.
This is what I use on my homepage:
{{block type="catalog/product_list" category_id="11" num_products="16" template="catalog/random.phtml"}}
I use this on the homepage to show items from that category directly. This way I dont have duplicate content issues and the user links directly into the category.
You can see an example on our website www.SaveTheMage.com

Magento 1.7:Show category image on category page in full width in a 2 column template

Can't find a solution for this issue running Magento 1.7. The category shown above in the main column. I want to show it above both columns, on page width. Here is an example: http://www.vimodos.nl/schoenen?art_sex=92
Anyone with a solution?
Your reply is much appreciated!
UPDATE
Thanks for the reply. I followed your instructions and added a block called category.image in the catalog.xml
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/category_image" name="category.image" template="catalog/category/image.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
After that I created a image.phtml file under /template/catalog/category/
When reloading the category page it's empty, there is no error message. The widgets in the left side bar are visible.
Any suggestions? Many thanks!
This seems to be a built in feature in Magento.
To enable it do the following:
Log in to the admin panel
Go to catalog->manage categories
Select the category you want to add an image
You will see a place where you can add an image (just upload it)
Once you add an image it will automatically show in category page
Update
Here is the code to get the category image:
$category = Mage::getModel('catalog/category')->load($catId);
$category->getImageUrl(); // remember to echo it out
In order to set this up above layered navigation, do the following steps:
Add a block to the catalog.xml (in the: <catalog_category_default translate="label"> section.
Add the code above to the template file (that you referenced in the block above)
Let us know if you need further assistance with this

How to display all products for one perticular category?

I am facing a problem that I am having 3 categories like... 1)A, 2)B and 3)C. Now as per the settings in admin, each category's product listing having pagination but I don't want pagination dependent listing in category B. Instead I want to display all it's products on one single page.
What should be done for this?
Any Help?
Edit the category in the Magento Admin UI. Find the 'Custom Design' tab and the 'Custom Layout' text area in that tab. Add the following:
<reference name="product_list_toolbar_pager">
<action method="addPagerLimit" translate="label">
<mode>list</mode>
<limit>all</limit>
<label>All</label>
</action>
<action method="setDefaultListPerPage">
<limit>all</limit>
</action>
</reference>
NB: This still leaves the pager toolbar for the customer to limit the display and/or sort the results.

Resources