In my last post about translations I was explaining how to translate words in Magento with inline translation tool as an option, but there are more techniques for translating besides that.
In this post I will try to cover translations for custom modules so they all refer to a single csv file.
Magento 1
How to set multiple websites with multiple store views in Magento
If you work with Magento, sooner or later you will end up needing multiple websites that have
multiple languages.
Most of you know this, but I hope someone will still find this post useful.
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 moreHow to set FedEx shipping in Magento
This is guide about setting FedEx shipping method in Magento.
Read moreGit ignore (.gitignore) file for Magento project
Yesterday I was determined to write a detailed walk-trough on setting up the SVN for Magento development. After some minor frustrations I decided to let go of the SVN and make my self learn Git.
Read moreImportance 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 moreCustom 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 moreProperly 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 moreInline 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.
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 moreCreating 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 moreBlank 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 moreProgramatically 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 moreMagento: 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 moreChange any page title in Magento
Here’s a quicky one 🙂 How do you change page title of every Magento page if some titles are hardcoded into controller?
Read moreBulk 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 moreMagento 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 moreHow 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 moreRemove 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 moreProgramatically 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 moreUpdating 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.
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 moreRemoving 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 moreSimple random banner rotator in Magento using static blocks
This is my first post here and I’ll write about my first challenge regarding Magento since I came to work at Inchoo.
As title says I’ll show you how to implement simple random banner rotation functionality in Magento using static blocks.
Read moreAccess 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 moreAdding a new language in Magento
As anything in Magento adding a new language is something that requires a certain procedure which we will explain right now and for future reference.
Read moreAdd 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 moreCustom checkout cart – How to send email after successful checkout
Recently I have been working on a custom checkout page for one of our clients in Sweden. I had some trouble figuring out how to send default Magento order email with all of the order info. After an hour or so of studying Magento core code, here is the solution on how to send email after successful order has been made.
Read moreFile 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 moreSimple 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