Magento – Adding external product link for all your products

This tutorial is all about add an external link, either it is a Amazon product link, demo link, or any external link. This script is what you need for your magento. Within this page, you will find the step by step screenshot of creating your own attribute/set, and calling those attribute from your own template.

First you will need to create all the attribute / attribute set for your products. Below is an example of creating an external product links.

Here’s something I had created for my template selling site. Continue Reading »

Add custom layout in CMS page

You may design some nice templates and layouts for your Magento shopping cart, but you cannot choose these layouts in CMS.

You can add the following XML codes in “global” section in either one of config.xml in any module, but I suggest you to create a new custom module to change it.

For example, if you’ve added a new layout named “Two-Column Right Column Full Layout Pages” in “page.xml”:

<layout>
      ...
      <page_two_columns_right_full translate="label">
            <label>Two-Column Right Column Full Layout Pages</label>
            <reference name="root">
                  <action method="setTemplate"><template>page/2columns-right-full.phtml</template></action>
                  <!-- Mark root page block that template is applied -->
                  <action method="setIsHandle"><applied>1</applied></action>
            </reference>
      </page_two_columns_right_full>
      ...
</layout>

Then in the config.xml in a new custom module or a existing module:

<global>
      ...
      <page>
            <layouts>
                  <two_columns_right_full module="page" translate="label">
                        <label>Two-Column Right Column Full Layout Pages</label>
                        <template>page/2columns-right-full.phtml</template>
                        <layout_handle>page_two_columns_right_full</layout_handle>
                  </two_columns_right_full>
            </layouts>
      </page>
      ...
</global>

Then in your backend CMS page, you should be able to choose this new layout.

Happy Magento’ing ~

Re-run module’s setup routines in Magento

When you’re implementing custom module, normally you will have to re-run setup routines. Some people will create newer version of the setup file, but it will make you confuse after 100 modification. To do it, simply remove references to your modules in “core_resource” table and then, in backend, go to ‘System’ -> ‘Configuration’ -> ‘Advanced’ in Advanced Section, click ‘Save Config’. Magento will run all your setup scripts again.

Happy Magento’ing ~

“Could not determine temp directory, please specify a cache_dir manually” after Magento is installed

After Magento is installed, you may have the error “Could not determine temp directory, please specify a cache_dir manually” when clicking on some pages in both backend and frontend. Usually it will be happened in shared web hosting, but also in individual server if the permission of tmp folder set wrong.

Many bloggers suggested to modify the core file “/lib/Zend/Cache/Backend/File.php” to fix this problem. However, it may be a trap when you upgrade your Magento. I recommend to use Magento’s override feature.
Continue Reading »

Magento – Change $0.00 price to show FREE – Hid the price for all your free product

I am currently setting up a store for DesignerSandbox, which I would like to put all the virtual tuts and product within that store. But the current magento doesn’t have the way to mark $0.00 and change it to FREE.

So This is a very simple script to help you change the price $0.00 to ‘FREE’
This is very simple to change, simply open the file located here
/app/design/forntend/default/YOURTHEME/template/catalog/product/view.phtml
Within this file look for following script.
Continue Reading »