Thursday, March 4, 2010

Magento Place Order is returning to the cart (basket) page

Hi after upgrading my checkout stopped working and I check each and every possible solution for that, someone is telling that it is due to some other thing etc. etc.

But to know your exact problem first check the javascript errors and then follow this instructions:

Open page "Magentoroot/app/code/core/Mage/Checkout/controllers/OnepageContoller.php"

Search for " $result['error_messages'] "

override this variable with

$result['error_messages'] = $e->__toString();

It will show you the exact problem of what your magento causing.

Hope this helps.

Magento Column 'position' in order clause is ambiguous

I dont know how many people get this error but it took me very long time to resolve this:

The one who know the answer will say its a task of 5 mins but who dont know it will be very very difficult to get rid of this problem, the only thing that you need to do is go to this page

magentoroot/app/code/core/Mage/Catalogue/Model/Layer.php


Search for "function getFilterableAttributes()"

comment the following code
"->setOrder('position', 'ASC') "

your problem is solved

Friday, February 26, 2010

magento - install live site on local system

Steps you must take care while installing live site on local server:

1) Download all files and folders to local system.

2) Download all DB and install it on local system.

3) Open DB and search for core_config_data, change the live url to the local one.

4) Change the document root in pear.ini (downloader\pearlib\pear.ini), without it you cannot able to upgrade your local magento with latest updates.
Note: you must count the number of words you are placing in it and replace it, for example its written there as S:42 and your word count is 52 then replace 42 with 52.

Hope this help

Magento connect is not working

After researching a lot I found the solution that you have to have update your magento and for that use this extension key "magento-core/Mage_All_Latest"

Your admin wont allow you to logged in due to latest version.. to resolve the problem delete CACHE folder from "app\code\core\Zend"

After this your site starts working but it wont show any product under any category.

To restore products with its respective categories you need to reindex the products from system->Index Management

Friday, February 19, 2010

Use Gmail Account SMTP in PHP

Use php mailer() function in place of php mail().

You can use PHPmailer :
http://phpmailer.codeworxtech.com/

what you need to do is, change the value of host to
$host = "ssl://smtp.gmail.com";

and port number to
$port = 465;

Username will be your gmail id

magento google base feed generator

By installing this extension you can export your products from your Magento Store into a feed that can be automatically imported into SingleFeed's system. SingleFeed then can submit your products to over a dozen comparison shopping engines including Google Base/Product Search, Nextag, Shopping.com, Pricegrabber, Shopzilla, Yahoo Shopping and many more.

http://www.magentocommerce.com/extension/712/singlefeed-export-module

This Extension is very good and freely available.

I tried lot of search but did not find any suitable solution and when found I though it would be benifical for all my friends out there to save their time.

Thursday, February 18, 2010

Magento how to change content of 404 page and remove advertisement/ads

Login into Magento Admin section and follow this path:

-> Admin-> CMS -> Manage Pages

Click On "404 Not Found 1" Page and edit the content according to your requirement.

You can remove the advertisement from the content section by removing the bottom two images.

Wednesday, February 17, 2010

magento set base currency through code

Use this code in your magentoRoot/index.php

Mage::app()->getStore()->setCurrentCurrencyCode('USD');

Write this code before Mage::run();

Note: The currency code you gave above must be set in magento admin in currency setup module.

Monday, February 15, 2010

Magento : Add option in display mode of display setting in magento admin panel

Hi This was my requirement:

Client want to set the category view from admin and the subcategory will show in following views:

1) Category Title + Image + Description
2) Category Title + Image
3) Category Title Only

So to add more options in the admin section you need to modify in the following files:

Tuesday, February 9, 2010

Displaying Custom Attributes on Product View Page of Magento

These methods will be used to get the custom attributes for any products

File that you need to make change will be find here:
magentoRoot/app/design/frontend/default/default/template/catalog/product/view.phtml

If it is a text field (textbox or textarea), this is all you have to do:
 echo $_product->getAttributeName()

If your Attribute Code is "shirt_color, then you would use getShirtColor(). Remove the underscores and capitalize the first letter of each word. If you use getshirtcolor(), it won’t work.

If you are using a dropdown or a multiple select, you have to call it a little differently:

echo $_product->getAttributeText('shirt_color)

Hope this helps.

Monday, February 8, 2010

Magento Change "Tax" to "VAT"

Open the Languge File located in

/magentoRoot/app/locale/en_US/Mage_Tax.csv

You will find the text "Tax" in 2nd para of 93th line.

You can replace the any other variable with your desired variable from this folder.

Hope this help.

PHP Extension curl must be loaded in xampp

I got this error while installing magento "Make sure curl extension is enabled in your php.ini"

I found the solution and hope this help for you also.

C:\xampp\php\php.ini

Search for php_curl.dll

Replace ;extension=php_curl.dll with extension=php_curl.dll (remove ;)

Restart Apache

Hope this helps

Monday, January 25, 2010

Image Magic code

This post is for those who are new to image magic and want to start with something.

This simple command will merge two images and output with the third or overwrite any image.

exec("composite -geometry +0+30 -gravity north ".$uploadDir.$thumb." ".$uploadDir.$imgnm." ".$uploadDir.$imgnm."");

Make sure that both files before this command executed.

To know more about Image Magic CLICK HERE

Setting Cron Jobs

Path to your cron job must be DOCUMENT_ROOT/filename.php

Note: Always include any files from the DOCUMENT_ROOT path for example /home/sites/yourdomain/public_html/filename.php

To know more about cron CLICK HERE

Wednesday, January 20, 2010

Getting product attributes values and labels in Magento

This is how you can get the particular attribute value:

$_product
->getResource()->getAttribute('desired_attribute_code')->getFrontend()->getValue($_product);


how to set the Column number in magento

You need to change in catalog.xml

Search for setColumnCount


Monday, January 18, 2010

Contact Form in Magento

There are cases when you would like to give your client an option to edit some intro text, edit his phone numbers, edit text behind the form, etc. You are probably guessing that it would be nice to be able to embed contact form in some CMS page. No problem.

  • Go to your CMS> Manage Pages interface
  • Once there, input your HTML as you normally would on any other page
  • Once you are happy with HTML part, add this lines:

    {{block type="core/template" name="contactForm" template="contacts/form.phtml"}}
Note: While writing above code please make sure that you are in the source view of Editor.

Click Here to know more.