Tag Archives: Magento

Magento version 1.8 available to Download

10 Oct

Finally wait is over for new version. New Magento version 1.8 is available,Are you happy with 1.7? if yes that’s good but you can try the newer version. Download it from here.
1. Security Updates :- The security feature of the system has witnessed a major overhaul with the recent update….

How to update expiry date of coupon in Magento

3 Oct

I have asked by one of my colleague to update the expiration date of coupon code in Magento, I thought of writing a script which will update the date of all coupon. Suddenly thought of a shortcut method and updated in database.
Here is the simple query:-
UPDATE salesrule_coupon set…

Blog Shifted

13 Sep

Dear Friends,

I got lot of support from you and I am very happy to let you know that Finally I have migrated from WordPress Hosting to own hosted Blog.

Yes, I believe WordPress is the best blogging platform available in market. So I have used wordpress again for my blog.

Here is a link for my New Blog :- http://mukundtechie.com

I request all my followers to visit my site and suggest me, What can be done to make it more interactive and pleasing to see posts.

All your feedback and suggestions are welcomed.

Thanks,

Mukund Chaudhary

New Blog : http://mukundtechie.com

 

How to get Controller, Module, Action & Router Name in Magento

6 Sep

In most of the case you need to know the name of controller or module in order to debug. Simple one line code to get these. In my previous post written about skill a developer must have. So targeting developer this is another post for them

1. Get Controller Name In Template Files:

$this->getRequest()->getControllerName();

2. Get Action Name In Template Files:

$this->getRequest()->getActionName(); //the function inside the controller

3. Get Router Name In Template Files:

$this->getRequest()->getRouteName();

4. Get Module Name In Template Files:

$this->getRequest()->getModuleName();

Finding Controller, Module, Action & Router Name In Class Files:

5. Get Controller Name In Class Files:

Mage::app()->getRequest()->getControllerName();

6. Get Action Name In Class Files:

Mage::app()->getRequest()->getActionName();

7. Get Router Name In Class Files:

Mage::app()->getRequest()->getRouteName();

8. Get Module Name In Class Files:

Mage::app()->getRequest()->getModuleName();

These functions i.e. getControllerName, getActionName, getRouteName, getModuleName are present in the class Mage_Core_Model_Url, you can display all the results by taking a vardump as
var_dump(Mage::app()->getRequest());

Hope this make sense to you and help you in debugging. Happy coding..:)

How to delete expired coupon automatically in magento

2 Sep

When it comes to the use of coupon code in your shopping cart. You will see that there will be a long list and lots are already expired but consuming space in database for no reason. It also happened with me. Saw a lot of useless coupon code and then decided to delete all those coupon code.

Yes ofcourse, you cannot think of doing it manually. Here is the code snippet that will do the trick for you. Let understand what it does?

<?php
//Including the Mage.php to run the process
require_once(‘app/Mage.php’);
Mage::app(‘default’);

// Load the salesrule Model
$allCoupons = Mage::getModel(‘salesrule/rule’)->getCollection()->load();
$noofCoupons = 0;

//It takes the current time

$Now = strtotime(‘now’);

$today = date(“Y-m-d”, $Now);

// Use foreach to get all the coupon details and do as required.

foreach ($allCoupons as $aCoupon) {
$couponName = $aCoupon->getName(); // Get the name of coupon
$subString = substr($couponName,0,16);
$expiryDate = $aCoupon->getToDate(); // Get the expiery date of coupon
$expiryDay = date(“Y-m-d”, $expiryDate);
// This will delete the coupon that satisfy the if condition.
if(($subString == “Abandoned coupon”) && ($today > $expiryDate)) {
$aCoupon->delete();
}
}
?>

You are done. All the expired coupons are deleted. Coupon tables are happy now.. 🙂

How to re-index data from command line in Magento

30 Aug

We all are agree that Magento is a powerful tool for ecommerce site but when it gets loaded with lots of data and images. Sometime it gets slower and you need to index your data.Indexes are additional database tables with some flat data, which allows to organize fast responses from the database.

Today I came up with how to use indexing in magento. If you are a magento developer, you might be familier with Index Management from Admin section of magento(Admin->System->Index Management). But when you have lots of data 10 thousand plus and lots of category, it might takes hours to update the indexes and sometime it shows time out error as it just break because of max_execution_time exceeding in php script. There is a solution, you can run reindex process from the command line.

I am expecting that you have a SSH access to your hosting server, Just login to your account and go to magento root and then in shell directory by typing below command.

cd [MAGENTO_ROOT]/shell/

List all the file by ls -l

You will find php indexer and check its status by tying below in your command line:-

php indexer.php –status

You will see something like this:-

indexes_status

 

 

 

 

 

 

 

To run index rebuild process you can run the next command:

php indexer.php –reindex catalog_product_price

You can use next arguments for different types of indexes:

  • catalog_product_attribute Product Attributes
  • catalog_product_price Product Prices
  • catalog_url Catalog Url Rewrites
  • catalog_product_flat Product Flat Data
  • catalog_category_flat Category Flat Data
  • catalog_category_product Category Products
  • catalogsearch_fulltext Catalog Search Index
  • cataloginventory_stock Stock status

You can also run the process in background by using & key.

Magento2 Coming soon to hit market

29 Aug

Magento 2 development team were on-hand to share key changes in Magento 2 project and discuss technical changes and developer recommendations. Team Magento working hard on making it more improved.

Magento 2 is an open source eCommerce R&D project facilitating the improvement of Magento Core products. With the new and improved features in Magento 2, it offer more functionality to merchants and continue to grow with the platform. Magento 2 is a prospective future version of the Magento e-commerce software, currently still in the development stage.

Some of Features That Magento 2 Offers
• Magento 2.0 will run on PHP 5.3 and Zend Framework as 1.0. And it will support MSSQL, Oracle and some other database as well. We can see that Magento keep growing and seek to support more and more popular platform soon.

• Performance is always an issue for Magento so it is recognized as resource hungry and not efficient. The team of Magento keep improving the performance of Magento version by version. With the 2.0, the performance of Magento will be expected at least 20% more faster than the latest Magento 1.x versions.

• Magento 2.0 uses jQuery library as its default JavaScript library. It’s a big plus for those who want to get rid of prototype and jquery conflict.

• The modules like catalog, customer, checkout, CMS, sales, etc will be components with high code coupling between each other. Now if you don’t want to use a certain module, you can simply disable it and write your own one.

• Magento uses Zend Framework but you can’t get this information easily as the directories structure of Magento 1.x series are quite different from the Zend Framework. For Magento 2.0, the directories structures will be quite similar to the Zend Framework.

Here is the folder structure showing magento2

mod-structure

You will also find some of the change in design of admin section. You can change the view and layout display.

Release Plan:- Release plan for magento has yet not declared as they are working on it as expected to release their alpha first and then solving all the bugs in beeta phase. Excited to see Magneto2.

%d bloggers like this: