Magento

Syndicate content

Magento - Add Static Block to CMS Page

Static blocks are a great way to add sections of HTML to your CMS or Catalog pages. I'm going to show you how to add a static block to a CMS page.

It's a 2 step process and a very simple one. First, create your static block by going to CMS->Static Blocks. You will use the identifier of your static block to reference it on the CMS page. Edit the CMS page you would like this block to appear in, and add this code in the location where you would like it to show up:

Blog Image: 
Magento - Add Static Block to CMS Page

4 comments for Magento - Add Static Block to CMS Page

Magento - Get the Total Price of items currently in the Cart

Ever wanted to get the total price of items in your Magento cart? Here you go:

<?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>
Blog Image: 
Magento - Get the Total Price of items currently in the Cart

9 comments for Magento - Get the Total Price of items currently in the Cart

Magento - Contact Form Not Submitting Bug

Since the new release of Magento, people have been encountering a lot of problems. One of them in particular, seem to be the contact form. The error is, "Unable to submit your request. Please, try again later." If you're on Magento 1.4 and get this error when submitting the contact form, that's because your template (theme) is not fully compatible with 1.4. Your Magento theme is overriding the form.phtml file with its own version, which doesn't have the new line in it. Here's what you'll need to do to quickly fix this error:

Blog Image: 
Magento - Contact Form Not Submitting Bug

5 comments for Magento - Contact Form Not Submitting Bug

Magento extensions and modern e-commerce

For an online retailer, choosing an e-commerce software platform is one of the most important decisions. Depending on the size of the business, the key requirements could vary from robustness and scalability critical for large retailers to the need for simplicity and flexibility for small store owners. Perhaps it is the ability to effortlessly meet the diverse needs of disparate audiences that has made Magento one of the fastest growing e-commerce applications globally. Already, the Magento e-commerce suite has carried out over US$25 billion in transactions via the 30,000+ merchants who rely on this platform, including some from the Internet Retailer Top 500 list. No wonder then that the platform continues to receive international acclaim, most recently from well known research organization Forrester Research which highlighted Magento as 'unique' among various e-commerce technology providers.

Blog Image: 
Magento extensions and modern e-commerce

2 comments for Magento extensions and modern e-commerce

Magento - Check if a User is logged in

You may want to check if a user is logged in with Magento, possibly to display a link or promotional item. Here's how to do it:

<?php
if ($this->helper('customer')->isLoggedIn()) {
    echo("Anonymous user");
}
else {
    echo("Authenticated user");
}
?>
Blog Image: 
Magento - Check if a User is logged in

2 comments for Magento - Check if a User is logged in

Magento - How to Display the Product SKU

Magento is a pretty flexible platform. That flexibility comes with a price though; You have to be knowledgeable of the functions that are available to you to utilize. Finding or knowing them is a challenge though. Here is one of those such functions that you may need to display the product Sku on a category page.

Blog Image: 
Magento - How to Display the Product SKU

3 comments for Magento - How to Display the Product SKU

Magento - How to run a SQL query against the database

In order to run a SQL query against the Magento database, you first need a resource model then a database connection.

$db = Mage::getResourceSingleton('core/resource')->getConnection('core_write');
$result = $db->query('SELECT 'entity_id' FROM 'catalog_product_entity');

if(!$result) {
    return FALSE;
}

$rows = $result->fetch(PDO::FETCH_ASSOC);

if(!$rows) {
    return FALSE;
}

print_r($rows);
Blog Image: 
Magento - How to run a SQL query against the database

7 comments for Magento - How to run a SQL query against the database

Magento - Database Repair Tool

The Magento Database Repair Tool compares 2 databases (reference and target), and updates the target database so it has the same structure as the reference database by doing the following:

Blog Image: 
Magento - Database Repair Tool

0 comments for Magento - Database Repair Tool

Magento - Add additional fields to the Contact Form

If you need to add additional fields to Magento's default contact form, read on! First open the form.phtml file located in your /magento_root/app/design/frontend/YOUR_INTERFACE/YOUR_THEME/template/contacts/form.phtml. So, we are going to add a subject field to this contact form so that customers tell us the subject of their email. Open the file for editing in your favorite editor.

Find this section in the file below (this should be around line 39):

Blog Image: 
Magento - Add additional fields to the Contact Form

32 comments for Magento - Add additional fields to the Contact Form

Magento - The best Magento Extensions

Here are some of the best Magento extensions that I've come across.

Blog Image: 
Magento - The best Magento Extensions

26 comments for Magento - The best Magento Extensions