getBaseUrl – URL Path in magento

Share
Posted on September 26th, 2011 | Posted by admin

When developing in Magento and playing arround with Magento Themes there is some functions you should know.

If you want to get the source url of an image, javascript or file, call one of this functions adding your own path at the end.

Under every function there is an example of the output value:

http://example.com/

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>

http://example.com/js/

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>

http://example.com/index.php/

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>

http://example.com/media/

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>

http://example.com/skin/

<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>
Subscribe by E-mail:

How to get Attributes in Magento

Share
Posted on September 26th, 2011 | Posted by admin

Today I’m gona show you how to retrieve the product attributes in your Magento site.

First of all go to Catalog -> Attributes -> Manage Attributes

Edit your attribute. Set Used in product listing to yes.

How to Remove Add to Compare Magento

Share
Posted on September 26th, 2011 | Posted by admin

Do you want to remove the add to compare list in your Magento site?

There is only bad news to do that.

First of all there is no an easy-admin-button to turn it off. Yeah Magento rocks…

And of course you will have to to into some code. But don’t worry is quite simple.
0. Turn cache Off
Turn off the Magento Cache just to be sure the changes work. You can turn it on again once you’re done.

Reminder: System-> Cache Management
1. reports.xml
Open the app/design/frontend/deafult/YourTheme/layout/reports.xml

Look for and comment or delete this line:

<block type=”reports/product_compared” before=”right.permanent.callout” name=”right.reports.product.compared” template=”reports/product_compared.phtml” />

And also this one:

<block type=”reports/product_viewed” before=”right.permanent.callout” name=”right.reports.product.viewed” template=”reports/product_viewed.phtml” />

Can’t Log In Magento Admin

Share
Posted on September 23rd, 2011 | Posted by admin

After installing Magento

Look for the file:

/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

Arroud the line 100:

call_user_func_array(‘session_set_cookie_params’, $cookieParams);

Add bars to comment the line:

//call_user_func_array(‘session_set_cookie_params’, $cookieParams);

Done!

Now you will be able to login.

SEO URL Magento

Share
Posted on September 23rd, 2011 | Posted by admin

We already saw how to remove the .html extension from Magento.

When you install Magento probably your URLs would be like:

  • http://www.domain.com/index.php/about-us

There is an option to remove that index.php from the URL.

Go to your admin panel -> System -> General -> Web -> Search Engines Optimization.

Change Use Web Server Rewrites to Yes.

Page 1 of 41234»