<?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>Unchi</title>
	<atom:link href="http://www.unchi.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unchi.co.uk</link>
	<description>Web development stuff, yeah</description>
	<lastBuildDate>Thu, 17 May 2012 18:35:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Absolute Price in Magento Configurable Products</title>
		<link>http://www.unchi.co.uk/2012/05/17/absolute-price-in-magento-configurable-products/</link>
		<comments>http://www.unchi.co.uk/2012/05/17/absolute-price-in-magento-configurable-products/#comments</comments>
		<pubDate>Thu, 17 May 2012 18:30:23 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[price configurable]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1194</guid>
		<description><![CDATA[It took bloody ages to work it out! There will be other (better) ways of doing this, but this is...]]></description>
			<content:encoded><![CDATA[<p><strong>It took bloody ages to work it out!</strong></p>
<p>There will be other (better) ways of doing this, but this is a method I used to get it to work by editing /js/varien/configurable.js</p>
<p>The select options are run from the JS, so even if you edit some php files you will probably have to touch the JS anyway. There was a bit of trial end error in doing this, so instead of working out what finally worked, here is the whole piece of code. A couple of notable parts are the inclusion of:</p>
<p>line 47 | this.base    = config.basePrice;<br />
line 222 | var excl = price ? parseFloat(price + parseFloat(this.base)) : price;</p>
<blockquote><p>/**<br />
* Magento<br />
*<br />
* NOTICE OF LICENSE<br />
*<br />
* This source file is subject to the Academic Free License (AFL 3.0)<br />
* that is bundled with this package in the file LICENSE_AFL.txt.<br />
* It is also available through the world-wide-web at this URL:<br />
* http://opensource.org/licenses/afl-3.0.php<br />
* If you did not receive a copy of the license and are unable to<br />
* obtain it through the world-wide-web, please send an email<br />
* to license@magentocommerce.com so we can send you a copy immediately.<br />
*<br />
* DISCLAIMER<br />
*<br />
* Do not edit or add to this file if you wish to upgrade Magento to newer<br />
* versions in the future. If you wish to customize Magento for your<br />
* needs please refer to http://www.magentocommerce.com for more information.<br />
*<br />
* @category    Varien<br />
* @package     js<br />
* @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)<br />
* @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)<br />
*/<br />
if (typeof Product == &#039;undefined&#039;) {<br />
var Product = {};<br />
}</p>
<p>/**************************** CONFIGURABLE PRODUCT **************************/<br />
Product.Config = Class.create();<br />
Product.Config.prototype = {<br />
initialize: function(config){</p>
<p>this.config     = config;<br />
this.taxConfig  = this.config.taxConfig;<br />
if (config.containerId) {<br />
this.settings   = $$(&#039;#&#039; + config.containerId + &#039; &#039; + &#039;.super-attribute-select&#039;);<br />
} else {<br />
this.settings   = $$(&#039;.super-attribute-select&#039;);<br />
}<br />
this.state      = new Hash();<br />
this.priceTemplate = new Template(this.config.template);<br />
this.prices     = config.prices;<br />
this.base    = config.basePrice;</p>
<p>// Set default values from config<br />
if (config.defaultValues) {<br />
this.values = config.defaultValues;<br />
}</p>
<p>// Overwrite defaults by url<br />
var separatorIndex = window.location.href.indexOf(&#039;#&#039;);<br />
if (separatorIndex != -1) {<br />
var paramsStr = window.location.href.substr(separatorIndex+1);<br />
var urlValues = paramsStr.toQueryParams();<br />
if (!this.values) {<br />
this.values = {};<br />
}<br />
for (var i in urlValues) {<br />
this.values[i] = urlValues[i];<br />
}<br />
}</p>
<p>// Overwrite defaults by inputs values if needed<br />
if (config.inputsInitialized) {<br />
this.values = {};<br />
this.settings.each(function(element) {<br />
if (element.value) {<br />
var attributeId = element.id.replace(/[a-z]*/, &#034;);<br />
this.values[attributeId] = element.value;<br />
}<br />
}.bind(this));<br />
}</p>
<p>// Put events to check select reloads<br />
this.settings.each(function(element){<br />
Event.observe(element, &#039;change&#039;, this.configure.bind(this))<br />
}.bind(this));</p>
<p>// fill state<br />
this.settings.each(function(element){<br />
var attributeId = element.id.replace(/[a-z]*/, &#034;);<br />
if(attributeId &amp;&amp; this.config.attributes[attributeId]) {<br />
element.config = this.config.attributes[attributeId];<br />
element.attributeId = attributeId;<br />
this.state[attributeId] = false;<br />
}<br />
}.bind(this))</p>
<p>// Init settings dropdown<br />
var childSettings = [];<br />
for(var i=this.settings.length-1;i&gt;=0;i&#8211;){<br />
var prevSetting = this.settings[i-1] ? this.settings[i-1] : false;<br />
var nextSetting = this.settings[i+1] ? this.settings[i+1] : false;<br />
if (i == 0){<br />
this.fillSelect(this.settings[i])<br />
} else {<br />
this.settings[i].disabled = true;<br />
}<br />
$(this.settings[i]).childSettings = childSettings.clone();<br />
$(this.settings[i]).prevSetting   = prevSetting;<br />
$(this.settings[i]).nextSetting   = nextSetting;<br />
childSettings.push(this.settings[i]);<br />
}</p>
<p>// Set values to inputs<br />
this.configureForValues();<br />
document.observe(&#034;dom:loaded&#034;, this.configureForValues.bind(this));<br />
},</p>
<p>configureForValues: function () {<br />
if (this.values) {<br />
this.settings.each(function(element){<br />
var attributeId = element.attributeId;<br />
element.value = (typeof(this.values[attributeId]) == &#039;undefined&#039;)? &#034; : this.values[attributeId];<br />
this.configureElement(element);<br />
}.bind(this));<br />
}<br />
},</p>
<p>configure: function(event){<br />
var element = Event.element(event);<br />
this.configureElement(element);<br />
},</p>
<p>configureElement : function(element) {<br />
this.reloadOptionLabels(element);<br />
if(element.value){<br />
this.state[element.config.id] = element.value;<br />
if(element.nextSetting){<br />
element.nextSetting.disabled = false;<br />
this.fillSelect(element.nextSetting);<br />
this.resetChildren(element.nextSetting);<br />
}<br />
}<br />
else {<br />
this.resetChildren(element);<br />
}<br />
this.reloadPrice();<br />
},</p>
<p>reloadOptionLabels: function(element){<br />
var selectedPrice;<br />
if(element.options[element.selectedIndex].config &amp;&amp; !this.config.stablePrices){<br />
selectedPrice = parseFloat(element.options[element.selectedIndex].config.price)<br />
}<br />
else{<br />
selectedPrice = 0;<br />
}<br />
for(var i=0;i&lt;element.options.length;i++){<br />
if(element.options[i].config){<br />
// element.options[i].text = this.getOptionLabel(element.options[i].config, element.options[i].config.price-selectedPrice);<br />
}<br />
}<br />
},</p>
<p>resetChildren : function(element){<br />
if(element.childSettings) {<br />
for(var i=0;i&lt;element.childSettings.length;i++){<br />
element.childSettings[i].selectedIndex = 0;<br />
element.childSettings[i].disabled = true;<br />
if(element.config){<br />
this.state[element.config.id] = false;<br />
}<br />
}<br />
}<br />
},</p>
<p>fillSelect: function(element){<br />
var attributeId = element.id.replace(/[a-z]*/, &#034;);<br />
var options = this.getAttributeOptions(attributeId);<br />
this.clearSelect(element);<br />
element.options[0] = new Option(this.config.chooseText, &#034;);</p>
<p>var prevConfig = false;<br />
if(element.prevSetting){<br />
prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];<br />
}</p>
<p>if(options) {<br />
var index = 1;<br />
for(var i=0;i&lt;options.length;i++){<br />
var allowedProducts = [];<br />
if(prevConfig) {<br />
for(var j=0;j&lt;options[i].products.length;j++){<br />
if(prevConfig.config.allowedProducts<br />
&amp;&amp; prevConfig.config.allowedProducts.indexOf(options[i].products[j])&gt;-1){<br />
allowedProducts.push(options[i].products[j]);<br />
}<br />
}<br />
} else {<br />
allowedProducts = options[i].products.clone();<br />
}</p>
<p>if(allowedProducts.size()&gt;0){<br />
options[i].allowedProducts = allowedProducts;</p>
<p>element.options[index] = new Option(this.getOptionLabel(options[i], options[i].price), options[i].id);<br />
if (typeof options[i].price != &#039;undefined&#039;) {<br />
element.options[index].setAttribute(&#039;price&#039;, options[i].price);<br />
}<br />
element.options[index].config = options[i];<br />
index++;<br />
}<br />
}<br />
}<br />
},</p>
<p>getOptionLabel: function(option, price){<br />
var price = parseFloat(price);<br />
if (this.taxConfig.includeTax) {<br />
var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;<br />
var excl = price &#8211; tax;<br />
var incl = excl*(1+(this.taxConfig.currentTax/100));<br />
} else {<br />
var tax = price * (this.taxConfig.currentTax / 100);<br />
var excl = price ? parseFloat(price + parseFloat(this.base)) : price;<br />
// alert(this.base);<br />
var incl = excl + tax;<br />
}</p>
<p>if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {<br />
price = incl;<br />
} else {<br />
price = excl;<br />
}</p>
<p>var str = option.label;<br />
if(price){<br />
if (this.taxConfig.showBothPrices) {<br />
str+= &#039; &#039; + this.formatPrice(excl, true) + &#039; (&#039; + this.formatPrice(price, true) + &#039; &#039; + this.taxConfig.inclTaxTitle + &#039;)&#039;;<br />
} else {<br />
str+= &#039; &#039; + this.formatPrice(price, true);<br />
}<br />
}<br />
return str;<br />
},</p>
<p>formatPrice: function(price, showSign){<br />
var str = &#034;;<br />
price = parseFloat(price);<br />
if(showSign){<br />
if(price&lt;0){<br />
//str+= &#039;-&#039;;<br />
// price = -price;<br />
}<br />
else{<br />
//str+= &#039;+&#039;;<br />
}<br />
}</p>
<p>var roundedPrice = (Math.round(price*100)/100).toString();</p>
<p>if (this.prices &amp;&amp; this.prices[roundedPrice]) {<br />
str+= this.prices[roundedPrice];<br />
}<br />
else {<br />
str+= this.priceTemplate.evaluate({price:price.toFixed(2)}); // THIS LINE NEES TO BE EDITED<br />
}<br />
return str;<br />
},</p>
<p>clearSelect: function(element){<br />
for(var i=element.options.length-1;i&gt;=0;i&#8211;){<br />
element.remove(i);<br />
}<br />
},</p>
<p>getAttributeOptions: function(attributeId){<br />
if(this.config.attributes[attributeId]){<br />
return this.config.attributes[attributeId].options;<br />
}<br />
},</p>
<p>reloadPrice: function(){<br />
if (this.config.disablePriceReload) {<br />
return;<br />
}<br />
var price    = 0;<br />
var oldPrice = 0;<br />
for(var i=this.settings.length-1;i&gt;=0;i&#8211;){<br />
var selected = this.settings[i].options[this.settings[i].selectedIndex];<br />
if(selected.config){<br />
price    += parseFloat(selected.config.price);<br />
oldPrice += parseFloat(selected.config.oldPrice);<br />
}<br />
}</p>
<p>optionsPrice.changePrice(&#039;config&#039;, {&#039;price&#039;: price, &#039;oldPrice&#039;: oldPrice});<br />
optionsPrice.reload();</p>
<p>return price;</p>
<p>if($(&#039;product-price-&#039;+this.config.productId)){<br />
$(&#039;product-price-&#039;+this.config.productId).innerHTML = price;<br />
}<br />
this.reloadOldPrice();<br />
},</p>
<p>reloadOldPrice: function(){<br />
if (this.config.disablePriceReload) {<br />
return;<br />
}<br />
if ($(&#039;old-price-&#039;+this.config.productId)) {</p>
<p>var price = parseFloat(this.config.oldPrice);<br />
for(var i=this.settings.length-1;i&gt;=0;i&#8211;){<br />
var selected = this.settings[i].options[this.settings[i].selectedIndex];<br />
if(selected.config){<br />
price+= parseFloat(selected.config.price);<br />
}<br />
}<br />
if (price &lt; 0)<br />
price = 0;<br />
price = this.formatPrice(price);</p>
<p>if($(&#039;old-price-&#039;+this.config.productId)){<br />
$(&#039;old-price-&#039;+this.config.productId).innerHTML = price;<br />
}</p>
<p>}<br />
}<br />
}</p></blockquote>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Absolute Price in Magento Configurable Products" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Absolute+Price+in+Magento+Configurable+Products" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/05/17/absolute-price-in-magento-configurable-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Magic Quotes using PHP</title>
		<link>http://www.unchi.co.uk/2012/05/08/removing-magic-quotes-using-php/</link>
		<comments>http://www.unchi.co.uk/2012/05/08/removing-magic-quotes-using-php/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:21:20 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[magicquotes]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1189</guid>
		<description><![CDATA[I have just had a problem with Magic Quotes on an install of our Engage embedded chat system and .htaccess...]]></description>
			<content:encoded><![CDATA[<p>I have just had a problem with Magic Quotes on an install of our <a title="Embedded Web Chat" href="http://www.jerram.co.uk/integrated-marketing-tools-berkshire/engage/">Engage embedded chat system</a> and .htaccess wasn&#039;t working, not sure why. The solution was to add this at the top of the php scripts:</p>
<blockquote><p>if (get_magic_quotes_gpc()) {<br />
function magicQuotes_awStripslashes(&amp;$value, $key) {$value = stripslashes($value);}<br />
$gpc = array(&amp;$_GET, &amp;$_POST, &amp;$_COOKIE, &amp;$_REQUEST);<br />
array_walk_recursive($gpc, &#039;magicQuotes_awStripslashes&#039;);<br />
}</p></blockquote>
<p>I have come across <a title="Disabling Magic Quotes in php on GoDaddy" href="http://www.unchi.co.uk/2011/06/09/disabling-magic-quotes-in-php-on-godaddy/">Magic Quotes on a GoDaddy server</a> too.</p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Removing Magic Quotes using PHP" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Removing+Magic+Quotes+using+PHP" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/05/08/removing-magic-quotes-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Setting up terms and conditions at checkout</title>
		<link>http://www.unchi.co.uk/2012/04/18/magento-setting-up-terms-and-conditions-at-checkout/</link>
		<comments>http://www.unchi.co.uk/2012/04/18/magento-setting-up-terms-and-conditions-at-checkout/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 12:03:55 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[agree]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[terms]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1185</guid>
		<description><![CDATA[If you want customers in your Magento Go store to acknowledge special terms or conditions before purchasing products, you can...]]></description>
			<content:encoded><![CDATA[<p>If you want customers in your Magento Go store to acknowledge  special terms or conditions before purchasing products, you can enable a  Terms and Conditions checkbox that they must check before completing  checkout. The Terms and Conditions message and checkbox is positioned  between the Totals section and the Place Order button, and appears  during Order Review. The transaction cannot be finalized unless the  customer agrees to the conditions of the sale by selecting the Terms and  Conditions checkbox.</p>
<p>Setting up Terms and Conditions for your Magento Go store is a two-step process:</p>
<p>Step 1: Enable Terms and Conditions in your store&#039;s checkout process<br />
Step 2: Create a Terms and Conditions checkbox</p>
<h3>Step 1: Enable Terms and Conditions in your store&#039;s checkout process</h3>
<ol>
<li>From the Admin panel, select <strong>System</strong> &gt; <strong>Configuration</strong>.</li>
<li>From the Configuration panel on the left, under Sales, select the <strong>Checkout</strong> tab.</li>
<li>If necessary, click to expand the <strong>Checkout Options</strong> section.</li>
</ol>
<ol>
<li>Make sure that <strong>Enable Onepage Checkout</strong> is set to <strong>Yes</strong>.<strong> <em>NOTE:</em></strong><em> To enable Terms and  Conditions, Onepage Checkout must be enabled. If Onepage Checkout is  disabled, the Terms and Conditions will not appear during checkout.</em></li>
<li>To display a checkbox that describes your store&#039;s terms and conditions during checkout, set <strong>Enable Terms and Conditions</strong> to <strong>Yes</strong>.</li>
<li>Click the <strong>Save Config</strong> button.</li>
</ol>
<h3>Step 2: Create a Terms and Conditions checkbox</h3>
<ol>
<li>From the Admin panel, select <strong>Sales</strong> &gt; <strong>Terms and Conditions</strong>.</li>
<li>To add new terms and conditions, click the <strong>Add New</strong> button.</li>
</ol>
<ol>
<li>Complete the following information:
<ol>
<li>Enter a <strong>Condition Name</strong> for this condition.</li>
<li>To make your Terms and Conditions checkbox appear during customer checkout, set <strong>Status</strong> to <strong>Enabled</strong>.</li>
<li>Select whether you want your Terms and Conditions Document to appear as <strong>Text</strong> or <strong>HTML</strong>.  If you want to use bold or underline or other formatting in the  document, you can use HTML tags to achieve that formatting. To use HTML  tags, set <strong>Show Content as</strong> to <strong>HTML</strong>.</li>
</ol>
</li>
<li><span style="text-decoration: line-through;">Identify the <strong>Store View</strong> where the Terms and Conditions will appear.</span></li>
<li>Enter the <strong>Checkbox Text</strong> that you want to appear  with the checkbox. For example, you could use &#034;I understand and accept  these terms and conditions&#034; or &#034;Accept&#034; or whatever specific terms and  conditions you want your customers to acknowledge.</li>
<li>In the <strong>Content</strong> field, enter text to describe the terms and conditions of the sale.</li>
<li>Optional: You can set <strong>Content Height (css)</strong> in  pixels to determine the height of the text box that contains the terms  and conditions content. For example, if you want the text box to be one  inch high, enter the equivalent value in pixels.</li>
<li>When finished, click the <strong>Save Condition</strong> button.</li>
</ol>
<p>This is where it should appear: <a href="http://www.magentocommerce.com/?ACT=25&amp;fid=15&amp;aid=2510_7qDQzLGlaE63HmBffgiz&amp;board_id=1" target="_blank">http://www.magentocommerce.com/?ACT=25&amp;fid=15&amp;aid=2510_7qDQzLGlaE63HmBffgiz&amp;board_id=1</a></p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Magento: Setting up terms and conditions at checkout" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Magento:+Setting+up+terms+and+conditions+at+checkout" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/04/18/magento-setting-up-terms-and-conditions-at-checkout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MODx: Create new resource here doesn&#039;t use default template</title>
		<link>http://www.unchi.co.uk/2012/04/18/modx-create-new-resource-here-doesnt-use-default-template/</link>
		<comments>http://www.unchi.co.uk/2012/04/18/modx-create-new-resource-here-doesnt-use-default-template/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 09:10:21 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[MODx]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1181</guid>
		<description><![CDATA[In MODx Evolution, when right-clicking a resources to &#039;Create resource here&#039; it doesn&#039;t use the default template setup up in...]]></description>
			<content:encoded><![CDATA[<p>In MODx Evolution, when right-clicking a resources to &#039;Create resource here&#039; it doesn&#039;t use the default template setup up in the configuration. I though there was a bug, but it&#039;s a feature called <strong>Inherit Parent Template</strong> &#8211; which does exactly what it says. Disable this plugin to get the default template to load.</p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for MODx: Create new resource here doesn't use default template" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+MODx:+Create+new+resource+here+doesn't+use+default+template" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/04/18/modx-create-new-resource-here-doesnt-use-default-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Decimals from Magento Filter</title>
		<link>http://www.unchi.co.uk/2012/03/24/removing-decimals-from-magento-filter/</link>
		<comments>http://www.unchi.co.uk/2012/03/24/removing-decimals-from-magento-filter/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 21:04:38 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[currency]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[price]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1177</guid>
		<description><![CDATA[Copy this file from core to local: /app/code/local/Mage/Catalog/Model/Layer/Filter/Price.php The find line 60 and change the following lines from: $fromPrice  =...]]></description>
			<content:encoded><![CDATA[<p>Copy this file from core to local:</p>
<blockquote><p>/app/code/<strong>local</strong>/Mage/Catalog/Model/Layer/Filter/Price.php</p></blockquote>
<p>The find line 60 and change the following lines from:</p>
<blockquote><p>$fromPrice  = $store-&gt;formatPrice(($value-1)*$range);<br />
$toPrice    = $store-&gt;formatPrice($value*$range);</p></blockquote>
<p>to</p>
<blockquote><p>$fromPrice  = Mage::app()-&gt;getLocale()-&gt;currency(Mage::app()-&gt;getStore()-&gt;getCurrentCurrencyCode())-&gt;getSymbol().($value-1)*$range;<br />
$toPrice    = Mage::app()-&gt;getLocale()-&gt;currency(Mage::app()-&gt;getStore()-&gt;getCurrentCurrencyCode())-&gt;getSymbol().($value*$range);</p></blockquote>
<p>This will remove the decimals and makes sure it keeps the currency symbol using this:</p>
<blockquote><p>Mage::app()-&gt;getLocale()-&gt;currency(Mage::app()-&gt;getStore()-&gt;getCurrentCurrencyCode())-&gt;getSymbol()</p></blockquote>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Removing Decimals from Magento Filter" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Removing+Decimals+from+Magento+Filter" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/03/24/removing-decimals-from-magento-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show a Particular Attribute on a Product Page in Magento</title>
		<link>http://www.unchi.co.uk/2012/03/15/show-a-particular-attribute-on-a-product-page-in-magento/</link>
		<comments>http://www.unchi.co.uk/2012/03/15/show-a-particular-attribute-on-a-product-page-in-magento/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 12:25:45 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1174</guid>
		<description><![CDATA[In Magento, to display a attribute (standard or custom) add this code to the product view page: &#60;?php echo $_product-&#62;getResource()-&#62;getAttribute(&#039;sizing&#039;)-&#62;getFrontend()-&#62;getValue($_product);...]]></description>
			<content:encoded><![CDATA[<p>In Magento, to display a attribute (standard or custom) add this code to the product view page:</p>
<blockquote><p>&lt;?php echo $_product-&gt;getResource()-&gt;getAttribute(&#039;sizing&#039;)-&gt;getFrontend()-&gt;getValue($_product); ?&gt;</p></blockquote>
<p>This example will display &#039;sizing&#039;.</p>
<p><em>Ps. When making the attribute for this purpose you should keep all the frontend properties to know, otherwise it will appear twice on the page. If it&#039;s to be a WYSIWYG editor say yes here &#8211; even-though it isn&#039;t frontend. When creating something like this which is core to the products information it&#039;s a good ideas to put it under the General section</em> (in attribute sets).</p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Show a Particular Attribute on a Product Page in Magento" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Show+a+Particular+Attribute+on+a+Product+Page+in+Magento" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/03/15/show-a-particular-attribute-on-a-product-page-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying and Changing a SKU on a Magento Product Page</title>
		<link>http://www.unchi.co.uk/2012/03/14/displaying-and-changing-a-sku-on-a-magento-product-page/</link>
		<comments>http://www.unchi.co.uk/2012/03/14/displaying-and-changing-a-sku-on-a-magento-product-page/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 13:45:25 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[product]]></category>
		<category><![CDATA[sku]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1171</guid>
		<description><![CDATA[When using configurable product structure how do you display a SKU? The Configurable product one doesn&#039;t work as it is...]]></description>
			<content:encoded><![CDATA[<p>When using configurable product structure how do you display a SKU? The Configurable product one doesn&#039;t work as it is made up just to get it into the system &#8211; you can&#039;t show just one as the other options won&#039;t have a visible SKU. You need to have it change when the select changes. This works when there is one dropdown, I haven&#039;t tried it when there are more yet.</p>
<p>Ps. It uses basic JS and JQuery &#8211; it can probably be easily adapted for other frameworks.</p>
<p>In you product view page you just need to add this somewhere (below the title):</p>
<blockquote><p>&lt;div id=&#034;productcode&#034;&gt;&lt;/div&gt;</p></blockquote>
<p>In /app/design/frontend/default/YOUR DESIGN/template/catalog/product/view/type/options/configurable.phtml add this:</p>
<blockquote><p>&lt;?php<br />
$conf = Mage::getModel(&#039;catalog/product_type_configurable&#039;)-&gt;setProduct($_product);<br />
$col = $conf-&gt;getUsedProductCollection()-&gt;addAttributeToSelect(&#039;*&#039;)-&gt;addFilterByRequiredOptions();<br />
?&gt;<br />
&lt;script type=&#034;text/javascript&#034;&gt;</p>
<p>var Skus =new Array();</p>
<p>&lt;?php<br />
$count = 1;<br />
$itemId = array();<br />
foreach($col as $simple_product){<br />
$itemId[] = array($simple_product-&gt;getSelectLabel() =&gt; $simple_product-&gt;getSku());<br />
}</p>
<p>foreach($itemId as $val){<br />
foreach($val as $k =&gt; $v){<br />
echo &#039;Skus['.$count.'] = &#034;&#039;.$v.&#039;&#034;;&#039;. &#034;\n&#034;;<br />
$count++;<br />
}<br />
};</p>
<p>?&gt;</p>
<p>$j(document).ready(function(){</p>
<p>$j(&#034;#productcode&#034;).html(&#034;Product Code: &#034; +Skus[1]);</p>
<p>$j(&#034;select#attribute&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt;&#034;).change(function(){<br />
var position = $j(&#034;#attribute&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt; option&#034;).index($j(&#034;#attribute&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt; option:selected&#034;));</p>
<p>$j(&#034;#productcode&#034;).html(Skus[position] ? &#034;Product Code: &#034; +Skus[position] : &#034;Product Code: &#034; +Skus[1]);<br />
});</p>
<p>});</p>
<p>&lt;/script&gt;</p></blockquote>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Displaying and Changing a SKU on a Magento Product Page" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Displaying+and+Changing+a+SKU+on+a+Magento+Product+Page" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/03/14/displaying-and-changing-a-sku-on-a-magento-product-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set Default Quantity to 1 in Magento</title>
		<link>http://www.unchi.co.uk/2012/03/07/set-default-quantity-to-1-in-magento/</link>
		<comments>http://www.unchi.co.uk/2012/03/07/set-default-quantity-to-1-in-magento/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 18:54:27 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1165</guid>
		<description><![CDATA[By default, the quantity box on the product page is always blank and that is not very user friendly. It...]]></description>
			<content:encoded><![CDATA[<div>By default, the quantity box on the product page is always blank and  that is not very user friendly. It would be great if the box would be  set to &#034;1&#034; by default .</div>
<p>Now this can be done without any programming &#8211; only through configuration changes in the backend as follows:</p>
<ol>
<li>Go to <strong>Admin Panel -&gt; System -&gt; Configuration -&gt; Inventory-&gt; Product Stock Options</strong> from the Menu</li>
<li>Click on <strong>Add Minimum Qty</strong> button (next to <em>Minimum Qty Allowed in Shopping Cart</em> option)</li>
<li>Choose <strong>Customer Group: ALL GROUPS</strong> as you want this to be applied to all users</li>
<li>Enter <strong>1</strong> for <strong><em>Minimum Qty</em></strong></li>
<li>Save Config</li>
</ol>
<p>Copied from: <a href="http://www.commonitman.com/2011/02/set-default-quantity-to-1-in-magento.html" target="_blank">http://www.commonitman.com/2011/02/set-default-quantity-to-1-in-magento.html</a></p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Set Default Quantity to 1 in Magento" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Set+Default+Quantity+to+1+in+Magento" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/03/07/set-default-quantity-to-1-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing Paste Clean-up in TinyMCE (All Installations and MODx Evolution)</title>
		<link>http://www.unchi.co.uk/2012/02/20/forcing-paste-clean-up-in-tinymce-all-installations-and-modx-evolution/</link>
		<comments>http://www.unchi.co.uk/2012/02/20/forcing-paste-clean-up-in-tinymce-all-installations-and-modx-evolution/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 10:57:50 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[MODx]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[tinymce]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1162</guid>
		<description><![CDATA[Sometimes when using the TinyMCE WYSIWYG clients will paste copy from Word but fail to use the paste from Word...]]></description>
			<content:encoded><![CDATA[<p>Sometimes when using the TinyMCE WYSIWYG clients will paste copy from Word but fail to use the paste from Word options. It is possible to force their hand buy adding this options:</p>
<blockquote><p>paste_auto_cleanup_on_paste : true,<br />
paste_remove_styles: true,<br />
paste_remove_styles_if_webkit: true,<br />
paste_strip_class_attributes: true,</p></blockquote>
<p>In MODx Evolution you can add this in the following way in Elements &gt; Manage Elements &gt; Plugins &gt; TinyMCE &gt; Configuration add this:</p>
<blockquote><p>&amp;paste_auto_cleanup_on_paste=true;<br />
&amp;paste_remove_styles=true;<br />
&amp;paste_remove_styles_if_webkit=true;<br />
&amp;paste_strip_class_attributes=true;</p></blockquote>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Forcing Paste Clean-up in TinyMCE (All Installations and MODx Evolution)" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Forcing+Paste+Clean-up+in+TinyMCE+(All+Installations+and+MODx+Evolution)" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/02/20/forcing-paste-clean-up-in-tinymce-all-installations-and-modx-evolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieving Missing Link List in MODx Evolution</title>
		<link>http://www.unchi.co.uk/2012/02/20/retrieving-missing-link-list-in-modx-evolution/</link>
		<comments>http://www.unchi.co.uk/2012/02/20/retrieving-missing-link-list-in-modx-evolution/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 10:13:20 +0000</pubDate>
		<dc:creator>Keiron</dc:creator>
				<category><![CDATA[MODx]]></category>
		<category><![CDATA[missinglink]]></category>
		<category><![CDATA[tinymce]]></category>

		<guid isPermaLink="false">http://www.unchi.co.uk/?p=1158</guid>
		<description><![CDATA[It seems it is a cache issue, what seemed to fix it was: Tools &#62; Configuration &#62; Interface and Features...]]></description>
			<content:encoded><![CDATA[<p>It seems it is a cache issue, what seemed to fix it was:</p>
<p>Tools &gt; Configuration &gt; Interface and Features &gt; Editor to Use &gt; TinyMCE<br />
Tools &gt; Configuration &gt; Interface and Features &gt; Theme &gt; Custom</p>
<p>Then, under user accounts I did the same:</p>
<p>Security &gt; Manager Users &gt; {username} &gt; User &gt; Editor to Use &gt; TinyMCE<br />
Security &gt; Manager Users &gt; {username} &gt; User &gt; Theme &gt; Custom</p>
<p>Clear cache, logout, restart browser.</p>
<p>Shouldn&#039;t need to do this again, it should be a permanent fix. It will be worth updating the account settings for any user created.</p>
<div class="coffee"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="keiron@jerram.co.uk" /><input type="hidden" name="return" value="" /><input type="hidden" name="item_name" value="Buy me a coffee for Retrieving Missing Link List in MODx Evolution" /><input type="hidden" name="currency_code" value="GBP" /><input type="hidden" name="amount" value="" /><input type="image" src="http://www.unchi.co.uk/wp-content/plugins/buy-me-beer/icon_cafe.png" align="left" alt="Like this? Maybe you could buy me a coffee" title="Like this? Maybe you could buy me a coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=keiron@jerram.co.uk&amp;currency_code=GBP&amp;amount=&amp;return=&amp;item_name=Buy+me+a+coffee+for+Retrieving+Missing+Link+List+in+MODx+Evolution" target="paypal"><strong>Like this?</strong> Maybe you could buy me a coffee.</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.unchi.co.uk/2012/02/20/retrieving-missing-link-list-in-modx-evolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

