Skip to content

Using new product attribute types

clockworkgeek edited this page Jun 14, 2015 · 2 revisions

Product Attribute Types

Using the new product attribute types is no different from other product attributes

  1. After installation go to the admin menu, "Catalog > Attributes > Manage Attributes".
  2. Click the "Add New Attribute" button in the top right.
  3. The new types are available in the "Catalog Input Type for Store Owner" field. You may choose from:
  • HTML Color
  • HTML Email
  • HTML Number
  • HTML URL
  • WYSIWYG Media File
  • Widget

Email, Number & URL

These types work just like "Text Field" in old web browsers. Supportive browsers add extra features like a spin control for numbers, or a ".com" shortcut for URLs.

Color

The color type stores it's value in hexadecimal format like #ffffff or #123abc. It does not make sense to have this raw data visible on the front-end, instead a change is needed to your store's theme.

For example, say you have created an attribute brand_color you can then apply this color to the product page. In the template/catalog/product/view.phtml file of your theme find the following line:

<div class="product-view">

...and replace it with this:

<div class="product-view" style="background-color: <?php echo $_product->getBrandColor() ?>;">

Widget

If a widget-type attribute has the "Visible on Product View Page on Front-end" option set then it will appear in the "Additional Information" tab with other visible attributes, but it will be a fully rendered widget. This could be used to insert a common shipping or warrantee CMS static block into specific product pages without having to copy a lot of text each time.

Media File

The media file type works much like the widget type when made visible, except it helps a bit more by displaying the file in an <img> tag. If it did not only an URL would be displayed instead.

Uninstalling

The new attributes you create will depend on Form Elements extension. If this extension is uninstalled you must first delete those dependent attributes or some parts of your store will break.