Apr 25

Magento 1.4.1.1 Newsletters Won’t Send

Randomly, and I believe this is due to server set up rather than anything else (at provider level, not at reseller level – so you people who have test sites on dedicated boxes might want to look deeper into this and let me know so I can spread the word)… Magento Newsletters just give up on everything.

Now, if, after following all of the Magento posts you’re still stumped. Your cron is working and proven, your newsletters are perfectly crafted, your subscribers list is good, your database is ‘repaired’… There really is only one more thing to try!

Open up cron.php in the root magento directory, and add

echo “ ”;

to the end of it. Simples!

It should just output a blank space, which will force the cron to complete.

From my own quick tests, it seems that some output is required on some servers when dealing with cron in certain situations… but thats as far as I got – busy busy in the office!

Mar 22

Anatomy of Magento’s xml files – Tutorials – Magebase

Anatomy of Magento’s xml files – Tutorials – Magebase.

A nice simple explaination!

Mar 22

Magento Design Exceptions Explained Or How To Serve a Mobile Friendly Magento Theme – Tutorials – Magebase

Magento Design Exceptions Explained Or How To Serve a Mobile Friendly Magento Theme – Tutorials – Magebase.

Useful!

Mar 22

How To Create a jQuery Plugin

http://web.enavu.com has regularly made to it to the front of my reading list – the great thing about smart phones is the ability to read anywhere (except whilst driving, but then you just they the phone to read to you!).

Recently I stumbled across this article, and have to admit – it’s a good one.  I’ve often wondered how to go about creating a plug in but not had time to figure it out!

http://web.enavu.com/js/jquery/how-to-create-a-jquery-plugin/

Go give it a read!!  And I’m looking forward to finding your plug ins online soon!

Jul 06

Adding New Tab to Products Tabs Panel – Magento 1.4.1.1 Modern Theme (etc)

Firstly a little background. Our client has two sets of products which have custom finishes. 7mm Products and 10mm Products. These are grouped in attribute sets called 7mm Finishes (attributesetid == 16) and 10mm Finishes (attributesetid == 18) .

We’ll be creating a tab which only shows if a product belongs to specific attribute set .

First, in our case, we’re going to create 2 Static Blocks.
Static Block Number 1:
Block Title: 7mm Finishes
Identifier: swatch16
Status: Enabled
Content: (your colour swatches or custom info)

Static Block Number 2:
Block Title: 10mm Finishes
Identifier: swatch18
Status: Enabled
Content: (your colour swatches or custom info)

Now… lets make some code!

app/design/frontend/default/theme/template/catalog/product/view/finishes.phtml

<?php
	// We are going to prepend the attribute id with the word swatch
	// This helps us to identify the swatch later (plus,
	// I'm not sure using an attribute ID as a static block name is such a good idea)
	$name="swatch".$this->getProduct()->getAttributeSetId();

	//Did we get this far?
	if(strlen($name)>0){
	// Block Identifier is lowercase and has no spaces
		$newname=strtolower(str_replace(' ',"",$name));
	// Only display swatches for attributesetid 16 and 18
		if (($newname=="swatch16") || ($newname=="swatch18")){
	// Annnnnd output the static block!
			echo $this->getLayout()->createBlock('cms/block')->setBlockId($newname)->toHtml();
		}
	}

app/design/frontend/default/theme/layout/catalog.xml
Look for this section:

<action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>related_products</alias><title>Related Products</title><block>catalog/product_list_related</block><template>catalog/product/list/related.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>

Add the following:

<!-- new tab -->
<action method="addTab" translate="title" module="catalog"><alias>finishes</alias><title>Finishes</title><block>catalog/product_view_finishes</block><template>catalog/product/view/finishes.phtml</template></action>
app/code/local/Mage/Catalog/Block/Product/View/Finishes.php
<?php
class Mage_Catalog_Block_Product_View_Finishes extends Mage_Core_Block_Template
{
    protected $_product = null;

    function getProduct()
    {
        if (!$this->_product) {
            $this->_product = Mage::registry('product');
        }
        return $this->_product;
    }
}

That should be working for you – but adjust your attributeSetId’s accordingly ;)

Jul 06

Police, Crime and 999

I have to be honest, being a father in an area with ridiculously high crime levels and the highest domestic violence level in the country often breeds problems.  In fact, not being a father but still being here would also breed problems but kids complicate things.

The other day their was an incident in which my partner and her oldest daughter had an altercation, the police were called by a third party because of the shouting – I wasn’t home at the time, but when I returned I bumped into a large welsh police officer standing in the kitchen, with a large smile on his face, “We were waiting for you!”

erk!

Well I was needed so the daughter could make a statement because her mother also had to, and we got chatting (he’s a father himself and has as many stories to tell as I do!) and after a lot of chuckling he told me about his new book and website.

As policemen go, he’s one of the nicest I think I ever met, often in situations like these you find the police very uninterested and miffed at the waste of their time – but like I said, this is the domestic violence capital of the universe, they respond in seconds to save lives.

All in all I was impressed and would like to take the opportunity to remind everyone that these police men and women are actually normal everyday people trying to make a difference.  Its hard work and usually thankless too.

Why not pop along to his site, maybe the book will interest you? http://www.policecrime999.com

Jun 23

Create a Module that outputs dynamic content.

I would actually like to call this…

Create a Module that outputs dynamic content.

http://gabrielsomoza.com/magento/generating-dynamic-javascript-for-a-magento-module/trackback/

Jun 23

Magento Connect Downloader (1.4+) Unable to unpack

If you find yourself repeatedly receiving messages like:

ERROR: Unable to unpack /public_html/downloader/pearlib/download/some_awesome_module.tgz

After checking permissions (which should be right to have gotten this far) you could try the fix below.

Read the rest of this entry »

Mar 24

New Magento Design Guide for CE 1.4+

http://www.magentocommerce.com/design_guide

Jan 10

List of Any Categories Sub Categories

We needed to create a drop down select list with a particular sub-category listing within it.

After scouring the forums I fell back to our accordion script to do the job – obviously you would wrap the output in select tags etc – depending how you’d want the nav to work.  (you can use this for other things too)

<?php
 $collection = Mage::getModel('catalog/category')->getCategories(33); // change 33 to your cat id
 $helper     = Mage::helper('catalog/category');
 foreach ($collection as $cat):?>
 <?php if($_category->getIsActive()):?>
 <?php
 $cur_category = Mage::getModel('catalog/category')->load($cat->getId());
 ?>
 <option value="<?php echo $helper->getCategoryUrl($cur_category);?>"><?php echo $cur_category->getName();?></option>
 <?php endif?>
 <?php endforeach;?>
Page 1 of 3123