Tuesday, 18 September 2012

Wordpress: plugin error 'unexpected output'

Wordpress: plugin error 'unexpected output'

I had the below error when I installed a Wordpress Plugin for a site I am working on.

The plugin generated 228 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

After having done quite a bit of work on the site already, I decided to see what the problem could be.
If you read the link below it'll give you a comprehensive answer, but my short and sweet version is:
The <?php ?> open or closed tags are missing in the main php file for the plugin.

click here for the original website

Monday, 17 September 2012

Wordpress: qTranslate Dates/Times Wrong

Wordpress: qTranslate Dates/Times Wrong

To sort out this problem go to 'Settings/Language/Advance Settings/' and select 'Use strftime instead of date.'

click here for the original website
click here for another original website link

Wednesday, 8 August 2012

Magento: Special Prices and Promo Codes

Magento: Special Prices and Promo Codes

Ever had the problem where special prices are appearing on products, but you haven't set one up.
This problem is usually because you've setup a promotional code and either set it as inactive, active, or even deleted it, but then missed the step of APPLY CODES, this then applies all the new codes and removes the old ones.

To setup promotional codes, have a look at the link below, but the keypoints are:
  • Conditions set the products that the eligible for the promo
  • Actions are what are applied
  • I usually duplicate the conditions in the actions settings as well.
In order to apply promo codes to specific products you need to change the setting to allowed for the 'use in promo codes' in the attribute settings.

click here for the original website relating to Promocodes

Tuesday, 3 July 2012

Magento: Change Address Layout

Magento: Change Address Layout

In order to change the address layout you need to go to System/Configuration/Customer Config
You should be able to find it and adjust the layout here.

The xml file to edit "app\code\local\Mage\Customer\etc\config.xml" seems to be out dated as I tried making adjustments here, but it didn't seem to work. I have only noted this as reference.

Monday, 11 June 2012

Magento: Recently Viewed Products

Magento: Recently Viewed Products

The recently viewed products that you had working previously have all of a sudden stopped appearing. This problem has hit me several times over the last year and each time I have had to rediscovered the solution. So this time I have decided to blog it so I don't forget.

Problem:
The recently viewed products have disappeared, or they have stopped appearing.

Solution:
This usually happens when you have either added, removed or sometimes even modified a product. The SOLUTION is to re-index all of the indexes. If that doesn't work, then flush all the caches. After that if it still doesn't work, use everyone's good friend Google (there are other search engines available also).

Friday, 18 May 2012

Magento: Create Category List with Images

Magento: Create Category List with Images

The code to create a list of top-level categories along with their images:
<?php $_categories = $this->getStoreCategories() ?>
<?php $count = 0 ?>
<ul id="square-category">
<?php foreach ($_categories as $_category): ?>

<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$immagine = $this->getCurrentCategory()->getThumbnail()
?>

<?php $count = $count+1 ?>
    <li class="Pos<?php echo $count ?>">
        <a href="<?php echo $this->getCategoryUrl($_category) ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
            <img src="/media/catalog/category/<?php echo "$immagine" ?>" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" class="category-img" />
            <span><?php echo $this->htmlEscape($_category->getName()) ?></span>
        </a>
    </li>
<?php endforeach; ?>
</ul>

Magento: Customise the contact form

Magento: Customise the contact form

This is very useful information if you want to modify the magento contact form.

There are several aspects that need to be modified, these include:
  • the .phtml file.
  • the .xml if you want to add extra textual content to the contact page.
  • the email template using the transactional emails in the CMS.
  • adjust the contact form settings in the CMS to use your new template.
Click the link below if you want a more detailed article.

click here for the original website

Thursday, 17 May 2012

Magento: Add phtml file to template

Magento: Add phtml file to template

Use this bit of code:
<block type="core/template" name="footerMenu" template="page/footermenu.phtml"/>
in your XML file.
Then this in your template file if you want to place it:
<?php echo $this->getChildHtml('footerMenu') ?>

Magento: Simple Footer Menu

Magento: Simple Footer Menu

Here is the code that I've used to create the simple text links in the footer.
<?php $helper = $this->helper('catalog/category'); ?>
<?php foreach ($helper->getStoreCategories() as $_category): ?>
    <a href="<?php echo $helper->getCategoryUrl($_category); ?>"><?php echo $this->htmlEscape($_category->getName()); ?></a> |
<?php endforeach ?>

click here for the original website where I grabbed the first part of the code.
click here for the original website that I used to modify the code.

Monday, 5 March 2012

Magento: Change Category View

Magento: Change Category View

To change the category view without having to edit each category individually, use this code in the catalog.xml file to set the page type.


<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
</catalog_category_default>


click here for the original website