Header Ad

Showing posts with label Magento. Show all posts
Showing posts with label Magento. Show all posts

Friday, June 11, 2010

How to load Base URL in CMS page of Magento

The following code will show the base url in CMS pages of Magneto when it executes.


{{store url=""}}

Wednesday, May 19, 2010

Unable to login into Customer Account in Magento

Update the following code inMage.php
changed this,
Mage::register('original_include_path', get_include_path());
to
Mage::register('original_include_path', '');

Tuesday, May 4, 2010

Wiky aboout Magento

Hi All,

Recently i came across one of the useful links about Magento Wiki. This will be helpful to all. Please look into this.

http://en.wikipedia.org/wiki/Magento

Magento Backend Tour

Magento Front-end Tour

Tuesday, April 27, 2010

Enabling log in Magento

We can enable the log in Magento. We need to follow the below steps to enable the log.

Login into the Admin panel
Select System -> Configuration
Select Developer tab from left hand side of the page
In that, select Log Settings tab
Enable - Yes and click on Save Config

Monday, April 26, 2010

How to change Pdf logo in Magento

Login into the Magento admin panel

Select System -> Configuration -> Sales

In that select the Invoice and Packing Slip Design. In that upload the logo images.

Thursday, April 15, 2010

Unable to login into admin panel of MAGENTO.

We can overcome this problem by modifying or updating the following page.

app\code\core\Mage\Core\Model\Session\Abstract\varien.php

$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()

Comment the isSecure() and save the file.

Hope from the above changes, magento admin will work now on your localhost with the following url.

Monday, April 12, 2010

How to get product data using product id in MAGENTO

We can use the following code to get the product data using product id.
$_product = new Mage_Catalog_Model_Product();
$product_id = 535;//define the product id which you required
$_product->load($product_id);
From the above step, all the product data will be loaded in the $_product Product object. Use the following code to print the total data.
echo "

";

print_r($_product->getData());

Compressing CSS & JS Files in Magento

The following is the extension for Compressing CSS & JS Files in Magento.

click here

How to enable USPS in magento

Aside from the many unanswered questions about USPS shipping, I found ONE real gem with all kinds of reasons why USPS shipping might not work:
http://www.magentocommerce.com/boards/viewthread/10356/
1) First you register at usps.com
2) They'll email you a testing server, assuming that you are a developer. IGNORE everything about TESTING, but not the user name:
Thank you for registering for the U. S. Postal Service's Web Tools Application Program Interfaces (APIs). We are providing you with a User ID that serves multiple purposes, as explained below.
Your Username is xxxx
Your Password is xxxx
Your Web Tools User ID, shown above, is required to test and integrate USPS Web Tools APIs. With this ID, you may begin sending calls to the test server. Depending on the API, the address to the test server is either http://testing.shippingapis.com/ShippingAPITest.dll or https://secure.shippingapis.com/ShippingAPITest.dll. Use this information in combination with your User ID and your XML string to send a request to the USPS servers. For more details, refer to the programming guides (located at http://www.usps.com/webtools) for the specific API you are integrating.
A sample test request would look like: "http://testing.shippingapis.com/ShippingAPITest.dll?API=[API_Name]&XML=[XML_String_containing_User_ID]"
...
3) Unless you do want to develop something, immediately let them know that you're using Magento.
4) They'll email the REAL server
5) Then you might just add the server to the shipping setup at ...index.php/admin/system_config/edit/section/carriers/ as I did.
I just tested it and it didn't work. So I went back to the Magento thread and looking at a screenshot there, I noticed that I hadn't entered my user ID. It's been so long, I forgot what it was and I looked it up in my notes.
It STILL didn't work.
FINALLY I realized as I went through their emails that my user ID is NOT what I used to set up my online web tools account at USPS, they had sent a separate user id and pw. I'd forgotten about that and didn't put it in my notes.
So with the RIGHT user id it finally works.

Wednesday, April 7, 2010

