Magento: Display Static Block via Custom Layout Update

Share
Posted on April 21st, 2011 | Posted by admin

We were needing to display a static block in the left column (of the 2-columns-left template). We only needed to display it for a few specific products though. There are a couple ways you can do it via Custom Layout Updates. In our case, the products were all in a specific category, and we wanted the static block to show up on the list view AND the product view. So, we put this code in on the product level and the category level:

<reference name="left">
    <block type="cms/block" name="static_block_identifier" before="-">
        <action method="setBlockId"><block_id>static_block_identifier</block_id></action>
    </block>
</reference>

How to add “View All” button in Magento’s pagination

Share
Posted on April 21st, 2011 | Posted by admin

Hi, I had a bit of unusual request from a client and I had to create “View All” button and put it into Magento’s pagination on category listings, so I decided to share the trick. ;)

So, since this is a very specific task, I believe that no further explanation is needed. And now, lets begin.

First of all, we need to trace the “pager.phtml” file in our working template directory. When you do, all that needs to be added is the following code somewhere to fit your needs:

Working with multiple PHP frameworks – The best practice

Share
Posted on April 21st, 2011 | Posted by admin

Hi, first of all, I’d like to explain the title of this post. I won’t go into depths of complicated examples, but rather explain the logic of it.

PHP first implemented OOP (Object Orientated Programming) the right way in version 5. OOP is powerful tool in any programming language. But the next logic step was to create framework as an “abstract layer” that will help developers in both speed and quality of their work. To conclude this brief introduction, I’ll say that there are many frameworks written in PHP for PHP. :D

Now to the fun part. For example I’ll use Magentos framework, that is written over Zend framework. To make stuff just a little bit more complicated. Zend framework is written on top of PHP’s built in functions.

Now, if you are a Magento developer (like we are :D ), you need to work by rules, or there will be problems with your Magento modules, extensions, etc. I promise. The problem is if you, lets say, use Zend framework directly in Magento module, which you can (Magento is its “extenstion”, which allows you to call parent methods). Why, you ask me? Well, to answer that, I will ask you a question. What will happen if you upgrade Magento to latest version which excluded some Zend framework functionality from its libraries?

How to make configurable options autoselected on Product view page

Share
Posted on April 21st, 2011 | Posted by admin

If you ever tried to do anything with Magento configurable products view page, most likely you needed changes in  /js/varien/product.js in case you wanted to manipulate dropdowns.

This will be one of the ways to do it.

Basically, what we need to do in order to make initial selection of a product is the following:

Standard procedure to upgrade Magento to the newest version

Share
Posted on April 20th, 2011 | Posted by admin

I can’t give you exact recipe how to upgrade your specific Magento installation, but I’ll try to explain my standard procedure when getting Magento up to date.

1) Know what are you facing with:

Check google if there is something special about upgrading your specific version of Magento to the newest one.
If nothing else, you will be prepared with issues that you will need to solve.

2) Backup your files

We usually do it from CLI like this:
tar -cvvzf your_site_directory.tar.gz your_site_directory/ 2>error.log

Page 6 of 16« First...«45678»10...Last »