I’ve created a new product type and need to create and associate some custom attributes with it. Is there a way it can be done in the setup code? Update: When I say setup code I mean in the “module/sql/module_setup/mysql4-install-0.1.0.php” file for when Magento first uses the module. Custom attributes for custom product type Possibly [...]
Archive: custom attributes
Posts Tagged ‘custom attributes’
i’m trying to add an attribute to customer model. it a select list which allow customer to select, during registration, the job’s category: $this->addAttribute(‘customer’, ‘customer_sector’, array( ‘label’ => ‘Settore’, ‘type’ => ‘int’, ‘input’ => ‘select’, ‘default’ => ’0′, ‘backend’ => ”, ‘frontend’ => ”, ‘default_value’ => ”, ‘visible’ => 1, ‘user_defined’ => 1, ‘searchable’ => [...]
I have two custom attributes, one called ‘amz_prod_description’ and one called ‘upc’. According to this > http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/0_-_theming_in_magento/data_accessing_methods_from_within_various_scopes#accessing_the_value_of_a_product_s_custom_attribute I should be able to access them both $product->getUpc() and $product->getAmzProdDescription() where $product. In the same switch, I am using both of these. The ‘upc’ attribute var works fine, the other doesn’t work at all which is really [...]
Having an attribute set, how can I get a list of the attributes it contains (or better yet, just the custom attributes that don’t belong to the Default attribute set)? The attribute set itself can be obtained in several ways, such as: $entityTypeId = Mage::getModel(‘eav/entity’)->setType(‘catalog_product’)->getTypeId(); $attributeSet = Mage::getResourceModel(‘eav/entity_attribute_set_collection’)->setEntityTypeFilter($entityTypeId)->addFilter(‘attribute_set_name’, ‘Default’); Note that I need to use [...]
I added a custom eav attribute to my Magento application product entity using an installer script (Basically, following the procedure described here: Installing Custom Attributes with Your Module). Now, I want to use an update script to change (populate) the values of this attribute for each product according to some criteria (based on the product [...]
Using Magento 1.5.0.1, I noticed an interesting bug this afternoon. If you have setup any Date & Time or Time custom attributes, and have made them NOT required, here’s something you may notice: When initially adding the product to the cart, and you leave the Date & Time or Time custom options NOT filled out, [...]
This could be easier than I imagine but it’s not coming to me. I have several custom attributes show on each product view page and it works fine but I see no way to sort them. It looks like the attributes comes from additional.phtml <?php foreach ($this->getChildHtmlList() as $_html): ?> <?php echo $_html ?> <?php [...]
I’m getting the above error when using an extension that worked on 1.4.1.1. The extension implements custom attributes. I managed to fix one problem, but now when I try to create an order for a customer from the admin, I get the above error. Does anyone know what should be returned by $attribute->getDataModel(); in app/code/core/Mage/Customer/Model/Attribute/Data.php [...]
I was doing some debugging, trying to see how a condition for a promotion on the shopping cart was validating attributes when using the product attributes combination. I didn’t understand how Magento was getting custom attribute values from a product, if that custom attribute isn’t added to the quote item product in a config.xml. So [...]
How can I get custom attributes in the Magento (version 1.4) category list of products (in list.phtml)? I am trying to edit catalog.xml by adding <action method=”addAttribute”><code>format</code></action> and in list.phtml <?php echo $_product->getAttributeText(‘format’); ?> or <?php echo $_product->getFormat(); ?> But it doesn’t work. How can this be done? How can I get custom Magento attributes [...]