Newsletter queue not sending in Magento

You can create a cron job to run repeatedly… or manually run them by entering this
http://www.youdomain.com/admin/newsletter_queue/sending
I noticed that when I entered the above, the number of recipients dropped by only about 20 at a time… that’s when I found the second link above. In summary, the system is programmed to send only 20 newsletters at a time! You can change that by changing a line in app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
$countOfSubscritions = 20;
Replace the number 20; with any number you wish. . . and ‘yes’ the code has Subscriptions misspelled throughout - with the ‘p’ missing. I just left it misspelled and increased the number to 200.
Clearly this is not optimal and the newsletter module has some problems with it. For my first newsletter I took the steps listed above. For my second, I decided this took too much time and ended up using a 3rd party program. I’ve used ConstantContact in the past but used CampaignMonitor this time. There is a free extension to link Magento to CampaignMonitor in MagentoConnect. It worked well for me and CampaignMonitor was EXTREMELY easy to use - very clean and concise.
FYI… after I used the CampaignMonitor extension, I had to uninstall it. It seemed to be effecting my ability to save customer profiles on the frontend or backend. Now that I have all of my newsletter subscribers uploaded to CampaignMonitor, I plan on just using their code in my Magento site to allow new subscribers to sign-up and have their subscription stored on CampaignMonitor.
Perhaps someone else might have an easier solution. This was just my solution after hours and hours of frustration with Magento’s newsletter module. You can use Magento for a small list of subscribers. But I’m not sure it is the best option for larger numbers. It is definitely a module that needs some work!

Saturday, April 3, 2010

Ability to get error messages in Magento

The following code will be helpful to get error messages in magento.

$mm = Mage::getSingleton('checkout/session');

foreach ($mm->getData('messages')->getErrors() as $item){
echo $item->getCode();
}

Ability to get success message in Magento

The following code will be helpful to get the messages in magento.

$mm = Mage::getSingleton('checkout/session');

foreach ($mm->getData('messages')->getItems() as $item){
echo $item->getCode();
}

Friday, April 2, 2010

Retriving Cart Amount in Magento

The following code will be helpful to get the cart totals informaiton in magento.
$mageFilename = 'app/Mage.php';
require_once $mageFilename;

umask(0);
Mage::app();

Mage::getSingleton('core/session', array('name'=>'frontend'));

$session = Mage::getSingleton('checkout/session');

$totals = $session->getQuote()->getTotals();

Thursday, April 1, 2010

Magento Vendor Notification

Hi,

This is one of the link which i came across in MAGENTO for vendor notification. This mighe be useful for somebody.

http://www.magentocommerce.com/extension/1193/vendor-notifications

How to get sub category id's under a category in Magento

The following code will provide the necessary steps for fetching the sub-category id's under selected category.

//this will return the category object
$_category = Mage::getModel('catalog/category')->load($categoryId);

$subcategoryIds = array();

//This will return the list of category id's under specified category
$subcategoryIds = split(",", $_category->getChildren());

Ability to get all the manufacurers or brands in Magento

We can use the following code to get the list of manufacturers in MAGENTO.

$product = Mage::getModel('catalog/product');

//Retriving the attribute values for the manufacturer id
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->setEntityTypeFilter($product->getResource()->getTypeId())
->addFieldToFilter('attribute_code', 'manufacturer') // This can be changed to any attribute code
->load(false);

$attribute = $attributes->getFirstItem()->setEntity($product->getResource());

//This is an array of manufacturers
$manufacturers = $attribute->getSource()->getAllOptions(false);

Adding 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.

Follow these easy steps and enjoy your multilingual site:

* 1. Download the desired translation thru Magento connect via admin.
* 2. Once installed Go to: System -> Manage Stores -> Create store view. Enter the data and save.
* 3. Now go to: Configuration -> Current Configuration Scope (Select your language from the dropdown) and on the right side under “Locale options” choose the desired language.