Bad Bots is a challenge to any website

Bad bots is a big challenge for any webmaster. Bad bots increase your website virtual traffic and kill all your bandwidth even sometime crash your server due to overload of traffic. For that reason your actual visitors will not be able to see your website properly. Now a days when big challenge to keep your […]

Magento update all categories with attribute is_anchor to 1

For update all categories with attribute is_anchor to 1 <?php require_once ‘app/Mage.php’; umask(0); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); ini_set(‘display_errors’, 1); ini_set(‘max_execution_time’, 600); $categories = Mage::getModel(‘catalog/category’)->getCollection(); foreach ($categories as $cat){ $_cat = Mage::getModel(‘catalog/category’)->load($cat->getId()); if ($_cat->getData(‘is_anchor’) == 0){ $_cat->setData(‘is_anchor’,1); $_cat->save(); } echo $_cat->getName().’ ‘.$_cat->getData(‘is_anchor’).'<br/>’; }

Magento Sort by New Product

By default Magento package does not come with category will show new product in that case you need to do simple modification and you are done. Step 1: To Achieve this copy the file Toolbar.php from app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php. Create a Directory Structure in local and paste the Toolbar.php as shown below app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php Step 2: Around line […]

Magento Order ID set order pointer to xxxxxxxx

For magento if you need to set order id pointer to xxxxxxxx then use below simple sql will solve your problem. UPDATE eav_entity_store INNER JOIN eav_entity_type ON eav_entity_type.entity_type_id = eav_entity_store.entity_type_id SET eav_entity_store.increment_last_id=’xxxxxxxx’, eav_entity_store.increment_prefix=’x’ WHERE eav_entity_type.entity_type_code=’order’; increment_prefix : This number will just add before your order ID Example you set increment_last_id 1234567 And increment_prefix=’6’ So your […]

Delete All Tables from Database using unix command

If you like to delete all tables from database using unix command then below is the solution mysqldump -u[USERNAME] -p[PASSWORD] -h [HOSTNAME] –add-drop-table –no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] -h [HOSTNAME] [DATABASE] If you get error on above code ERROR 1217 (23000) at line 1: Cannot delete or update a parent row: […]

magento admin showing 404 error [solved]

Just Today I transfer my magento website from one server to another fronetend everything working fine but when I am trying to open admin of Magento I am getting Message “Error 404 not found” So I have tried many soultion and not able to solve at last I got the solution and that will help […]

Unzip File using php

I always need to upload file to my client server and unzip and install it. In most case server do not enable ssh. So Here below I am attaching simple php script to unzip file function unzip($file){ $zip=zip_open(realpath(“.”).”/”.$file); if(!$zip) {return(“Unable to proccess file ‘{$file}'”);} $e=”; while($zip_entry=zip_read($zip)) { $zdir=dirname(zip_entry_name($zip_entry)); $zname=zip_entry_name($zip_entry); if(!zip_entry_open($zip,$zip_entry,”r”)) {$e.=”Unable to proccess file ‘{$zname}'”;continue;} […]

Arzoo Php Soap Api integration for Hotel search

If you want to integrate Arzoo Hotel Search Api for your website using soap my blog post will help you to do in just 1 min. I am attaching sample code here. require_once (“nusoap.php”); $location_URL = “YOUR HOTEL SEARCH URL “; $action_URL =”http://com.arzoo.hotel.avail”; $Request = “<arzHotelAvailReq> <clientInfo> <username>USERNAME</username> <userType>ArzooHWS1.1</userType> <userID>USERID</userID> <password>PASSWORD</password> <partnerID>PARTNERID</partnerID> </clientInfo> <requestSegment> <currency>INR</currency> […]

Archive file in server without ssh enabled

Well most of the time I need to get my client file in my server for development purpose but most of client do not like to provide ssh account or his account is not enabled ssh. So today I found a brilliant code that will archive the files on server using php. Below is the […]

Download file Using curl

To download file to your server from external server where you have difficulty to have ssh enabled. So below is the curl code you can use for download. set_time_limit(0); $url = ‘Your Download URL’; $fp = fopen (dirname(__FILE__) . ‘/localfile.tmp’, ‘w+’);//This is the file where we save the information $ch = curl_init(str_replace(” “,”%20”,$url));//Here is the […]

Next Page »