<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brim &#187; Magento</title>
	<atom:link href="http://www.brimllc.com/category/blog/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brimllc.com</link>
	<description>streamlined software development</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:30:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magento &#8211; Accessing Custom Product Attributes in the Cart/Checkout Area</title>
		<link>http://www.brimllc.com/2011/04/magento-accessing-custom-product-attributes-in-the-cartcheckout-area/</link>
		<comments>http://www.brimllc.com/2011/04/magento-accessing-custom-product-attributes-in-the-cartcheckout-area/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 17:38:52 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=420</guid>
		<description><![CDATA[For some reason, I always tend to run into this problem and I forgot the solution I previously implemented. Sometimes, you Magento site will have custom product attributes that you&#8217;d like to be viewable from the cart/checkout areas. For performance reasons, the product available to the order/quote doesn&#8217;t contain all of the attributes. 
Instead of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>For some reason, I always tend to run into this problem and I forgot the solution I previously implemented. Sometimes, you Magento site will have custom product attributes that you&#8217;d like to be viewable from the cart/checkout areas. For performance reasons, the product available to the order/quote doesn&#8217;t contain all of the attributes. </p>
<p>Instead of querying the product new to retrieve the attributes, you can instead define what attributes you&#8217;d like to be loaded during the cart/checkout process within the a config.xml file. The structure will be as follows:</p>
<p>&lt;sales&gt;<br />
&lt;quote&gt;<br />
&lt;item&gt;<br />
&lt;product_attributes&gt;</p>
<p>&lt;your_attribute_1/&gt;<br />
&lt;your_attribute_2/&gt;</p>
<p>&lt;/product_attributes&gt;<br />
&lt;/item&gt;<br />
&lt;quote&gt;<br />
&lt;sales&gt;</p>
<p>Maybe this will save some others time as well&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2011/04/magento-accessing-custom-product-attributes-in-the-cartcheckout-area/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento &#8211; Automate the Creation of Additional/Custom Category Attributes</title>
		<link>http://www.brimllc.com/2011/03/magento-automate-the-creation-of-additionalcustom-category-attributes/</link>
		<comments>http://www.brimllc.com/2011/03/magento-automate-the-creation-of-additionalcustom-category-attributes/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 20:33:35 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=416</guid>
		<description><![CDATA[If you search the net for how to add new custom attributes to categories, you&#8217;ll find many sites that define the steps in manual SQL inserts. The issue I found was that most of these sites are specific to Magento versions previous to 1.4/Enterprise 1.9 and leave out a crucial step. Also, I find it [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>If you search the net for how to add new custom attributes to categories, you&#8217;ll find many sites that define the steps in manual SQL inserts. The issue I found was that most of these sites are specific to Magento versions previous to 1.4/Enterprise 1.9 and leave out a crucial step. Also, I find it to be bad practice to manually insert rows into your Magento database because it makes it hard to deploy across environments.</p>
<p>The general approach to create custom category attributes is the following 3 SQL inserts:</p>
<pre><code>INSERT INTO `eav_attribute` (
				`attribute_id` ,
				`entity_type_id` ,
				`attribute_code` ,
				`attribute_model` ,
				`backend_model` ,
				`backend_type` ,
				`backend_table` ,
				`frontend_model` ,
				`frontend_input` ,
				`frontend_label` ,
				`frontend_class` ,
				`source_model` ,
				`is_required` ,
				`is_user_defined` ,
				`default_value` ,
				`is_unique` ,
				`note`
	)
	VALUES (
			NULL ,  '3',  'header_image', NULL ,  'catalog/category_attribute_backend_image',  'varchar', NULL , NULL ,  'image',  'Header Image', NULL , NULL ,  '0',  '0', NULL ,  '0',  ''
	);

	SET @attribute_id = LAST_INSERT_ID();

	INSERT INTO `eav_entity_attribute` (
				`entity_attribute_id` ,
				`entity_type_id` ,
				`attribute_set_id` ,
				`attribute_group_id` ,
				`attribute_id` ,
				`sort_order`
	)
	VALUES (
		NULL ,  '3',  '3',  '3',  @attribute_id,  '30'
	);

	INSERT INTO `catalog_eav_attribute` (
				`attribute_id` ,
				`frontend_input_renderer` ,
				`is_global` ,
				`is_visible` ,
				`is_searchable` ,
				`is_filterable` ,
				`is_comparable` ,
				`is_visible_on_front` ,
				`is_html_allowed_on_front` ,
				`is_used_for_price_rules` ,
				`is_filterable_in_search` ,
				`used_in_product_listing` ,
				`used_for_sort_by` ,
				`is_configurable` ,
				`apply_to` ,
				`is_visible_in_advanced_search` ,
				`position` ,
				`is_wysiwyg_enabled`
	)
	VALUES (
		@attribute_id, NULL ,  '1',  '1',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '1',  '',  '0',  '',  '0'
	);</code></pre>
<p>The above code is specific to one of my Magento installs, which in this case I&#8217;m creating a custom image attribute. You can create any sort of attribute by identifying a similar attribute and copying most of the columns.</p>
<p>Now, this alone will give you your custom attribute, and if you only have one environment, this may be sufficient. Most projects, however, have development, test, and production environments, and if you manually insert SQL, it can be hard to ensure data consistency. </p>
<p>For this reason, its good practice to create a custom module where you can create a sql setup script that will automatically run and insert your desired columns. For my project, I created a module called Brim_Catalog with the following folder hierarchy:</p>
<p>-app<br />
    &#8211; code<br />
        &#8211; local<br />
            &#8211; Brim<br />
                &#8211; Catalog<br />
                    &#8211; etc (create a config.xml file here)<br />
                    &#8211; sql<br />
                        &#8211; brim_catalog_setup (create a mysql-install-0.1.0.php here)</p>
<p>Now, in your config.xml, create the following resource declaration:</p>
<pre>
<code>
&lt;resources>
            &lt;brim_catalog_setup&gt;
                &lt;setup&gt;
                    &lt;module&gt;Brim_Catalog&lt;/module&gt;
                &lt;/setup&gt;
                &lt;connection&gt;
                    &lt;use>core_setup&lt;/use&gt;
                &lt;/connection&gt;
            &lt;/brim_catalog_setup&gt;
        &lt;/resources&gt;
</code>
</pre>
<p>Finally, you can define your SQL in the mysql-install-0.1.0.php file as such:</p>
<pre>
<code>

<?php

$installer = $this;

$installer->startSetup();

// create a new category attribute 'header_image' to display as the header on category landing pages
$installer->run("
	INSERT INTO `eav_attribute` (
				`attribute_id` ,
				`entity_type_id` ,
				`attribute_code` ,
				`attribute_model` ,
				`backend_model` ,
				`backend_type` ,
				`backend_table` ,
				`frontend_model` ,
				`frontend_input` ,
				`frontend_label` ,
				`frontend_class` ,
				`source_model` ,
				`is_required` ,
				`is_user_defined` ,
				`default_value` ,
				`is_unique` ,
				`note`
	)
	VALUES (
			NULL ,  '3',  'header_image', NULL ,  'catalog/category_attribute_backend_image',  'varchar', NULL , NULL ,  'image',  'Header Image', NULL , NULL ,  '0',  '0', NULL ,  '0',  ''
	);

	SET @attribute_id = LAST_INSERT_ID();

	INSERT INTO `eav_entity_attribute` (
				`entity_attribute_id` ,
				`entity_type_id` ,
				`attribute_set_id` ,
				`attribute_group_id` ,
				`attribute_id` ,
				`sort_order`
	)
	VALUES (
		NULL ,  '3',  '3',  '3',  @attribute_id,  '30'
	);

	INSERT INTO `catalog_eav_attribute` (
				`attribute_id` ,
				`frontend_input_renderer` ,
				`is_global` ,
				`is_visible` ,
				`is_searchable` ,
				`is_filterable` ,
				`is_comparable` ,
				`is_visible_on_front` ,
				`is_html_allowed_on_front` ,
				`is_used_for_price_rules` ,
				`is_filterable_in_search` ,
				`used_in_product_listing` ,
				`used_for_sort_by` ,
				`is_configurable` ,
				`apply_to` ,
				`is_visible_in_advanced_search` ,
				`position` ,
				`is_wysiwyg_enabled`
	)
	VALUES (
		@attribute_id, NULL ,  '1',  '1',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '0',  '1',  '',  '0',  '',  '0'
	);
");

$installer->endSetup();
</code>
</pre>
<p>That&#8217;s all there is to it. Now, every environment that you deploy your code to will be guaranteed to have the same custom category attributes. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2011/03/magento-automate-the-creation-of-additionalcustom-category-attributes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento : Getting a Product&#8217;s Manufacturer Name instead ID</title>
		<link>http://www.brimllc.com/2011/02/magento-getting-a-products-manufacturer-name-instead-id/</link>
		<comments>http://www.brimllc.com/2011/02/magento-getting-a-products-manufacturer-name-instead-id/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 11:25:22 +0000</pubDate>
		<dc:creator>bmcgilligan</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=406</guid>
		<description><![CDATA[If you have every done this:

$_product = Mage::getModel('catalog/product')->load(__PRODUCT_ID__);
$manufacturer = $_product->getManufacturer();

You&#8217;ll know that you get the manufacturer&#8217;s id instead of it&#8217;s name.  Which may or may not be what you would have expected.  But the product model provides a nice helper method for getting an attributes value, in case it was not what you [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>If you have every done this:</p>
<p><code><br />
$_product = Mage::getModel('catalog/product')->load(__PRODUCT_ID__);<br />
$manufacturer = $_product->getManufacturer();<br />
</code></p>
<p>You&#8217;ll know that you get the manufacturer&#8217;s id instead of it&#8217;s name.  Which may or may not be what you would have expected.  But the product model provides a nice helper method for getting an attributes value, in case it was not what you were expecting.  Below is the code to get a product&#8217;s manufacturer name instead of it&#8217;s ID.</p>
<p><code><br />
$_product = Mage::getModel('catalog/product')->load(__PRODUCT_ID__);<br />
$manufacturer = $_product->getAttributeText('manufacturer');<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2011/02/magento-getting-a-products-manufacturer-name-instead-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento v1.4 / E1.9 Getting Parent Product from Simple Product</title>
		<link>http://www.brimllc.com/2011/01/magento-v1-4-e1-9-getting-parent-product-from-simple-product/</link>
		<comments>http://www.brimllc.com/2011/01/magento-v1-4-e1-9-getting-parent-product-from-simple-product/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 17:58:47 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=391</guid>
		<description><![CDATA[In previous versions of Magento, the approach I would take to get a product&#8217;s parent product would be the following:

$parentIdArray = $product->loadParentProductIds()->getData('parent_product_ids');
$parent = Mage::getModel('catalog/product')->load($parentIdArray['0']);

In the latest version of Magento, Mage_Catalog_Model_Resource_Eav_Mysql4_Product::getParentProductIds() has been removed. Its odd though because line 1338 of Mage_Catalog_Model_Product still references this missing method. So, if you use the above code to retrieve [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In previous versions of Magento, the approach I would take to get a product&#8217;s parent product would be the following:</p>
<p><code><br />
$parentIdArray = $product->loadParentProductIds()->getData('parent_product_ids');<br />
$parent = Mage::getModel('catalog/product')->load($parentIdArray['0']);<br />
</code></p>
<p>In the latest version of Magento, Mage_Catalog_Model_Resource_Eav_Mysql4_Product::getParentProductIds() has been removed. Its odd though because line 1338 of Mage_Catalog_Model_Product still references this missing method. So, if you use the above code to retrieve a product&#8217;s parent product, then it will blow up with a missing method exception.</p>
<p>For the time being, my fix is just to copy the Mage_Catalog_Model_Resource_Eav_Mysql4_Product class into my local code folder and add the method back in. The code for this method is the following:</p>
<p><code><br />
public function getParentProductIds($object)<br />
{<br />
$childId = $object->getId();</p>
<p>$groupedProductsTable = $this->getTable('catalog/product_link');<br />
$groupedLinkTypeId = Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED;</p>
<p>$configurableProductsTable = $this->getTable('catalog/product_super_link');</p>
<p>$groupedSelect = $this->_getReadAdapter()->select()<br />
->from(array('g'=>$groupedProductsTable), 'g.product_id')<br />
->where("g.linked_product_id = ?", $childId)<br />
->where("link_type_id = ?", $groupedLinkTypeId);</p>
<p>$groupedIds = $this->_getReadAdapter()->fetchCol($groupedSelect);</p>
<p>$configurableSelect = $this->_getReadAdapter()->select()<br />
->from(array('c'=>$configurableProductsTable), 'c.parent_id')<br />
->where("c.product_id = ?", $childId);</p>
<p>$configurableIds = $this->_getReadAdapter()->fetchCol($configurableSelect);<br />
return array_merge($groupedIds, $configurableIds);<br />
}</p>
<p></code></p>
<p>With the above method added back in, my original code works. I&#8217;d like to know if there is a new suggested approach to get a product&#8217;s parent, but for the time being, this is what I&#8217;ll fall back to. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2011/01/magento-v1-4-e1-9-getting-parent-product-from-simple-product/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento Grouped Products Containing Associated Configurable Products</title>
		<link>http://www.brimllc.com/2010/12/magento-grouped-products-containing-associated-configurable-products/</link>
		<comments>http://www.brimllc.com/2010/12/magento-grouped-products-containing-associated-configurable-products/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 00:00:25 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=312</guid>
		<description><![CDATA[We currently have a post explaining how to associated simple products that have required options to a parent grouped product (link), but another product configuration that many people ask about is associating configurable products within a grouped product. This association allows a Magento store to more intuitively display their products on a single page, rather [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>We currently have a post explaining how to associated simple products that have required options to a parent grouped product (<a href="http://www.brimllc.com/2010/07/magento-associating-simple-products-with-required-options-to-a-grouped-product/">link</a>), but another product configuration that many people ask about is associating configurable products within a grouped product. This association allows a Magento store to more intuitively display their products on a single page, rather than forcing the user to navigate to multiple configurable product pages.</p>
<p>There are quite a few steps to get this working correctly, but since we&#8217;ve implemented this for a few clients, we&#8217;ve bundled the code into a module that you can download here: <a href='http://www.brimllc.com/wp-content/uploads/2011/02/groupedconfigurable.zip'>groupedconfigurable</a>.</p>
<p>Here, I&#8217;ll list the basic steps to get this working, and you can download the code and modify to your liking.</p>
<p>Step 1: Allow the Association</p>
<p>By default, Magento wont allow you to link a configurable product from a grouped product. If you check config.xml in the module we wrote, we updated the allowable product types for a grouped product.</p>
<p>Step 2. Add our product.js File to your layout</p>
<p>Since the configurable product, by default, is a page-centric configuration, we had to write a new javascript class to handle having multiple configurable products on a single page. In your grouped product layout handle, add the brim/product.js file.</p>
<p>Step 3. Check for a configurable product, and use our new configurable template</p>
<p>In the grouped.phtml file, while it is iterating through the associated products, check if the product is configurable. If it is, use our Helper class to echo out the configurable template. This would look something like: (this is basically pseudo code)</p>
<pre>
if($_item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE):

echo Mage::helper('groupedconfigured')->getAssociatedConfigurableProductHtml($this, $_item) ;

else:

// default to original behavior
</pre>
<p>Within the method getAssociatedConfigurableProductHtml, it will create a block using the configurable template we&#8217;ve provided.</p>
<p>Another thing to mention is that since Magento by default has a single form for adding products to cart, you&#8217;ll want to remove the form declaration from the grouped.phtml file, and instead, just use the forms that are provided by our template.</p>
<p>To show the module in work, I added configurable products to the &#8220;recently viewed&#8221; template on the right-hand side of a base magento install. You can see it here:<br />
<a href="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-10-at-4.30.57-PM.png" rel="lightbox[312]"><img src="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-10-at-4.30.57-PM-300x194.png" alt="" title="Screen shot 2010-12-10 at 4.30.57 PM" width="300" height="194" class="alignnone size-medium wp-image-315" /></a></p>
<p>The screen shown above isn&#8217;t pretty (I didn&#8217;t style anything), but as you can see, you can display a configurable product anywhere in your store using a convenient helper method. We&#8217;ve provided the code necessary in this post, but if anyone has specific customization questions or needs any help, send us an email through our site&#8217;s contact form or comment below.</p>
<p>&#8211; UPDATE &#8211;</p>
<p>Jason (see comments below) pointed out a flaw in my config.xml file and the lack of some required overrides. I&#8217;ve updated my module, and the link above is the latest version. </p>
<p>– Update (8/5/11) –</p>
<p>We have packaged this blog post up into an easy to install Magento extension available in our new <a href="http://ecommerce.brimllc.com/">Magento Extension Store</a>. The new extension is now called <a href="http://ecommerce.brimllc.com/grouped-options.html">Grouped Options</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/12/magento-grouped-products-containing-associated-configurable-products/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Magento Font Replacement using Cufon</title>
		<link>http://www.brimllc.com/2010/12/magento-font-replacement-using-cufon/</link>
		<comments>http://www.brimllc.com/2010/12/magento-font-replacement-using-cufon/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 20:50:18 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=295</guid>
		<description><![CDATA[Cufon is a really great javascript-based font replacement library, which aims to be a sIFR replacement. In an attempt to make it easier for a Magento storefront to take advantage of its functionality, we have written a module that allows you to upload the fonts you&#8217;d like to use on your website and easily replace [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="https://github.com/sorccu/cufon/wiki/About">Cufon</a> is a really great javascript-based font replacement library, which aims to be a sIFR replacement. In an attempt to make it easier for a Magento storefront to take advantage of its functionality, we have written a module that allows you to upload the fonts you&#8217;d like to use on your website and easily replace any text or component using a single method. </p>
<p>Once you&#8217;ve installed the module (link at the end of this post), you&#8217;ll first want to upload the fonts you&#8217;d like to use on your site. In your admin panel, navigate to Catalog->Brim Fonts.<br />
<a href="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-2.55.04-PM.png" rel="lightbox[295]"><img src="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-2.55.04-PM-300x205.png" alt="" title="Screen shot 2010-12-04 at 2.55.04 PM" width="300" height="205" class="alignnone size-medium wp-image-296" /></a></p>
<p>Here, you can upload the fonts you&#8217;ll be using on your site given a name and the font file.<br />
<a href="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-3.08.44-PM.png" rel="lightbox[295]"><img src="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-3.08.44-PM-300x131.png" alt="" title="Screen shot 2010-12-04 at 3.08.44 PM" width="300" height="131" class="alignnone size-medium wp-image-297" /></a></p>
<p>Now that you&#8217;ve created your font, you can replace any text in your templates. Simply use the helper method &#8220;replace&#8221; as such:</p>
<pre>
echo Mage::helper('brim_fonts')->replace('.product-name h1', 'Chalkduster')
</pre>
<p>Given the above code, Cufon will now replace your h1 product name text with the Chalkduster font:<br />
<a href="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-3.23.46-PM.png" rel="lightbox[295]"><img src="http://www.brimllc.com/wp-content/uploads/2010/12/Screen-shot-2010-12-04-at-3.23.46-PM-300x126.png" alt="" title="Screen shot 2010-12-04 at 3.23.46 PM" width="300" height="126" class="alignnone size-medium wp-image-298" /></a></p>
<p>Installation of this module can be a bit tricky, but we&#8217;re happy to help out with any installations. You&#8217;ll start by installing the Brim/Fonts <a href="http://www.brimllc.com/wp-content/uploads/2010/12/Brim.zip">module</a> into your app/code/local directory. </p>
<p>Next, place the <a href="http://www.brimllc.com/wp-content/uploads/2010/12/lib.zip">cufon php lib</a> under your root/lib folder. Likewise, place the <a href="http://www.brimllc.com/wp-content/uploads/2010/12/js.zip">cufon js</a> files under root/js. </p>
<p>Once this has been done, you have all the code necessary to enable the module. You&#8217;ll want to create a Brim_Fonts.xml file in your app/etc/modules directory just like any other module to make it active.</p>
<p>The only configuration for this module is specifying the location of the fontforge executable. Cufon sits on top of fontforge, so you need to have it installed on your server in order for it generate your fonts from your .ttf files. You can install fontforge from here : <a href="http://fontforge.sourceforge.net/">http://fontforge.sourceforge.net/</a>. Once this is installed, you need to update your app/code/local/Brim/Fonts/etc/config.xml to know where the location of your fontforge resides. As you can see in the file by default, the location of my fontforge is /usr/local/bin/fontforge.</p>
<p>Again, we&#8217;re happy to help with any installations, so let us know if you have any questions.</p>
<p>&#8211; EDIT [1/6/11] &#8211;</p>
<p>Oguz (see comments section) noticed something I missed and was kind enough to email me. I forgot to include that you&#8217;ll need to add the cufon js to any page you&#8217;d like to replace fonts. In your layout handle, you can do something like this:</p>
<pre><code>&lt;action method="addJs"&gt;&lt;script&gt;cufon.js&lt;/script&gt;&lt;/action></code></pre>
<p>Thanks Oguz!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/12/magento-font-replacement-using-cufon/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Magento &#8220;Recently Viewed Products&#8221; Sort Order</title>
		<link>http://www.brimllc.com/2010/11/magento-recently-viewed-products-sort-order/</link>
		<comments>http://www.brimllc.com/2010/11/magento-recently-viewed-products-sort-order/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 16:38:01 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=291</guid>
		<description><![CDATA[For most users, the &#8220;recently viewed products&#8221; should be ordered based on the last product viewed. Previous versions of Magento had defects filed describing the recently viewed products were being ordered by the index ID, but this has apparently been resolved in the latest versions. The forum post here describes the defect: http://www.magentocommerce.com/boards/viewthread/9752/ .
Well, when [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>For most users, the &#8220;recently viewed products&#8221; should be ordered based on the last product viewed. Previous versions of Magento had defects filed describing the recently viewed products were being ordered by the index ID, but this has apparently been resolved in the latest versions. The forum post here describes the defect: http://www.magentocommerce.com/boards/viewthread/9752/ .</p>
<p>Well, when helping a recent client, he was running on Enterprise version 1.9, and he was still having the ordering issue. I took a look, and it appears that if the &#8220;recently viewed products&#8221; widget is on anything but a product view page, the ordering will still not work. </p>
<p>The solution that I implemented was to &#8220;rewrite&#8221; the Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection class and override it&#8217;s setAddedAtOrder()  method. The setAddedAtOrder() method adds the added_ad column as the sort order column ONLY if the index table has been joined to the query. This only occurs on the product view page. The overridden method should look as such:</p>
<pre>
public function setAddedAtOrder($dir = 'desc')
{
    $this->_joinIdxTable();

    $this->getSelect()->order('added_at '.$dir);

    return $this;
}
</pre>
<p>This ensures that every time we attempt to set the order, it will join the index table appropriately. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/11/magento-recently-viewed-products-sort-order/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing Telephone Required Validation on Addresses in Magento</title>
		<link>http://www.brimllc.com/2010/11/removing-telephone-required-validation-on-addresses-in-magento/</link>
		<comments>http://www.brimllc.com/2010/11/removing-telephone-required-validation-on-addresses-in-magento/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 00:00:56 +0000</pubDate>
		<dc:creator>tmillhouse</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/2010/11/removing-telephone-required-validation-on-addresses-in-magento/</guid>
		<description><![CDATA[The telephone field on the Magento address is a required field. You&#8217;d think that removing this constraint would be as easy as removing the required-entry class so that the client-side javascript validation doesn&#8217;t require it, but its not that simple. 
Removing the telephone as a required field on any Magento customer address requires 3 changes:
1. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The telephone field on the Magento address is a required field. You&#8217;d think that removing this constraint would be as easy as removing the required-entry class so that the client-side javascript validation doesn&#8217;t require it, but its not that simple. </p>
<p>Removing the telephone as a required field on any Magento customer address requires 3 changes:</p>
<p>1. As noted above, remove the &#8216;required-entry&#8217; class from the telephone HTML input</p>
<p>2. Go to your admin panel, and navigate to &#8220;Customers->Attributes->Manage Customer Address Attributes&#8221; and select the &#8216;telephone&#8217; attribute. Update the &#8220;Values Required&#8221; selection to &#8220;No&#8221;.</p>
<p>3. Since Magento has server-side validation on this field as well, you&#8217;ll need to override the Mage_Customer_Model_Address class. Just as you would do any override, create a local module or copy this file into your local folder directory. The only method you need to override is the validate() method. It should look like this (Magento 1.4/Enterprise 1.9):</p>
<pre>
public function validate()
	{
		$errors = array();
		$helper = Mage::helper('customer');
		$this->implodeStreetAddress();
		if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the first name.');
		}

		if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the last name.');
		}

		if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the street.');
		}

		if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the city.');
		}

		//		if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
		//			$errors[] = $helper->__('Please enter the telephone number.');
		//		}

		$_havingOptionalZip = Mage::helper('directory')->getCountriesWithOptionalZip();
		if (!in_array($this->getCountryId(), $_havingOptionalZip) &#038;&#038; !Zend_Validate::is($this->getPostcode(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the zip/postal code.');
		}

		if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the country.');
		}

		if ($this->getCountryModel()->getRegionCollection()->getSize()
		&#038;&#038; !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) {
			$errors[] = $helper->__('Please enter the state/province.');
		}

		if (empty($errors) || $this->getShouldIgnoreValidation()) {
			return true;
		}
		return $errors;
	}
</pre>
<p>With these three pieces in place, you&#8217;ll now be able to remove the telephone from the form (or just make it optional) without Magento throwing a fit. </p>
<p>Let me know if anyone would like additional clarification on this&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/11/removing-telephone-required-validation-on-addresses-in-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Send Template Based / Transactional Emails from Magento</title>
		<link>http://www.brimllc.com/2010/10/send-template-based-transactional-emails-from-magento/</link>
		<comments>http://www.brimllc.com/2010/10/send-template-based-transactional-emails-from-magento/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 16:14:35 +0000</pubDate>
		<dc:creator>bmarck</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=274</guid>
		<description><![CDATA[Very recently, the need arose for us to send out a new, template based email from a custom Magneto module.  A Google search yielded surprising lack of information for this task. Therefore, we documented the process we took to get our module to send out an email based on a template.
Here’s the process…
1.       Create the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Very recently, the need arose for us to send out a new, template based email from a custom Magneto module.  A Google search yielded surprising lack of information for this task. Therefore, we documented the process we took to get our module to send out an email based on a template.</p>
<p>Here’s the process…</p>
<p>1.       Create the HTML Template &#8211; The email template directory is located in app/locale/en_US/template/email  . The key here is that the {{var sample}} is the syntax for adding variables to the email template. If you need more samples you can take a look some of the sample templates there.</p>
<p>sampleEmail.html</p>
<blockquote><p>&lt;style type=&#8221;text/css&#8221;&gt; body { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; } &lt;/style&gt;</p>
<p>&lt;div style=&#8221;font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;&#8221;&gt;</p>
<p style="padding-left: 30px;">&lt;p&gt;Today&#8217;s product of the day is {{var sample}}.  Please visit our store for more details&lt;/p&gt;</p>
<p>&lt;/div&gt;</p></blockquote>
<p>2.       Create XML definitions and references to the HTML Template – The sendTransactional method allows you to pass an integer for the id if you’ve added the template via the admin console and would like to use the core_email_template table. However it’s considered best practice to follow the process we’ve laid out and create your template separately and configure them via XML.</p>
<p>Add your Template definitions to your modules config.xml between the &lt;Global&gt; tags</p>
<blockquote><p>&lt;template&gt;</p>
<p style="padding-left: 30px;">&lt;email&gt;</p>
<p style="padding-left: 60px;">&lt;sample_email translate=<em>&#8220;label&#8221;</em> module=<em>&#8220;sample&#8221;</em>&gt;</p>
<p style="padding-left: 90px;">&lt;label&gt;Sample Email&lt;/label&gt;</p>
<p style="padding-left: 90px;">&lt;file&gt;sampleEmail.html&lt;/file&gt;</p>
<p style="padding-left: 90px;">&lt;type&gt;html&lt;/type&gt;</p>
<p style="padding-left: 60px;">&lt;/sample_email&gt;</p>
<p style="padding-left: 30px;">&lt;/email&gt;</p>
<p>&lt;/template&gt;</p></blockquote>
<p>In the same config.xml file, add to a reference to the template definition right above the closing &lt;/config&gt; tag</p>
<blockquote><p>&lt;default&gt;</p>
<p style="padding-left: 30px;">&lt;sample&gt;</p>
<p style="padding-left: 60px;">&lt;sendemail&gt;</p>
<p style="padding-left: 90px;">&lt;template&gt;sample_email&lt;/template&gt;</p>
<p style="padding-left: 60px;">&lt;/sendemail&gt;</p>
<p style="padding-left: 30px;">&lt;/sample&gt;</p>
<p>&lt;/default&gt;</p></blockquote>
<p>3.       Prep / Call sendTransactional  &#8211; In your controller, you’ll need to prep the data and the model necessary for your email.</p>
<p>First, we need to define a reference to your XML email template</p>
<blockquote><p>const XML_PATH_SAMPLE_EMAIL_TEMPLATE = &#8217;sample/sendemail/template&#8217;;</p></blockquote>
<p>Here’s where we do the heavy lifting. First we set the Design Config on the email template, and then we call sendTransactional. Something not totally obvious, is the sender must be an array that contains both an ‘email’ and ‘name’ unless your email information is setup in the admin console.</p>
<blockquote><p>$storeId = Mage::app()-&gt;getStore()-&gt;getStoreId();</p>
<p>$mailTemplate = Mage::getModel(&#8216;core/email_template&#8217;);</p>
<p>$mailTemplate-&gt;setDesignConfig(array(&#8216;area&#8217;=&gt;&#8217;frontend&#8217;, &#8217;store&#8217;=&gt;$storeId));</p>
<p>$emailId = Mage::getStoreConfig(self::XML_PATH_SAMPLE_EMAIL_TEMPLATE);</p>
<p>$mailTemplate-&gt;sendTransactional(</p>
<p style="padding-left: 30px;">$emailId,</p>
<p style="padding-left: 30px;">array(&#8216;email&#8217;=&gt;&#8217;sample@sample.com&#8217;, &#8216;name&#8217;=&gt;&#8217;Sample Sender&#8217;),</p>
<p style="padding-left: 30px;">$email,</p>
<p style="padding-left: 30px;">$email,</p>
<p style="padding-left: 30px;">array(&#8217;sample&#8217; =&gt; $sample)</p>
<p>);</p></blockquote>
<p>For reference, here’s the sendTransactional method from the core/template model.</p>
<blockquote><p>sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/10/send-template-based-transactional-emails-from-magento/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Broken Magento Banner Rotator &amp; Underscores _ in Design Package Name</title>
		<link>http://www.brimllc.com/2010/10/broken-magento-banner-rotator-underscores-_-in-design-package-name/</link>
		<comments>http://www.brimllc.com/2010/10/broken-magento-banner-rotator-underscores-_-in-design-package-name/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 15:55:41 +0000</pubDate>
		<dc:creator>bmarck</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.brimllc.com/?p=263</guid>
		<description><![CDATA[In a recent project, we had a ticket filed for a seemingly broken Banner Rotator Widget.  The admin console would allow the creation of the Banner Rotator but nothing seemed to be operational.
After a bit of investigation, we noticed that our ‘Design Package/Theme’ (brim_design) was missing (&#8211;Please Select&#8211;) in the New Widget Instance-&#62;Frontend Properties –&#62;Design [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In a recent project, we had a ticket filed for a seemingly broken Banner Rotator Widget.  The admin console would allow the creation of the Banner Rotator but nothing seemed to be operational.</p>
<p>After a bit of investigation, we noticed that our ‘Design Package/Theme’ (brim_design) was missing (<em>&#8211;Please Select&#8211;) </em>in the New Widget Instance-&gt;Frontend Properties –&gt;Design Package Theme. This was occurring even though we we’re available to select it from the select drop down menu (see screenshot). After digging into the controller action for this, we discovered that underscores were being striped off in the action. Therefore, since our design package had an underscore, the Design Package was never being set on the Banner Rotator Widget.</p>
<p><a href="http://www.brimllc.com/wp-content/uploads/2010/10/bannerRotator.jpg" rel="lightbox[263]"><img class="alignnone size-full wp-image-264" title="bannerRotator" src="http://www.brimllc.com/wp-content/uploads/2010/10/bannerRotator.jpg" alt="" width="400" height="141" /></a></p>
<p>A quick fix for this issue was to create a copy of the Design Package (ex: frontend/brim_design) , rename the folder and remove the underscore (ex: frontend/brimdesign), then change the Current Package Name in System-&gt;Configuration-&gt;Design.</p>
<p>It&#8217;s generally recommended that you avoid using underscores in your Design Package names and in other places throughout Magento.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brimllc.com/2010/10/broken-magento-banner-rotator-underscores-_-in-design-package-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

