Magento random block generator / block randomiser
This could be pretty useful if you want to combine XML block control with a random content display (eg. banner ads). Very easily achieved, simply create 1 file in ./base/default/template/page/html/random_block.phtml <?php $children = $this->getSortedChildren(); if(is_array($children)) { shuffle($children); echo $this->getChildHtml($children[0]); } ?> Then in your relevant XML file - control the output by using: <block type="core/template" … Continue reading
Take Windows with you ...
... but feel free to come back” HTC dropped by today as expected to give us the world-wind tour of the HTC HD2 Windows Mobile Smartphone. Given I'm a Nokia fanboy, it was a hard sale, but I have to say I was pleasantly impressed. If not a bit iPhone-esque with its pinch zooming … Continue reading
You are invited to see the new HTC HD2 ...
... well, you aren't, but we are! HTC got in touch last week via Kreate Sales Promotion Consultants to offer Sonassi a promotional day to demonstrate the new features of the HTC HD2. We are eagerly waiting for the 30th March to see what the new handset has to offer. We got sent out some … Continue reading
Magento NOCHEX extension faults and fixes
A customer of ours had opted to use Nochex as their payment gateway of choice for their most recent build - so we grabbed an existing extension to facilitate it. However, it seemed the Luxe Nochex extension was buggy (just like the Magento Paypoint gateway we tried). We didn't have time to wait for the … Continue reading
Dependant layered navigation filters in Magento
Although not the best method, we wrote a quick and easy means to remove layered navigation filters that are dependant on other filters being enabled. This code should really be in the block and popped into an extension - with the attributes administrable via the backend, but for the purposes of this tutorial - we … Continue reading
Custom attributes for categories in Magento
Sometimes there is a requirement to have custom attributes for a category, but it isn't that straightforward to add, at least not through the GUI. The method, for a text input, is: 1 Create the new attribute via admin, or via SQL using the following: INSERT INTO `eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, … Continue reading
How to disable WYSIWYG on Magento 1.4
The new WYSIWYG feature is brilliant ... for non-developers, but for the rest of us, Magento popping P tags left right and centre is no fun. It can be easily disabled by going to Admin > System > Configuration > Content Management > WYSIWYG Options
Magento 1.4 Install Errors
We imagine there is going to be a few, but here are the ones we have come across so far: 1 Unsupported operand types ... Hostname.php Solution: Comment out line +471 in ./lib/Zend/Validate/Hostname.php #$regexChars += include($this->_validIdns[strtoupper($this->_tld)]); 2 Invalid mode for clean Solution: Remove ./app/code/core/Zend/Cache/ 3 Invalid argument supplied for foreach ... toolbar.phtml This is due … Continue reading
Quick script to mass enable categories in Magento
Just another easy one if you are looking to enable categories by ID - we usually incorporate this script into our product insertion API, so that it enables a category automatically for a product upon insertion. But it can also be used standalone. This script would be ideal alongside our export Magento category ID script … Continue reading
Mass update stock levels in Magento - FAST
This isn't ground-breaking code, but rather just using some core code in a rather stripped out manner. As we're not big fans of Magento data flow here, we perform most of our stock and catalogue updates using external scripts to Mage::app. We have been trickling elements of these out to the wider world so you … Continue reading