Some sorting example in paython.
-
zendnwar
-
March 6, 2014
-
Python
-
0 Comments
>>> sorted(5, 2, 3, 1, 4,8,9,7) output : 1, 2, 3, 4, 5, 7, 8, 9 list.sort() method : >>> a= 5, 2, 3, 1, 4,8,9,7 >>> a.sort() >>> a output : 1, 2, 3, 4, 5, 7, 8, 9 Key Functions : >>> sorted(“a key parameter to specify a function to be called on each list element prior to …
Continue Reading
Advantages and Disadvantages of Magento
-
zendnwar
-
February 24, 2014
-
Magento
-
1 Comment
Advantages of Magento It is open source, so it’s easy to be popular and everyone can use it. Since Magento is 100% open source platform, lots of Magento extensions including free and paid ones are available to enhance of the power of Magento Ecommerce on your store. Magento is built to scale from 1 to a million, avoiding common pitfalls …
Continue Reading
How to Run Magento Code Externally?
-
zendnwar
-
February 18, 2014
-
Magento
-
0 Comments
Sometimes need to use Magento functions and classes from outside of the Magento platform. Please check the following code. <?php require_once(‘app/Mage.php’); //Path to Magento umask(0); Mage::app(); // Insert your code If you want run this script just save at your own name like upload.php run your script www.example.com/upload.php Hope it will help you.
Continue Reading
How to migrate magento from one server to another?
-
zendnwar
-
February 10, 2014
-
Magento
-
0 Comments
Several way you can move server, one of the most easiest way. Follow the below Step: 1) Back up the files in the server 2) Export the Databse 3) Move the files to the new server 4) Import the databse to the new server 5) Edit the database details . please update the file “app/etc/local.xml”, with the latest Database details …
Continue Reading
Set, Retrieve and Unset Session in Magento
-
zendnwar
-
February 10, 2014
-
Magento
-
0 Comments
Set: $mySession = ‘Hello Bangladesh’; Mage::getSingleton(‘core/session’)->setmySession($mySession); To Retrieve: $mySession = ”; $mySession = Mage::getSingleton(‘core/session’)->getmySession(); To Unset: Mage::getSingleton(‘core/session’)->unsmySession();
Continue Reading
Important functions list in Magento
-
zendnwar
-
February 10, 2014
-
Magento
-
0 Comments
General Related functions $this->getRequest()->getServer(‘HTTP_REFERER’); Product related functions $product->getName() $product->getSku() Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty() $product->getResource()->getAttribute(‘color’)->getFrontend()->getValue($product) $product->isSaleable() $product->isisAvailable() Mage::getModel(‘catalogrule/rule’)->calcProductPriceRule($product,$product->getPrice()) $product->getTierPrice(1) Newsletter related functions $subscriber = Mage::getModel(‘newsletter/subscriber’); $subscriber->subscribe($user_mail); Cache Related functions $tags = array(Mage_Catalog_Model_Category::CACHE_TAG); //Category block tag Mage::app()->cleanCache($tags) Product images Related functions $_product->getMediaGalleryImages()->getItemByColumnValue(‘label’, ‘LABEL_NAME’)->getUrl() Customer related functions $this->helper(‘customer’)->isLoggedIn()
Continue Reading
How to Password protecting your development site with .htaccess or .htpasswd?
-
zendnwar
-
February 7, 2014
-
Others
-
3 Comments
It is very simple just follow below instruction: Step 1 : Create a .htaccess file and upload to your server to the root of your dev site with the following content: AuthName “Authorisation Required” AuthUserFile “/path/to/.htpasswd” AuthType Basic require valid-user ErrorDocument 401 “Authorisation Required” N.B. : If .htaccess file already exists then you can add the above code on the …
Continue Reading
How to delete Image cache in Magento programatically ?
-
zendnwar
-
February 6, 2014
-
Magento
-
0 Comments
Just copy and paste use following code: Mage::getModel(‘catalog/product_image’)->clearCache();
Continue Reading
What is AngularJs ?
-
zendnwar
-
January 19, 2014
-
AngularJS
-
0 Comments
AngularJS is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications. Its goal is to augment browser-based applications with model–view–controller (MVC) capability, in an effort to make both development and testing easier. The library reads in HTML that contains additional custom tag attributes; it then obeys the directives in those custom attributes, and binds input or …
Continue Reading
Error: Affected Num. rows Took (ms) in cake
-
zendnwar
-
January 2, 2014
-
Cakephp
-
1 Comment
This is not an error. This is just debugging. If u dont want to display go to app/config/core.php and then change Configure::write(‘debug’, 0); Hope it will work.
Continue Reading