Magento Themes and Magento Extensions

Change attributes magento

Posted on October 14th, 2012 | Posted by admin

Change attributes magento
I use custom attributes for my products and I am working on my script, which get attributes and after change them value. I have done selecting code but I dont know how can I do code, which change value.

->addAttributeToFilter(‘manufacturer’, ’3′)

foreach ($collection as $product) {

echo $product->getName();
echo $product->getResource()->getAttribute(‘cena_balenia_czk’)->getFrontend()->getValue($product);
echo ‘-’;
echo $product->getResource()->getAttribute(‘czk’)->getFrontend()->getValue($product);
echo ‘

How to get Dropdown Attributes Magento

Posted on April 14th, 2012 | Posted by admin

How to get Dropdown Attributes Magento
Get the Dropdown Attribute value in catalog list.

We saw How to get Attributes wich worked fine for text attributes.

Now if you want to get the dropdown attribute value:

<?php echo $_product->getAttributeText(‘attribute_name’) ?>

How to get Attributes Magento

Posted on December 9th, 2011 | Posted by admin

Today I’m gona show you how to retrieve the product attributes in your Magento site .

First of all go to Catalog -> Attributes -> Manage Attributes

Edit your attribute. Set Used in product listing to yes.

Magento: Displaying Custom Attributes on Product View

Posted on June 2nd, 2011 | Posted by admin

Adding custom attributes to your product view is very easy. Adding them to the product listing (category pages) is much more difficult. You’ll need to create a custom module for that. In this post though, I’ll only be showing you how to add attributes to the product view page.

If it is a text field (textbox or textarea), this is all you have to do:

<?php echo $_product->getAttributeName() ?>

There is one thing different here though. If your Attribute Code is “shirt_size”, then you would use getShirtSize(). Remove the underscores and capitalize the first letter of each word. It is picky that way. if you use getshirtsize(), it won’t work.

If you are using a dropdown or a multiple select, you have to call it a little differently:

<?php echo $_product->getAttributeText('shirt_size') ?>

This method requires the actual Attribute Code. If you are displaying the value from a dropdown, you’ll get exactly what you need with this call. If you are wanting to display the values from a multiple select, it will return an array.

Page 2 of 2«12