Magento 1


How to activate/deactivate Magento module per a website level

How to activate/deactivate Magento module per a website level

First off let me just clearly say that I am not talking about just activating/deactivating a module output per a website level. Module output merely disables toHtml() method that certain module block class implements. In this article I am talking about fully deactivating the module like when we open the modules config xml file and place <active>true</active>.

Read more

Importance of product presentation

Importance of product presentation

We all now that image is everything, especially when you’re selling the product online. There are some obvious facts that need to be taken into concern. This post will include some (IMHO) valuable reminders and a checklist for the shop owners willing to reevaluate their product presentation.

Also, let’s remind ourselves that eCommerce product photography is probably one of the most important steps in “optimizing” the performance of your eCommerce online store.

Read more

Custom email server (transport) with Magento

Custom email server (transport) with Magento

Magento has quite interesting email sending capabilities. However, those are more in terms of email templates then selecting a non-built in email server. Sometimes, your web hosting might have separate mail server and even the simple php send mail does not work. In such cases you are forced to use an external mail server that supports SMTP. Good example of this is a Gmail.

Read more

Properly remove white image frame upon resizing photos in Magento

Properly remove white image frame upon resizing photos in Magento

Magento has pretty neat image helper you can use to output your product photos. Today one of my coworkers got frustrated with the white frame he kept getting around the resized image he tried to output in sidebar block. As s possible solution he tried resolving the issue with CSS. However, there is a better, more nicer solution to ditch the whit frame around resized images in Magento.

Read more

Inline translation in Magento

Inline translation in Magento

If you need translations for your site but translation packs are not fully translated, then inline translation is very nice feature.
In this post I will cover entire process for inline translation in Magento.

Read more

How to create a new product type in Magento

How to create a new product type in Magento

Magento comes packed with several product types: simple, grouped, configurable, virtual, bundle, downloadable. Sometimes clients request can reach beyond any of these built in product types functionality. In such cases, usual way of handling things is throwing some new attributes and hooking into some events from which you can handle and “re-route” certain logic.

Read more

Creating cron script in Magento

Creating cron script in Magento

Creating Magento cron script is very simple thing. First of all we have to create the module, (I hope that you know how to create magento module) and add in config.xml file next code:

Read more

Blank Magento widget to get you started with Magento widget development

Blank Magento widget to get you started with Magento widget development

Hello inchoo readers. As we are nearing the Christmas time, I felt I could write down some free code and share with you. Yesterday I got all excited seeing Magento 1.4 beta1 available for download. As you can guess, it did not took me long to download and install it. One of the most interesting features, for me, are the widgets.

Read more

Programatically add bundle product to cart in Magento

Programatically add bundle product to cart in Magento

Sometimes, clients requirements exceed the defaults built into the Magento. Recently we came across a task that among other things required manipulation of bundle products in Magento. In order to help my coworker Tomas I wrote this little code snippet that programatically adds bundle product to cart.

Read more

Magento: How to import additional images for products

Magento: How to import additional images for products

We did a migration from CRE LOADED (osCommerce clone) to Magento and we had to import all products with additional images. Every products had from 4 to 6 images which was a problem because Magento doesn’t have built-in ability to upload multiple images for products.

Read more

Bulk disable multiple Magento products

Bulk disable multiple Magento products

With all its ORM, model, resource and so on greatness, sometimes platform limitations are too obvious in Magento when it comes to large number of products in store. Recently I faced a simple task, I needed to disable around 6500 products in Magento that were assigned to a single category called “Inactive Products”. Given that it was an import from old system to Magento it is irrelevant why one would use category “Inactive Products” instead of just setting their status to “disabled”. My point is, whats the fastest way to do a bulk action on large number of products.

Read more

Magento Hello world module (extension)

Magento Hello world module (extension)

Previously I already wrote how to build custom module (extension) in Magento. Here is a new, refreshed article on that subject.

We will start by creating a simple “Hello world” module. However, you will soon see that simple takes a new meaning with Magento. Creating a bare bone module requires at least two files in Magento. For your module to work you need /app/etc/modules/MyCompany_MyModule.xml, app/code/local/MyCompany/MyModule/etc/config.xml. But, barebone module will not give you a “Hello developer” 🙂 -So, we need to add few more files to the game.

Read more

How to make TinyMCE work with Magento CMS pages

How to make TinyMCE work with Magento CMS pages

Latest version of Magento, as of time of this writing, is 1.3.2.3. Latest, as well as previous versions come with “half-packed” support for TinyMCE editor. There are however few bugs and few steps that need to be handled in order to enable wysiwyg editing in CMS pages. Personally I am not that big of a fan of wysiwyg editors, mostly because I am developer and like to know what I write down.

