Magento: How to remove from_store from URLs

If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:

 public function getCurrentUrl($fromStore = true) 

So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml
Change the line

<option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option>

to

 <option value="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected ?>><?php echo $this->htmlEscape($_lang->getName()) ?></option> 

Source:
http://www.magentocommerce.com/boards/viewthread/75111/#t236739

Magento: How to check if current page is homepage?

Magento: How to check if current page is homepage?

Magento: How to check if current page is homepage?

Here is a quick code to check if the current page is homepage or not.

if($this->getIsHomePage()) {
    echo 'You are in Homepage!';
} else {
    echo 'You are NOT in Homepage!';
}

Below is an alternative way to check for homepage:-

$routeName = Mage::app()->getRequest()->getRouteName();
$identifier = Mage::getSingleton('cms/page')->getIdentifier();
 
if($routeName == 'cms' && $identifier == 'home') {
    echo 'You are in Homepage!';
} else {
    echo 'You are NOT in Homepage!';
}

Hope this helps. Thanks.

Magento: Add custom attribute to Magento’s PDF invoice

Add custom attribute to Magento’s PDF invoice

Add custom attribute to Magento’s PDF invoice

Hello everyone! Today I’ll show you how to add custom attribute to Magento’s generated PDF invoice in just a few steps. Since this article is pretty straight-forward, here we go.

One of my recent tasks was to create a custom attribute for products called inchoo_warehouse_location, and output it when click on “Print” (invoice in admin section) occurs. Since PDF generation is Magento’s core functionality, we’ll have to rewrite it a bit.
(more…)

Magento: No input file specified – Godaddy

Magento: No input file specified - Godaddy

Magento: No input file specified – Godaddy

After installing Magento in godaddy. I logged into the admin section, it shows “No input file specified”.

Solution:
Login to your Godaddy Account. Click on your hosting account.
Go to Settings > File Extensions Management and change .php and .php5 to run under PHP5.2X (instead of PHP5.2xFastCGI)

Magento 1.7 Upgrade Errors with Solutions

Magento 1.7 Upgrade Errors with Solutions

Magento 1.7 Upgrade Errors with Solutions

Upgrading Magento sometimes becomes very tedious. You may receive errors like 500 internal error, getAlloptions(), two navigation bars, Reindex error, “CONNECT ERROR: Package ‘Mage_All_Latest’ is invalid” etc. while upgrading to 1.7 version. In this blog we have shared some errors of magento 1.7 upgrade with their solutions.
(more…)

Magento: Tutorial- How to Upgrade Magento to 1.7 via FTP

Magento: Tutorial- How to Upgrade Magento to 1.7 via FTP

Magento: Tutorial- How to Upgrade Magento to 1.7 via FTP

Many of you might not like the previous method of Upgrade which was via connect manager. Sometimes when you have huge no. of products, then upgrading through Connect Manager, becomes a tedious task. In such a situation, we would like to suggest Magento Users to upgrade magento through FTP.

In this Tutorial, we will provide you steps to be followed while upgrading to Magento 1.7:
(more…)

Magento: Add dynamic blocks in phtml files

Magento: Add dynamic blocks in phtml files

Magento: Add dynamic blocks in phtml files

To add dynamic blocks in phtml files. you can add this code to any where as you want in the phtml files like view.phtml:

<?php echo $this->getLayout()->createBlock('moduleName/blockType')->setTemplate('moduleName/templateName.phtml')->toHtml(); ?>
/*
- moduleName: your module's name (Ex: catalog)
- blockType: the path to block file (Ex: product_view ) (Catalog/Block/Product/View.php)
*/ 

Magento: How to get any category’s description in Magento

How to get any category’s description in Magento

How to get any category’s description in Magento

First, let’s talk about how to get category by category id in Magento.

It’s easy to get category by id, just change the number in load() method.

$category=Mage::getModel('catalog/category')->load(23);

Then this is the dsecription:

echo $category->getDescription();

You can change the description in Catelog->Category in the backend, and you can easily get other attributes just change the getDescription() method.

Page 4 of 81234567»

Pin It on Pinterest