CMS Guidebook

Show Category Images

The code for the thumbnail URL is:

1 Mage::getBaseUrl('media').'catalog/category/'.$_category->getThumbnail()

Notice the use of Baseurl(‘media’)? This will ensure that media directory is always found. Then the file path always begins in the category directory.

For those of you keeping score, here’s the main category image script:

1 $this->htmlEscape($_category->getImageUrl());

Pretty soon you’ll find yourself able to create subcategory pages of thumbnails and main images with ease.

 


Get Current Category Data on Product Details Page

If you insert this code into your “/catalog/product/list.phtml”, You will be able to access the parent category data on the products details page in Magento.


<?php $_helper = $this--->helper('catalog/output');?>
<?php $_category_detail=Mage::registry('current_category');?>
<!-- Get Category Name -->
<?php $_category_detail--->getName();?>
<!-- Get Category ID -->
<?php $_category_detail--->getId(); ?>



How to call a static block within a phtml file

Use this code snippet to call a static block from within a phtml file in Magento.

echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_left_links')->toHtml()

Use this code snippet to call a phtml from within another phtml file.

echo $this->getLayout()->createBlock('core/template','calendar_block',array('template' => 'path/to/calendar.phtml'))->toHtml();


Display shopping cart properties in magento

Here is the code :
$count = $this->helper('checkout/cart')->getSummaryCount();
//get total items in cart
 
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal();
//get total price
 
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));

So, to explain,
Here you retrieve the amount of items the user has into the cart:
$Qty = $this->helper('checkout/cart')->getSummaryCount();
Here you get the total price of those items:
$quote = Mage::getModel('checkout/session')->getQuote();
$total = $quote->getGrandTotal();
// format total in order to have a user friendly price
$total = $this->helper('checkout')->formatPrice($total);


How to install WordPress on your Godaddy Hosting Account

  1. Log in to your Godaddy Account Manager.
  2. Select Web Hosting.
  3. to the right of the hosting account you want to install WordPress in, click Launch.
  4. Select WordPress from the Popular Apps menu.
  5. Click Install Now!.

    NOTE: The Install Now! button displays only when the selected value application is compatible with one of more hosting plans in your account.

  6. Choose the domain name you want to use.
  7. Enter a database description and password, and then click Next.
  8. Choose an unused installation directory, and then click Next. For example, if you want your WordPress website to display when someone goes to example.com/blog then blog is the installation directory.

    If you want your WordPress website to display when someone goes directly to your domain name, remove any text from this field and leave it empty.

  9. Enter the Admin Name, Admin Password, Email and Blog Title for your WordPress installation.
  10. Click Finish.

How to install WordPress

WordPress is a free blogging tool and a content management system (CMS). It has many features including a plug-in support and a template system. WordPress is currently the most popular blogging system in use on the Web.

Before you install WordPress

Before beginning the install, there are few things you need.

You need access to your site and its directory and software to proceed with the installation. These are:

  • Access to your web server (via shell or FTP)
  • A text editor
  • An FTP Client
  • Your web browser of choice

How to install wordpress

Quick Installation Instructions

  1. Download and extract the WordPress files if you haven’t already.
  2. Create a MySQL database and user who has all privileges for accessing and modifying it.
  3. Rename wp-config-sample.php to wp-config.php
  4. Edit wp-config.php with a text editor and fill in your database details.
  5. Upload the WordPress files in the desired location on your web server
  6. Run the WordPress installation script by accessing wp-admin/install.php in a web browser.
    • If you installed WordPress in the root directory, you should visit: http://example.com/wp-admin/install.php
    • If you installed WordPress in its own sub directory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php
  7. Follow The instructions on wizard