Home Archive

Articles tagged with: Magento How To

22 Oct 22 Oct 2009 1Comment

Many of us who started experimenting with this interface and tried to place various values for Base URL, came to a dead end where Magento breaks.  Usually, we get Internal Server Error 500 with each page load. The problem lies in the fact that we can no longer open the Magento administration to correct the error. What needs to be done in such a scenario?
One of our clients wrote me a message today:
I have put www.mydomain.com in a bad spot. I changed the base URL to {{base_URL}} and now im …

Read More

 
21 Oct 21 Oct 2009 Comments Off

One of the differences between Magento eCommerce platform and lets say WordPress, when looked from developer point of view, is “avoid raw queries” approach. For a web application, Magento is massive system. His database, although not so massive but surely breathtaking with around 220 tables forces you to use “eye candy” EAV model to do even simple things.
For instance, if I were to tell you that I want you to retrieve 5 simple products from database that have price in the range of 200-600USD you would most likely spent 1-4 …

Read More

 
19 Oct 19 Oct 2009 Comments Off

One of the first things that really confused me when i start using Magento is Magento connect. I just started learning things, so i was looking for some plugin examples. I visited Magento connect page with extensions and looked for download button, instead i found “Get extension key” one.
If i recall correctly their What is this? explanation wasn’t the same back then .. or i was just so terrified of Magento at start that i didn’t understand anything at that point I knew i need to paste that key …

Read More

 
17 Oct 17 Oct 2009 1Comment

Does the title sound complicated? Grouped Products display several products on one page.  For example – if you’re selling chef’s knives and you have the same knife in four sizes, you can make a grouped product to display all four sizes.  Customers can select the size(s) they want and add to cart from this page.  Another example would be a themed bedroom set – you can create a grouped product and sell the sheets, comforter, and pillow cases all from the same page.
Technically, we create a simple products and after …

Read More

 
17 Oct 17 Oct 2009 1Comment

Here at Inchoo, we are working on a private project, that should see daylight any time soon. One of the requirements we had is to show product review info on pages independent of product review page. Let’s say you wish to show review info on home page for some of the products. After few weeks with working with Magento, one learns how to use the model stuff directly from view files. Although this might not be the “right” way, it’s most definitely the fastest way (and I doubt most of …

Read More

 
17 Oct 17 Oct 2009 Comments Off

Most of you probably know this, but let’s define what the sitemaps are. Sitemaps are a simple way for site creators to give search engines the information about pages on their site that are available for public. Basically, those are just 1 or more XML files that lists URLs for a site along with additional meta informatio about each URL (like last update, how often it changes, its importance relevant to other pages). With this in mind, search engines can be more clever while crawling the site. Click here see …

Read More

 
16 Oct 16 Oct 2009 1Comment

After many developed CRE Loaded’s online stores and watching Magento development progress for quite some time, I decided it was time to use Magento with my next client. My starting point for development was official Designer’s guide. I’m the type of guy who likes to have documents nice&clean, so I tried to print it but print was a mess. That’s when I decided to create PDF of the official documentation for easy print. This is probably the best starting tutorial for creating a fresh new Magento template.
Download Designer’s Guide to …

Read More

 
16 Oct 16 Oct 2009 Comments Off

Most of you probably know this, but here’s a little code snippet for every Magento beginner that needs page with products on sale listing.
So, easiest way to accomplish that is to follow these steps…
1) Make CMS page called “Products on sale”, or whatever you wanna call it…
2) Put this code:

{{block type="core/template" template="callouts/products_on_sale.phtml"}}

in CMS page you created
3) Make app/design/frontend/default/YOUR_THEME/template/callouts/products_on_sale.phtml
4) Put this code in products_on_sale.phtml

< ?php
$product = Mage::getModel(’catalog/product’);
$collection = $product->getCollection();

foreach ($collection as $product)
{
$result[] = $product->getId();
}

$j = 0;
$product_ = array();
foreach ($result as $_product_id)
{
$in_stock = 0;

$_product = new Mage_Catalog_Model_Product();
$_product->load($_product_id);

#var_dump(get_class_methods(get_class($_product)));exit();
$time = time();
if(strtotime($_product->getSpecialFromDate()) …

Read More

 
15 Oct 15 Oct 2009 1Comment

Adding an Adwords tracking code to order confirmation page in Magento is relatively easy task. One that can be handled under an hour or so if you choose to implement it the proper way. Here is how.
Modify the “app/design/frontend/default/my_custom_theme/layout/checkout.xml” file. Look for section

<checkout_onepage_success>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block name="checkout.success" template="checkout/success.phtml" type="checkout/onepage_success" />
</reference>
</checkout_onepage_success>

And turn it into

<checkout_onepage_success>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block name="checkout.success" template="checkout/success.phtml" type="checkout/onepage_success" />
</reference>
<reference name="before_body_end">
<block name="google_adwords_tracking" template="checkout/google_adwords_tracking.phtml" type="core/template" />
</reference>
</checkout_onepage_success>

Create the “app/design/frontend/default/my_custom_theme/template/checkout/google_adwords_tracking.phtml” file and copy-paste the the Adwords tracking JavaScript code into it.

This code relies on

< ?php echo $this?>getChildHtml(’before_body_end’) ?>

block call from footer of each …

Read More

 
15 Oct 15 Oct 2009 Comments Off

This post describes how Magento navigation works. I hope it will help you.
The begining of all is in template file: “category/navigation/top.phtml”

<ul id="nav">
< ?php
foreach ($this->getStoreCategories() as $_category): ?>
< ?php
echo $this->drawItem($_category);
?>
< ?php endforeach ?>
</ul>

There we call the method from class Mage_Catalog_Block_Navigation $this->getStoreCategories(). This method returns the array $_nodes from object Varien_Data_Tree_Node_Collection.
This array contains objects of Varien_Data_Tree_Node.
Every node is object of Varien_Data_Tree_Node and it is extension from Varien_Object.
Example 1:
If we wish to see how much categories we have, we can do it with method showed below:

< ?php
echo $this->getStoreCategories()->count();
?>

We will get only number …

Read More