Read more

Remove SID query from Magento URLs

Remove SID query from Magento URLs

Many people wonder why sometimes the SID part appears in their Magento URLs. This is when your URL has additional SID query usually at the end. Take a look at the image. The curiosity is that it does not appear always. What is the most common scenario it happens? You didn’t access the site with the same domain variant you entered as your “Base URL” in your System> Configuration> Web interface.

Read more

Programatically create Magento blocks and inject them into layout

Programatically create Magento blocks and inject them into layout

Imagine a scenario where you wish to simply create a view file like custom-note.phtml and show this view file on some new url inside the Magento store. One way to do this is to create a CMS page and call that block from within CMS page. But what if you wish to create and append this block to other areas of Magento layout that are inaccessible from CMS page interface form admin? What if I want to add new div element under the breadcrumbs and append new block under it?

Read more

Updating options of configurable product that is already in the cart

Updating options of configurable product that is already in the cart

Let’s say we have configurable Magento product in shopping cart and we want to update its
options without deleting product from cart and adding it again.

That’s quite easy to achieve with following steps, however I can’t write complete tutorial here so
you should be a little more familiar with Magento in order to make it work.

Read more

Magento custom emails

Magento custom emails

Ever wanted to “just send the email” using the built in email features in Magento? Ever hit the wall trying to do something with Magento? OK, I know the answer to the other one, just had to ask :). Anyhow, sending the emails with Magento turned out to be a process of “just” a few hours of tracing Magento code.

Read more

Removing Product Comparison in Magento

Removing Product Comparison in Magento

As many things in Magento, removing product comparison is not available thru the admin interface. Thus, leaving us with the only option of getting down and dirty with theme files editing.

Read more

Access denied in Magento admin

Access denied in Magento admin

Some of you may encountered this problem. You install new Magento extension through downloader, try to access its configuration settings and Magento throws “Access denied” page at you. Although you’re administrator of the system.

Read more

Add breadcrumbs in Magento to pages that miss them

Add breadcrumbs in Magento to pages that miss them

Here is one solution on how to add breadcrumbs to pages in Magento that by default do not have breadcrumbs. Recently we had a client that requested a basic breadcrumb to be shown on pages that Magento does not serve breadcrumbs.

<?php
/**
*
* CUSTOM BREADCRUMBS
*
* Adds url breadcrumbs for pages that do not have breadcrumbs by default
*
*/
 
?>
<?php if(is_null($crumbs)): ?>
<?php
 
/**
* NOTE
* On some servers use ->getServer('PATH_INFO')
* and on some ->getServer('ORIG_PATH_INFO')
*/
 
$urlRequest = Mage::app()->getFrontController()->getRequest();
$urlPart = $urlRequest->getServer('ORIG_PATH_INFO');
 
if(is_null($urlPart))
{
$urlPart = $urlRequest->getServer('PATH_INFO');
}
 
$urlPart = substr($urlPart, 1 );
$currentUrl = $this->getUrl($urlPart);
 
//$controllerName = Mage::app()->getFrontController()->getRequest()->getControllerName();
//$controllerName = ucfirst($controllerName);
 
$controllerName = str_replace("/", " ", $urlPart);
$controllerName = str_replace("_", " ", $controllerName);
$controllerName = str_replace("-", " ", $controllerName);
$controllerName = ucfirst($controllerName);
 
?>
<span class="breadcrumbs">
<strong class="float"><?php echo $this->__("You're currently on: ") ?></strong>
<ul class="breadcrumbs">
<li class="home">
<a title="<?php echo $this->__('Go to Home Page') ?>" href="<?php echo $this->getUrl() ?>"><?php echo $this->__('Home') ?></a>
</li>
<li> / </li>
<li class="<?php echo strtolower($controllerName) ?>">
<strong><?php echo $this->__($controllerName) ?></strong>
</li>
</ul>
</span>
<?php endif; /* END OF CUSTOM BREADCRUMBS */ ?>
Read more

File upload in Magento

File upload in Magento

Whan of the most enticipated and needed things in Magento is File upload Custom Option. As discussed last year at Magento Forum, it is not completed nor tested.

Now, Magento already have frontend and admin part of file upload option implemented in themes. Since backend part is still missing, understand that this still doesn’t work, however, if you’re interested how it looks, read on ..

Read more

Simple product with custom options in grouped product in Magento

Simple product with custom options in grouped product in Magento

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.

Read more