1.use function addImageToMediaGallery addImageToMediaGallery (line 956) Add image to media gallery access: public void addImageToMediaGallery (string $file, , , ) string $file: file path of image in file system string|array $mediaAttribute: code of attribute with type 'media_image', leave blank if image...
Year: 2015
Creating a Magento custom model
Creating a Magento custom model Posted by Yongji Chen Tags: custom model Magento In this tutorial, we will create a custom model that uses a different name than the Module name. The Module tree will look like as shown in...
Image Type and Size
The following image types are used throughout the catalog, and you can choose which image you want to use for each. If you do not assign an image to each type, a placeholder image will be used instead. Thumbnail The...
Creating a custom Magento module
Creating a custom Magento module posted by ekononov Magento community provides us with a great variety of modules (free and paid), available for downloading and installing from Magento Connect catalog, and from 3rd party developers' websites. Together with the rich...
create filter by attribute (my code)
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'forme_shape'); foreach ($attribute->getSource()->getAllOptions(true, true) as $instance) { // $myArray] = $instance; //$productCollection_shape= $category_shape=Mage::getModel('catalog/category')->load($idcats); $productCollection_qty = $category_shape->getProductCollection() ->addAttributeToSelect(array('name', 'forme_shape')) ->addAttributeToFilter('forme_shape', array('eq' =>$instance )) ->count(); //print_r($productCollection_qty); if($productCollection_qty>0) { $myArray] = $instance; } } //print_r($myArray);
magento: get all attribute options
Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code); $options = $attribute_details->getSource()->getAllOptions(false);