Magento how to create bundle products

Share
Posted on March 2nd, 2013 | Posted by admin

Magento allows store owners to sell customizable products (eg. Product with more options to select from).
In this tutorial, we will show you how to:

  • Creae a new computer bundle, composed of the following user-selectable options: System Color, Operating System and Monitors.
  • Selections (eg. Pure White, Plum Purple) within each Option (eg. System Color) are composed from Simple Products. This means that you have to create your simple products first.
  • Pricing is dynamically calculated based on the user selected Option(s), using the Simple Products pricin

Magento performance: Optimization of Magento configurable products

Share
Posted on October 24th, 2012 | Posted by admin

If you use configurable products in your Magento store and your super attribute have a lot of options (thousands of options), you can experience the following performance issues:

  • Loading time of a configurable product page is more than other pages (especially when Magento cache is disabled)
  • When you add a configurable product to store cart, cart page become slow
  • When configurable product is added to store cart, all store pages become slow

In this article I will show how to debug such issues and how to fix the speed issue I described above.

Note: Pages load time depends on your server configuration and number of attribute options in your Magento store.

Product view loading time optimization

I started investigation of this issue on product view page. I found “TTT4″ point in the Magento profiler, which take a lot of loading time (in our case 10-15 seconds).
This is a call of _loadPrices() method in the Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection class.

Magento: Get Bestselling products by category and date time

Share
Posted on October 9th, 2012 | Posted by admin

Magento: Get Bestselling products by category and date time

This article will show you how to get best selling products. You will see how to get overall best selling products as well as best selling products by category and by date time range.

Here is the code:-

Get overall Bestselling products

public function getBestsellingProducts()
{
	// number of products to display
	$productCount = 5; 

	// store ID
	$storeId    = Mage::app()->getStore()->getId();       

	// get most viewed products for current category
	$products = Mage::getResourceModel('reports/product_collection')

Magento: How to get most viewed products?

Share
Posted on September 26th, 2012 | Posted by admin

Here, I will show you the code to get the most viewed products in Magento. The function addViewsCount()filters the products with their views count.

Here is the code:-

Get overall Most viewed products

public function getMostViewedProducts()
{
/**
* Number of products to display
* You may change it to your desired value
*/
$productCount = 5;
/**
* Get Store ID
*/
$storeId = Mage::app()->getStore()->getId();
/**
* Get most viewed product collection
*/
$products = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addViewsCount()
->setPageSize($productCount);
Mage::getSingleton('catalog/product_status')
->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')
->addVisibleInCatalogFilterToCollection($products);
return $products;
}

Get Most viewed products for current category

public function getMostViewedProducts()
{
// number of products to display
$productCount = 5;
// store ID
$storeId = Mage::app()->getStore()->getId();
// get most viewed products for current category
$products = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addViewsCount()
->addCategoryFilter(Mage::registry('current_category'))
->setPageSize($productCount);
Mage::getSingleton('catalog/product_status')
->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')
->addVisibleInCatalogFilterToCollection($products);
return $products;
}

Get Most viewed products for last 30 days

public function getMostViewedProducts()
{
// number of products to display
$productCount = 5;
// store ID
$storeId = Mage::app()->getStore()->getId();
// get today and last 30 days time
$today = time();
$last = $today - (60*60*24*30);
$from = date("Y-m-d", $last);
$to = date("Y-m-d", $today);
// get most viewed products for last 30 days
$products = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addViewsCount()
->addViewsCount($from, $to)
->setPageSize($productCount);
Mage::getSingleton('catalog/product_status')
->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')
->addVisibleInCatalogFilterToCollection($products);
return $products;
}

Hope this helps and thanks for reading.

How to sort products Magento

Share
Posted on February 4th, 2012 | Posted by admin

How to change the product position in the category product listing.

Sounds simple but most of people don’t know how to do it.

Magento allows you to order your products by name or by price when you’re surfing a category.

It also allows you to change the position when you’re sorting by default.

Page 1 of 612345»...Last »