Monday, June 18, 2012
Magento Show Top Navigation with Thumnail
1.Add new function getThumbnailUrl in Mage\Catalog\Model\Category.php
public function getThumbnailUrl()
{
$url = false;
if ($image = $this->getThumbnail()) {
$url = Mage::getBaseUrl('media').'catalog/category/'.$image;
}
return $url;
}
2.Add new function getThumbnailUrl in Mage\Catalog\Block\Navigation.php
public function getThumbnailUrl($category)
{
return Mage::getModel('catalog/category')->load($category->getId())->getThumbnailUrl();
}
3. Use getThumbnailUrl to show thumnail in top navigation
Use as:
Open app\code\core\Mage\Catalog\Block\Navigation.php, then serach for html generate _renderCategoryMenuItemHtml method, here you can change html as
Replace $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>';
with
$html[] = '<img src="'.$this->getThumbnailUrl($category).'" alt="'. $this->escapeHtml($category->getName()).'" />';
public function getThumbnailUrl()
{
$url = false;
if ($image = $this->getThumbnail()) {
$url = Mage::getBaseUrl('media').'catalog/category/'.$image;
}
return $url;
}
2.Add new function getThumbnailUrl in Mage\Catalog\Block\Navigation.php
public function getThumbnailUrl($category)
{
return Mage::getModel('catalog/category')->load($category->getId())->getThumbnailUrl();
}
3. Use getThumbnailUrl to show thumnail in top navigation
Use as:
Open app\code\core\Mage\Catalog\Block\Navigation.php, then serach for html generate _renderCategoryMenuItemHtml method, here you can change html as
Replace $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>';
with
$html[] = '<img src="'.$this->getThumbnailUrl($category).'" alt="'. $this->escapeHtml($category->getName()).'" />';
Labels:
Magento
Magento Layered navigation at home page
Follow as
1.Update XML layout via CMS > Manage Pages > Homepage > Layout Update XML box:
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>
2.Modify a core method getCurrentCategory() in core/Mage/Catalog/Model/Layer.php
public function getCurrentCategory()
{
$category = $this->getData('current_category');
if (is_null($category)) {
if ($category = Mage::registry('current_category')) {
$this->setData('current_category', $category);
}
else {
$category = Mage::getModel('catalog/category')->load($this->getCurrentStore()->getRootCategoryId());
$this->setData('current_category', $category);
}
}
if($category != Mage::registry('current_category')) {
$home_category = Mage::getModel('catalog/category')->load(3);
$this->setData('current_category', $home_category);
$category = $this->getData('current_category');
//return $category;
}
return $category;
}
Labels:
Magento
Saturday, June 16, 2012
Magento : Replacing the Logo Image in Transactional Emails
To replace the logo image, upload the new logo image into the images
directory and rename the file as logo_email.gif, overwriting the
existing image. Also, and very importantly, to ensure that the new image
will show up in the transactional emails, the permissions need to be
changed so that it includes read and write permissions.
Labels:
Magento
Magento: Terms and Conditions
Setting up Terms and Conditions for your Magento store is a two-step process:
Step 1: Enable Terms and Conditions in your store's checkout process
From the Admin panel, select System > Configuration.
From the Configuration panel on the left, under Sales, select the Checkout tab.
If necessary, click to expand the Checkout Options section. Terms and Conditions Checkout Options
Make sure that Enable Onepage Checkout is set to Yes.
To display a checkbox that describes your store's terms and conditions during checkout, set Enable Terms and Conditions to Yes.
Click the Save Config button.
Step 2: Create a Terms and Conditions checkbox
From the Admin panel, select Sales > Terms and Conditions.
To add new terms and conditions, click the Add New button.
Complete the following information:
Enter a Condition Name for this condition.
To make your Terms and Conditions checkbox appear during customer checkout, set Status to Enabled.
Select whether you want your Terms and Conditions Document to appear as Text or HTML. If you want to use bold or underline or other formatting in the document, you can use HTML tags to achieve that formatting. To use HTML tags, set Show Content as to HTML.
Identify the Store View where the Terms and Conditions will appear.
Enter the Checkbox Text that you want to appear with the checkbox. For example, you could use "I understand and accept these terms and conditions" or "Accept" or whatever specific terms and conditions you want your customers to acknowledge.
In the Content field, enter text to describe the terms and conditions of the sale.
Optional: You can set Content Height (css) in pixels to determine the height of the text box that contains the terms and conditions content. For example, if you want the text box to be one inch high, enter the equivalent value in pixels.
Click the Save Condition button.
Step 1: Enable Terms and Conditions in your store's checkout process
From the Admin panel, select System > Configuration.
From the Configuration panel on the left, under Sales, select the Checkout tab.
If necessary, click to expand the Checkout Options section. Terms and Conditions Checkout Options
Make sure that Enable Onepage Checkout is set to Yes.
To display a checkbox that describes your store's terms and conditions during checkout, set Enable Terms and Conditions to Yes.
Click the Save Config button.
Step 2: Create a Terms and Conditions checkbox
From the Admin panel, select Sales > Terms and Conditions.
To add new terms and conditions, click the Add New button.
Complete the following information:
Enter a Condition Name for this condition.
To make your Terms and Conditions checkbox appear during customer checkout, set Status to Enabled.
Select whether you want your Terms and Conditions Document to appear as Text or HTML. If you want to use bold or underline or other formatting in the document, you can use HTML tags to achieve that formatting. To use HTML tags, set Show Content as to HTML.
Identify the Store View where the Terms and Conditions will appear.
Enter the Checkbox Text that you want to appear with the checkbox. For example, you could use "I understand and accept these terms and conditions" or "Accept" or whatever specific terms and conditions you want your customers to acknowledge.
In the Content field, enter text to describe the terms and conditions of the sale.
Optional: You can set Content Height (css) in pixels to determine the height of the text box that contains the terms and conditions content. For example, if you want the text box to be one inch high, enter the equivalent value in pixels.
Click the Save Condition button.
Labels:
Magento
Thursday, June 7, 2012
Could not determine temp directory, please specify a cache_dir manually in magento
You have to open magento/lib/Zend/Cache/Backend/File.php
Change:
protected $_options = array(
'cache_dir' => 'null',
to
protected $_options = array(
'cache_dir' => 'tmp/',
Upload the changed File.php and create a folder, called “tmp”
The folder must be writable, so give it ‘777’
Labels:
Magento
Fatal error: Allowed memory size of 33554432 bytes exhausted in magento
This is because of the PHP Memory Limit.
Here is how to fix.
Goto your website root from FTP.
You will see a file called php.ini.sample
Rename it to php.ini
Edit that file and Copy/Paste this code at last,
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so
Labels:
Magento
Subscribe to:
Comments (Atom)