Get all active Payment method magento

External script to check which payment method is Active in Magento.
Below is the code to display all payment method.

create new file in root of the magento source and add below code in that file

require_once('app/Mage.php');
umask(0);
Mage::app();
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$payMethods = array();
foreach ($payments as $paymentCode=>$paymentModel)
{
$paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
$payMethods[$paymentCode] = $paymentTitle;
}
echo "<pre>";
print_r($payMethods);

Get all active Shipping method magento

External script to check which shipping method is Active in magento.
Below is the code to display all shipping method.

create new file in root of the magento source and add below code in that file

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shipMethods = array();
foreach ($methods as $shippigCode=>$shippingModel)
{
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
$shipMethods[$shippigCode] = $shippingTitle;
}
echo "<pre>";
print_r($shipMethods);

How to import large Database in phpmyadmin xampp

When you work in your local system you may face problem while uploading large database.

When you face such problem you can apply below the solution for it.

By default, Xampp has database import limit is 2MB. So if you want to upload database which has size more then 2MB at that time you need to increase database max upload size. Below are the steps on how to increase database max upload size.

Increase Database import size from php.ini file.

Here are the steps how we can increase database import size.

=> Go to xampp/php/
=> Find file php.ini
=> Edit php.ini and find for upload_max_filesize ( you will find it near line no:922).
=> Update value as per your requirement.
=> Save file
=> Restart your xampp server and mysql
=> Now open phpmyadmin and now you are able to upload file more then 2MB.

Get product collection in magento

To get product collection we can use following code :

< ?php $_productCollection = Mage::getModel('catalog/product') ->getCollection()
->addAttributeToSort('created_at', 'DESC')
->addAttributeToSelect('*')
->load();
foreach ($_productCollection as $_product){
echo $_product->getId().'';
echo $_product->getName().'';
echo $_product->getProductUrl().'';
echo $_product->getPrice().'';
}
?>

Explain different types of sessions in Magento

Magento have main 3 session which are listed below :

1) Customer Session
2) Checkout Session
3) Core Session

– Customer sessions stores data related to customer.
– Checkout session stores data related to quote and order.
– They are actually under one session in an array. So first name in customer/session will be $_SESSION[‘customer’][‘firstname’] and cart items count in checkout/session will be $_SESSION[‘checkout’][‘items_count’].

Reason reason why we store data in different session types:
The reason Magento uses session types separately is because once the order gets placed, the checkout session data information should get flushed which can be easily done by just unsetting $_SESSION[‘checkout’] session variable. So that the session is not cleared, just session data containing checkout information is cleared and reset all the session types are still intact.

Change magento admin password from database

To change admin password need to follow below steps:

1) Login to Cpanel or access Database
2) Go to phpmyadmin
3) click on sql section
4) Run below query

(Note: please update NEWPASSWORD with your new password and ADMINUSER with your admin name).

UPDATE `admin_user` SET `password` = MD5('NEWPASSWORD') WHERE `username` = 'ADMINUSER';

Basic features of Magento

Basic features of Magento includes

  • Reporting and Analytics
  • Product and Catalog Browsing
  • Customer Accounts
  • Order Management
  • Payment
  • Site Management
  • Shipping
  • Search engine optimization
  • Marketing promotions and tools
  • Checkout
  • International Support

Clearing Magento Log Data

To improve magento store performance we can TRUNCATE following tables in Magento database :

Login to your cpanel then goto phpmyadmin using SQL run below query to clear logs

TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;