Magento Themes and Magento Extensions

Programmatically Add Attribute to an Attribute Set in Magento

Share
Posted on February 9th, 2015 | Posted by admin

Sometimes we need to create attribute and add it to an attribute set or to all attribute sets.In this article, we look how to add an attribute to ‘catalog_product’ entity for both these cases.

$model=Mage::getModel('eav/entity_setup','core_setup');

Here we instantiate Mage_Eav_Entity_Setup model

$data=array(
'type'=>'dropdown',
'input'=>'text',
'label'=>'Test Attribute',
'global'=>Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'is_required'=>'0',
'is_comparable'=>'0',
'is_searchable'=>'0',
'is_unique'=>'1',
'is_configurable'=>'1',
'use_defined'=>'1'
);

$model->addAttribute('catalog_product','test_attribute',$data);

We just created a new attribute called ‘test_attribute’.

How to Manage Product Attributes in magento

Share
Posted on January 29th, 2015 | Posted by admin

How to Manage Product Attributes in magento

Clicking on the [Create New Attribute] button will allow you to add attributes to your products:

How to Manage Product Attributes in magento

Once you are ready with the attribute, click on the [Save Attribute] button. Then you can click on the [Save] button in order to store your product information. Finally, you need to assign the new product to a chosen category:

Error: Can’t initialize indexer process – When we do reindex in magento

Share
Posted on March 20th, 2013 | Posted by admin

Sometimes when we do re-index in magento, it shows error like “Can’t initialize indexer process”. And this error occurs while re-indexing “Product Prices”, than you can’t able to save product from admin too.


DELETE cpop.* FROM catalog_product_option_price AS cpop
INNER JOIN catalog_product_option AS cpo
ON cpo.option_id = cpop.option_id
WHERE
cpo.type = ‘checkbox’ OR
cpo.type = ‘radio’ OR
cpo.type = ‘drop_down’;DELETE cpotp.* FROM catalog_product_option_type_price AS cpotp
INNER JOIN catalog_product_option_type_value AS cpotv
ON cpotv.option_type_id = cpotp.option_type_id
INNER JOIN catalog_product_option AS cpo
ON cpotv.option_id = cpo.option_id
WHERE
cpo.type  ‘checkbox’ AND
cpo.type  ‘radio’ AND
cpo.type  ‘drop_down’; 

Using Reports In Magento

Share
Posted on March 15th, 2013 | Posted by admin

Magento is the best e-commerce software to build great online stores. It helps you manage online stores in a simple yet efficient manner. Magento has remarkable features that make day to day online operations less tedious and easier for you.

The software has the ability to churn out various reports that can be very useful to you e-commerce business. Moreover it will help you keep an eye on your overall business activities. It will also help you enhance your productivity.

What can you do with Magento Reports?

  • You can know about how many customer accounts are created.
  • Know about your best selling products.z
  • You can also get data on your sales and coupon code usage.

How to use Reports?

First of all open reports menu and choose report you want to see. Some reports have filter, some only date range selector and some are displayed directly.

Once you chose parameters for your report, click on ‘Show Report’ button and you will see the results. At this point you can export the report in CSV, XML.

Display Parent category and subcategories of current parent in Magento

Share
Posted on January 13th, 2013 | Posted by admin

Display Parent category and subcategories of current parent in Magento
This also takes into consideration where you are in the system. For example if you are in a subcategory, then parent category of the subcategory will be displayed. However, if you are in a subcategory of DEFAULT CATEGORY, then the code checks for this and displays your current category.

We placed the following code into our template sidebar

<?php
$currentCat = Mage::registry('current_category');

//if Rootcategory display current category only
//this gets around the problem of displaying DEFAULT CATEGORY
if ( $currentCat->getParentId() == Mage::app()->getStore()->getRootCategoryId() )

//Display current category
echo $this->getCurrentCategory()->getName() ;

else
Page 1 of 3123»