Thursday, December 31, 2015

Top 10 Bollywood Songs 2015

Song is simple sets of words that manage according to lines with music and lyrics.In Indian movie song are most important and heart touching to peoples.Some songs are create for any special event or moment represent.
In Bollywood there are lots of songs.Each movie has minimum one songs or music for make more entertainment.Some movies also famous for it's songs.Songs comes in public before release of that movie.for each movie event first release it's music album.Movie and it's story in peoples mind in some times or some moments but it's songs always remember.
Here list of top 10 songs of 2015 according to movie release date.

Sooraj Dooba Hai Yaaron – Roy

Movie :- Roy
Director :- Vikramjit Singh
Release Date :- 13th February
Cast :- Shah Rukh Khan, Kajol, Varun Dhawan, Kriti Sanon
Singer :- Arijit Singh, Aditi Singh Sharma
Music :- Amaal Mallik
Lyrics :- Kumaar
Music On :- T-Series


Jeena Jeena – Badlapur

Movie :- Badlapur
Director :- Sriram Raghavan
Release Date :- 20th February
Cast :- Varun Dhawan, Yami Gautam, Nawazuddin Siddiqui, Radhika Apte
Singer :- Atif Aslam
Music :- Sachin-Jigar
Lyrics :- Dinesh Vijan, Priya Saraiya
Music On :- Eros Now


Tere Bin Nahi Laage – Ek Paheli Leela

Movie :- Ek Paheli Leela
Director :- Bobby Khan
Release Date :- 10th April
Cast :- Sunny Leone, Jay Bhanushali, Rajniesh Duggall, Mohit Ahlawat
Singer :- Uzair Jaswal
Music :- Amaal Mallik
Lyrics :- Kumaar
Music On :- T-Series


Teri Meri Kahani - Gabbar Is Back

Movie :- Gabbar Is Back
Director :- Krish
Release Date :- 1st May
Cast :- Akshay Kumar, Shruti Haasan, Suman Talwar
Singer :- Arijit Singh, Palak Muchhal
Music :- Chirantan Bhat
Lyrics :- Manoj Yadav
Music On :- Zee Music Company


Hamari Adhuri Kahani – Title

Movie :- Hamari Adhuri Kahani
Director :- Mohit Suri
Release Date :- 12th June
Cast :- Emraan Hashmi, Vidya Balan, Raj Kumar Yadav
Singer :- Arijit Singh
Music :- Rashmi Virag
Lyrics :- Jeet Gannguli
Music On :- Sony Music


Bezubaan Phir Se – ABCD 2

Movie :- ABCD 2
Director :- Remo D'Souza
Release Date :- 19th June
Cast :- Varun Dhawan, Shraddha Kapoor, Prabhu Deva, Lauren Gottlieb
Singer :- Vishal Dadlani, Madhav Krishna
Music :- Sachin-Jigar
Lyrics :- Mayur Puri
Music On :- Zee Music Company


Baaton Ko Teri – All Is Well

Movie :- All Is Well
Director :- Umesh Shukla
Release Date :- 3rd July
Cast :- Abhishek Bachchan, Asin, Rishi Kapoor, Supriya Pathak
Singer :- Arijit Singh
Music :- Himesh Reshammiya
Lyrics :- Shabbir Ahmed
Music On :- T-Series


Main Hoon Hero Tera – Hero

Movie :- Hero
Director :- Nikhil Advani
Release Date :- 25th September
Cast :- Sooraj Pancholi, Athiya Shetty
Singer :- Salman Khan
Music :- Amaal Mallik
Lyrics :- Kumaar
Music On :- T-Series


Prem Ratan Dhan Payo - Title

Movie :- Prem Ratan Dhan Payo
Director :- Sooraj Barjatya
Release Date :- 12th November
Cast :- Salman Khan, Sonam Kapoor, Neil Nitin Mukesh, Anupam Kher
Singer :- Palak Muchhal
Music :- Himesh Reshammiya
Lyrics :- Irshad Kamil
Music On :- T-Series


Gerua - Dilwale

Movie :- Dilwale
Director :- Rohit Shetty
Release Date :- 18th December
Cast :- Shah Rukh Khan, Kajol, Varun Dhawan, Kriti Sanon
Singer :- Arijit Singh, Antara Mitra
Music :- Pritam
Lyrics :- Amitabh Bhattacharya
Music On :- Sony Music Entertainment

Top 10 Bollywood Item Songs 2015

Item song is one type of dance with music as musical performance. Currently, many movies known for it's item songs. all Bollywood item songs performance with the best music and any item girls. This year, many start actress perform the role as item song and famous for her sexiest look and dance.
There are many item song releases on current year 2015 with best item girl's attractive performance. So it's difficult to find a top. Here display top 10 Item songs according to release in the year.

Madamiyan - Tevar

Item Girl :- Shruti Hassan 
Movie :- Tevar
Director :- Amit Sharma
Release Date :- 9th January
Cast :- Arjun Kapoor, Sonakshi Sinha, Manoj Bajpai
Singer :- Mika Singh, Mamta Sharma
Music :- Sajid-Wajid
Lyrics :- Kausar Munir


Fashion Khatam Mujhpe - Dolly Ki Doli

Item Girl :- Malaika Arora Khan
Movie :- Dolly Ki Doli
Director :- Abhishek Dogra
Release Date :- 22nd January
Cast :- Sonam Kapoor, Rajkummar Rao, Pulkit Samrat
Singer :- Divya Kumar
Music :- Sajid-Wajid
Lyrics :- Irfan Kamal


Ghagra - Dirty Politics

Item Girl :- Malaika Sherawat
Movie :- Dirty Politics
Director :- K. C. Bokadia
Release Date :- 5th March
Cast :- Mallika Sherawat, Om Puri, Anupam Kher, Jackie Shroff
Singer :- Mamta Sharma
Music :- Sanjeev Darshan
Lyrics :- Sameer


Desi Look - Ek Paheli Leela

Item Girl :- Sunny Leone
Movie :- Ek Paheli Leela
Director :- Bobby Khan
Release Date :- 10th April
Cast :- Sunny Leone, Jay Bhanushali, Rajniesh Duggall, Mohit Ahlawat
Singer :- Kanika Kapoor
Music :- Dr Zeus, Uzair Jaswal
Lyrics :- Kumaar


Aao Raja - Gabbar Is Back

Item Girl :- Chitrangada Singh
Movie :- Gabbar Is Back
Director :- Krish
Release Date :- 1st May
Cast :- Akshay Kumar, Shruti Haasan, Suman Talwar
Singer :- Neha Kakkar, Yo Yo Honey Singh
Music :- Yo Yo Honey Singh
Lyrics :- Sahil Kaushal


Paani Wala Dance - Kuch Kuch Locha Hai

Item Girl :- Sunny Leone
Movie :- Kuch Kuch Locha Hai
Director :- Devang Dholakia
Release Date :- 8th May
Cast :- Ram Kapoor, Sunny Leone, Navdeep Chhabra, Evelyn sharma
Singer :- Ikka, Shraddha Pandit, Arko
Music :- Ikka, Arko, Intense
Lyrics :- Ikka & Arko


Shakira - Welcome to Karachi

Item Girl :- Lauren Gottlieb
Movie :- Welcome to Karachi
Director :- Ashish R Mohan
Release Date :- 28th May
Cast :- Jackky Bhagnani, Arshad Warsi, Lauren Gottlieb
Singer :- Shalmali Kholgade
Music :- Jeet Gannguli
Lyrics :- Kausar Muniro


Nachan Farrate - All is Well

Item Girl :- Sonakshi Sinha
Movie :- All is Well
Director :- Umesh Shukla
Release Date :- 3rd July
Cast :- Abhishek Bachchan, Asin, Rishi Kapoor, Supriya Pathak
Singer :- Meet Bros Anjjan, Kanika Kapoor
Music :- Meet Bros Anjjan
Lyrics :- Kumaar


Mera Naam Mary - Brothers

Item Girl :- Kareena Kapoor Khan
Movie :- Brothers
Director :- Karan Malhotra
Release Date :- 13th August
Cast :- Akshay Kumar, Sidharth Malhotra, Jackie Shroff, Jacqueline Fernandez
Singer :- Chinmayi Sripada
Music :- Ajay-Atul
Lyrics :- Amitabh Bhattacharya


Afghan Jalebi - Phantom

Item Girl :- Katrina Kaif
Movie :- Phantom
Director :- Kabir Khan
Release Date :- 28th August
Cast :- Saif Ali Khan, Katrina Kaif, Rajesh Tailang
Singer :- Syed Asrar Shah
Music :- Pritam
Lyrics :- Amitabh Bhattacharya

Top 10 Bollywood Actors 2015

Bollywood actor is a famous and important character of the movie. This year, many movies coming with good acting by each actor in that. 2015 all most movies are based on actor with best performance and attract audience by getting good box office collection..
Here list of top most actor who are noted for their performance and some comment on social and societal.

1. Salman Khan

Current year 2015 are totally lucky year of 2015.He was heighten of him court case, girlfriend and also some comment about marriage.Current year him both movies got good collection and listed on top of 2015 and create new records also.
  • Bajrangi Bhaijaan - 17th July
  • Prem Ratan Dhan Payo - 12th November 

2. Shahrukh Khan

Shahrukh was also known as romantic actor of Bollywood. This year Shahrukh was highlighted for him 'intolerance' topic on social and also ban on his movie "Dilwale" which is release on end of the yeear.
  • Dilwale - 18th December

3. Akshay Kumar

Every year Akshay gives many movies and also played good role and best performance in that. This year four movies release of him and all are got good box office collection and also audience likes movie theme and character.
  • Baby - 23rd January
  • Gabbar is Back - 1st May
  • Brothers - 13th August
  • Singh Is Bling - 2nd October

4. Amitabh Bachchan

Amitabh Bachchan is Big start of Bollywood and also known his best performance.he gives many movies in his career also many fans of him all over the world.This year he was performance best role in Piku movie.
  • Shamitabh - 6th February
  • Piku - 8th May

5. Ajay Devgan

Ajay Devgan is known as Singham man and also known for him best acting and performance according to character.This year only one movies release of Ajay in this movie most noticed of his best performance as simple man.
  • Drishyam - 30th July

6. Anil Kapoor

This year Anil Kapoor's two movie release with different character one as business man and another as "Majnu Bhai" as comic role in welcome back.
  • Dil Dhadakne Do - 5th June
  • Welcome Back - 4th September

7. Irrfan Khan

Sahabzade Irrfan Ali Khan is playing good roles according to his speech and acting.This year his performance and all released movie are most noticed and also played role in Hollywood movie "Jurasic World".
  • Piku - 8th May
  • Talvar - 14th September
  • Jazbaa - 9th October

8. Ranbir Kapoor

Ranbir Kapoor is son's of big start Rishi Kapoor and comes from Kapoor family so always highlighted.This year he not given any good movie but mostly on news because of his affairs with start.
  • Roy - 13th February
  • Bombay Velvet - 15th May
  • Tamasha - 27th November

9. Ranveer Singh

Ranveer Singh is youngest best actor in Bollywood at the start of his career he gives mostly good movies and played different roles with best performance in movie.
  • Dil Dhadakne Do -5th June
  • Bajirao Mastani - 18th November

10. Emraan Hashmi

Emraan Hashmi also known as serial kisser and he gives all movies with kissing seance but this year his two movies are different and also played good roles with best musics of that movies.
  • Mr. X - 16th April
  • Hamari Adhuri Kahani - 12th June

Top 10 Bollywood Actress 2015

In Indian cinema Actress is most important for entertainment and romance. In Bollywood at the first make love story and romance movie using good actor and actress. Now and now a day women's base movie is created which is totally created by only best Actress.
In current year many movies release with many new and old actresses.Every actress performs own best role and character according to movie theme so it's difficult to list out top 10.Here display list of top 10 actress of Bollywood in 2015 who is most famous for them movies and events.Here also display list of movies according to release date.

1. Deepika Padukone

Deepika Padukone is most famous and popular actress in 2015.It's also first Asian twitter follow of this year.This year she was in news for here "My Choice" video.In 2015 deepika performs best role in Piku and Bajirao Mastani.List of  her movies in 2015.
  • Piku - 8th May
  • Tamasha - 27th November
  • Bajirao Mastani - 18th December

 

2. Priyanka Chopra

Priyanka Chopra also famous for her new American serial "Quantico". She also most voted sexiest Asian women in UK poll also 3rd most followed women in Asia.Current year Priyanka plays leading role in only two movies.List of her movies in 2015.
  • Dil Dhadakne Do - 5th June
  • Bajirao Mastan - 18th December

 

3. Kareena Kapoor Khan

Kareena Kapoor always famous for her glamour looks.This year her movie Bajrangi Bhaijaan was block blaster and her item song "Mera Nam Mary" from Brothers movie is most popular.List of her movies in 2015.
  • Gabbar is Back -1st May
  • Bajrangi Bhaijaan - 17th July
  • Brothers - 13th August

 

4. Kangana Ranaut

Kangana Ranaut is famous on this year for her roles in tanu webs manu returns.In that movie she performs double role as good.List of her movies in 2015.
  • Tanu Weds Manu Returns - 22nd May
  • I Love NY - 10th July
  • Katti Batti - 18th September

 

5. Katrina Kaif

Katrina kaif also known as sexiest women in Bollywood and also famous for her sexiest look.This year she also in new because of affair with Ranbir Kapor.In 2015 only one film release which is ignore by audience and "Afghan Jalebi" songs famous of that movie.
  • Phantom - 28th August

 

6. Anushka Sharma

Anushka Sharma famous for her relationship with most famous and youngster cricket Virat Kohli.She also becomes producer of own movie NH10.Her Bombay Velvet was flop and Dil Dhadakne Do was good. 
  • NH10 - 13th March
  • Dil Dhadakne Do - 5th June
  • Bombay Velvet - 15th May

 

7. Jacqueline Fernandez

Jacqueline Fernandez's three movies release on this year from them only Brothers was average in which she performs small role. Her "Chitiya Kaliya" Song form Roy was most popular and good dancing song.List of her movies in 2015.
  • Roy - 13th February
  • Brothers - 13th August
  • Bangistan - 31st July

 

8. Aishwaria Rai Bachchan

Aishwarya Rai Bachchan famous for her come back movie Jazbaa after become mother she return into Bollywood with thriller movie
  • Jazbaa - 9th October

 

9. Sonam Kapoor

Sonam Kapoor is star kids and known for her fashionable look. This year she performers two different roles in movies which is noted for her good career.List of her movies in 2015.
  • Dolly Ki Doli - 22nd January
  • Prem Ratan Dhan Payo - 12th November

 

10. Shruti Haasan

Shruti Haasan is telly-wood actress comes in Bollywood with good movies of years.This year her two movies release both are good and performs good role in both.Her "Madamiyan" item song from Tevar was also famous.
  • Gabbar is Back - 1st May
  • Welcome Back - 4th September


Top 10 Chat Apps 2015 for Android & IOS

Messaging is mots important in new technology life for connecting each peoples as friends or family members.In previous days we use SMS for convocation and share information and you must pay charges for that.Now it's facility of internet with 3G,4G and wifi network so you can send message, chat, video call and voice call with below top 10 Apps.
Here below display list of top 10 free Apps of 2015 for chat and messaging using internet connection.

10.  Snapchat

Snapchat is simple video and messaging chat application for mostly use share videos and photos called 'Snaps'. This apps share more than 2 million video and photos on 2015.
Snapchat is a video messaging application created by Evan Spiegel, Bobby Murphy, and Reggie Brown when they were students at Stanford University

IOS DOWNLOAD

 

9.  imo

IMO is free video chat,call and message to friends and family. In this app share videos and photos and also send strikers.
Former Google Employee launches Instant Messenger Imo.im founder by Georges Harik and Ralph Harik.Based in Palo Alto, CA, imo is a startup founded and funded by one of the first ten employees at Google

WEBSITE:- https://imo.im/
IOS DOWNLOAD

 

8.  BBM

BBM brings you together in the moment with friends and family through instant chats, voice calls, picture sharing, voice notes and more.BBM is always on and always connected.Its provide Multi-person chats,Groups and Broadcast features.
This app launched on 1st August 2005 by BlackBerry Ltd.

IOS DOWNLOAD

 

7.  WeChat

WeChat is a free messaging & calling app that allows you to easily connect with family & friends. It’s the all-in-one communications app for free text, voice & video calls, photo sharing, and games
WeChat began as a project at Tencent Guangzhou Research and Project center in October 2010 invented by Xiaolong Zhang and Ma Huateng(Tencent CEO).

IOS DOWNLOAD

 

6.  LINE

LINE is mobile messenger app with free stickers and free voice, video call using LINE you can Exchange free instant messages with friends whenever and wherever with one-on-one and group chats.
Line was designed by 15 members of NHN Japan, a subsidiary of the Korean Internet search giant Naver in 2011.

WEBSITE:- http://line.me
IOS DOWNLOAD


5.  Viber

With Viber, everyone in the world can connect. Freely. More than 606 million Viber users text, make HD-quality phone and video calls, and send photo and video messages worldwide
Viber was founded by four Israeli partners: Talmon Marco, Igor Magazinnik, Sani Maroli and Ofer Smocha, with Marco as its CEO on December 2010.

IOS DOWNLOAD


4.  Skype

Skype keeps the world talking - for free. Call, share and message with anyone, even if they’re not on Skype it's also provide group chat and video calling also.
Skype was founded in 2003 by Niklas Zennström, from Sweden, and Janus Friis, from Denmark on by Microsoft.

IOS DOWNLOAD



3.  Hangouts

Google Hangouts is a communication platform developed by Google which includes instant messaging, video chat, SMS and VOIP features.
Prior to the launch of Hangouts, Google had maintained several similar, but technologically separates messaging services and platforms across its suite of products as Google Talk and migrate to the Hangouts on February 2015.

IOS DOWNLOAD

2.  Messenger

Messenger video and chat application only for Facebook friends and contacts.it's also provide group chat and video and photo sharing features.
First release of Messenger on 9th August 2011 by Facebook for providing same chat features as website.

IOS DOWNLOAD


1.  WhatsApp

WhatsApp is most popular ans used instant messaging services on smartphone.Using this app send messages, images, video, user location and audio media messages to other users.
WhatsApp Inc., was founded in 2009 by Brian Acton and Jan Koum, both former employees of Yahoo!.

IOS DOWNLOAD

Monday, December 14, 2015

Winners of "Big Star Entertainment Awards" 2015

The Big STAR Entertainment Awards are presented by Reliance Broadcast Network Limited in association with Star India on every year.It's awards for person personality in entertainment across movies, music, television, sports, theater and dance.This award first hold on 12th December,2010.

Current year 2015 Big Start Entertainment Award (BSEW) hold on last Sunday night with full stunning performances by the Bollywood stars. Salman Khan and Deepika was most highlighted on that stage.

Here below display full list of  Big Star Entertainment Awards 2015

92.7 BIG FM – Suhana Safar Music Award :- Anu Malik
92.7 Hit Thhe Hit Rahenge :- Anil Kapoor
Most Entertaining Ensemble Cast :- Pyaar Ka Punchnama 2
Most Entertaining Romantic Film:- Prem Ratan Dhan Payo
Most Entertaining Comedy Film:- Tanu Weds Manu Returns
Star Most Entertaining Social Film :- ABCD 2
Most Entertaining Drama Film :- Piku
Most Entertaining Thriller Film : - Talvar
Most Entertaining Action Film :- Gabbar Is Back
Most Entertaining Film :- Prem Ratan Dhan Payo
Most Entertaining Actor in an Action Role – Male/Female - Varun Dhawan (Badlapur)
Most Entertaining Dance – Male/Female :- Alia Bhatt (Shaandar - ‘Gulabo’)
Most Entertaining Song :- Chittiyan Kalliyan (Roy)
Most Entertaining Music :- Himesh Reshammiya (Prem Ratan Dhan Payo)
Most Entertaining Director :- Kabir Khan (Bajrangi Bhaijaan)
Most Entertaining Child Star :- Harshaali Malhotra (Bajrangi Bhaijaan)
Most Entertaining Singer (Male) :- Armaan Malik (Tumhe Apna Banane Ka)
Most Entertaining Singer (Female) :- Palak Mucchal (Prem Ratan Dhan Payo)
Most Entertaining Actor (Film) Debut (Male) :- Omkar Kapoor (Pyaar Ka Punchnama 2)
Most Entertaining Actor (Film) Debut (Female) :- Akshara Hasan (Shamitabh), Sana Kapoor (Shaandar)
Most Entertaining Actor in a Thriller Role (Male) :- Varun Dhawan (Badlapur)
Most Entertaining Actor in a Thriller Role (Female) :- Tisca Chopra (Rahasya)
Most Entertaining Actor in a Social Role (Male) :- Salman Khan (Bajrangi Bhaijaan)
Most Entertaining Actor in a Social Role (Female) :- Bhumi Pednekar (Dum Laga Ke Haisha)
Most Entertaining Actor in a Romantic Role (Male) :- Ranveer Singh (Dil Dhadakne Do)
Most Entertaining Actor in a Romantic Role (Female) :- Sonam Kapoor (Prem Ratan Dhan Payo)
Most Entertaining Actor in a Comedy Role (Male) :- Deepak Dobriyal (Tanu Weds Manu Returns)
Most Entertaining Actor in a Comedy Role (Female) :- Nushrat Barucha (Pyaar Ka Punchnama 2)
Most Entertaining Actor in a Drama Role (Male) :- Amitabh Bachchan (Piku)
Most Entertaining Actor in a Drama Role (Female) :- Deepika Padukone (Piku)
Most Entertaining Actor of the year (Male) :- Amitabh Bachchan (Piku)
Most Entertaining Actor of the year (Female) :- Deepika Padukone (Piku)

Saturday, December 12, 2015

Solve 'integrity constraint violation:1048' Error in Magento


If you use Magento or have an own Magento store than you fetch ‘integrity constraint violation’ in some cases. This error, mostly displays when add products by CSV file and save or create products. This error displays on admin panel when any products trigger event fire.
This error is not only in Magento it’s also display many other CMS like Drupal. This error because of foreign key relation on database. In Magento many tables connected each other with foreign key and data getting according to that relation and when there is some mistake in that relation data than this type of error display.
When you import product from CSV than display ‘value’,’ attribute_id’,‘entity_id’ cannot be null or sometimes when save product data by programmatically, add from admin panel. For that here is below display simple solution.
  • If you add products from CSV than must check all data is there any null value which is required in your magneto store than fill that value.
  • If you add a product programmatically than check all products required data which is set or not.
  • When you create product from admin panel and display below error then check the database first. Check table display in error with column value and check is there any NULL or missing value? If yes then fills according to other. Example: - integrity constraint violation: 1048 column `child_id` can’t be null, query was: INSERT INTO `catalog_product_relation` (`parent_id`,`child_id`) VALUES (?, ?)
    Here below error check column `child_id` on `catalog_product_relation ` and fill NULL value. 
After complete below process clear all caches and re indexing all data and check again you will be solve this error.

View Saved Wifi Password on Android Phone Without Root


For faster Internet with smartphone Wi-Fi is most useful features instead of mobile data. If you have a broadband connection or any internet connection on PC, then you can easily connect to smartphone with WIFI. for any WIFI connection security enabler for connecting to that Wi-Fi which is called password. In smartphone when you connect to Wi-Fi with password its store on smartphone data and not enter every time when connect.
Sometimes you want to connect Wi-Fi to another device and you don't know that password then don't worry here simple process to see your connected Wi-Fi password on Android smartphone. There are many Apps for that but "ROOT" is required for all. This is a simple process that help you to find saved Wi-Fi password without "root" or "jailbreak".

  • Download The Root Explorer, OI File Manager or ES File Explorer file manager from a play store if don't have.
  • Navigate to the /data/wifi/ or to the /data/misc/wifi/ folder according to the device.
  • In /data/wifi/ look for and open a file named `bcm_supp.conf` and In /data/misc/wifi/ look for and open a file named `wpa_suppliciant.conf`.
  • open one of below config file in any text editor according to the device.
  • when you open that then there is lots of Wi-Fi data from that data see below sequence for each WI-Fi password.
    
    network={ssid="WIFI_NETWORK_NAME"
             psk="WIFI_PASSWORD"
             key_mgmt=WPA-PSK
             priority=1
            }
    

    From below code see `psk` value according to Wi-Fi connection name(`ssid`).

Convert Your Android Phone into Wireless Mouse & Keyboard

 
If you use your compute and want to work with sit anywhere in front of computer screen that time you must require wireless mouse and keyboard or miss that.If you not purchase wireless mouse or keyboard than don't worry you can do that with your Android  phone.Here below describe simple steps for that if you have wifi laptop or wifi device for computer.
  • Open/On Wifi from your laptop or computer.
  • For that download Mouse & Keyboard Remote App to your Android device and run that.
  • Now you must download this apps server for you computer where you want to use wireless mouse & keyboard.
  • Download Android server for window from Here.
  • Install `Remote Control Server`on your computer or laptop.
  • Now click on Menu ->Add a new Devices on your phone's Mouse & Keyboard Remote App.
  • Connect that app to your computer's Wifi.
  •  Now you can use wireless mouse and keyboard by click on mouse and keyboard icon on APP
Here easily turn your Android Phone into wireless keyboard ans mouse.You can also use iphone for download same IOS as wireless keyboard and mouse.This apps not require any data connection so you can use without internet access.

Saturday, November 28, 2015

Add new product programmatically in Magento


In Magento development sometimes you need to add product from front end or outside of Magento folder than must add new product as programmatically. Magento provides added product features from admin panel so you can add different types of products from admin panel according to requirement. In Magento there are six types of products
  • Simple Products
  • Grouped Products
  • Configurable Products
  • Virtual Products
  • Bundled Products
  • Downloadable Products
Here below display code for adding product as programmatically according to different product types. For that you much create any PHP file in the Magento root directory by adding `app/Mage. php` file. If you want to add below code in Mageto theme files, then no need to add `Mage.php` file.

SIMPLE PRODUCT / VIRTUAL PRODUCT


require_once "app/Mage.php";
if (!Mage::isInstalled())
{
  echo "Application is not installed yet, please complete install wizard first.";exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$simpleproduct = Mage::getModel('catalog/product');
$simpleproduct->setName('PRODUCT NAME');
$simpleproduct->setSku('PRODUCT SKU');
$simpleproduct->setShortDescription('SHORT DESCRIPTION');
$simpleproduct->setDescription('PRODUCT FULL DESCRIPTION');
$simpleproduct->setTypeId('simple'); //set product type
$simpleproduct->setWeight(0); //set product weight
$simpleproduct->setNewsFromDate('08-20-2014'); //product set as new from
$simpleproduct->setNewsToDate('09-20-2014'); //product set as new to
$simpleproduct->setPrice(10.01); //set product price
$simpleproduct->setSpecialPrice(00.44); //set product special price
$simpleproduct->setSpecialFromDate('08-20-2014'); //special price from (MM-DD-YYYY)
$simpleproduct->setSpecialToDate('09-20-2014'); //special price to (MM-DD-YYYY)
$simpleproduct->setMsrpEnabled(1); //apply MAP
$simpleproduct->setMsrpDisplayActualPriceType(4); //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)
$simpleproduct->setMsrp(12.0); //manufacturer's suggested retail price
$simpleproduct->setTaxClassId(0); //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
$simpleproduct->setCreatedAt(strtotime('now'));
$simpleproduct->setCountryOfManufacture('IN'); //set 2 latters country name 
$simpleproduct->setAttributeSetId(Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId()); //set default attribute id
$simpleproduct->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //get store website ids
$simpleproduct->setStatus(1); //product status (1 - enabled,2 - disabled)
$simpleproduct->setVisibility(4); //set product visibility (1 - Not Visible Individually,2 - Catalog,3 - Search,4 - Catalog, Search)
$stock_data=array(
   'use_config_manage_stock' => 1, //use config settings checkbox
   'qty' => trim(10), //quantity
   'min_qty' => 0, 
   'use_config_min_qty'=>1,
   'min_sale_qty' => 0, //minimum quantity allowed in shopping cart
   'use_config_min_sale_qty'=>1,
   'max_sale_qty' => 9999, //maximum quantity allowed in shopping cart
   'use_config_max_sale_qty'=>1,
   'is_qty_decimal' => 0,
   'backorders' => 0,
   'notify_stock_qty' => 1,
   'is_in_stock' => 1 //stock availability
 );
$simpleproduct->setData('stock_data',$stock_data);
$simpleproduct->setCategoryIds(array(2,3)); //assign categories to product
$simpleproduct->addImageToMediaGallery('C:\1.jpg', array('image','small_image','thumbnail'), false, false);
/*
addImageToMediaGallery function parameters
1) C:\1.jpg = ABSOLUTE IMAGE PATH
2) array('image','small_image','thumbnail') = 'IMAGE DEFINE AS MAIN IMAGE,SMALL AND THUMBNAIL'
3) flase = DO NOT MOVE PRODUCT(true for remove product from source)
4) false = DISPLAY PRODUCT IN FONTEND (true for exclude product in frontend)
*/
$simpleproduct->setMetaTitle('PRODUCT META TITLE');
$simpleproduct->setMetaKeyword('PRODUCT META KEYWORDS');
$simpleproduct->setMetaDescription('PRODUCT META DESCRIPTION');
$simpleproduct->save();


GROUPED PRODUCT


$groupedproduct = Mage::getModel('catalog/product');
$groupedproduct->setName('PRODUCT NAME');
$groupedproduct->setSku('PRODUCT SKU');
$groupedproduct->setShortDescription('SHORT DESCRIPTION');
$groupedproduct->setDescription('PRODUCT FULL DESCRIPTION');
$groupedproduct->setTypeId('grouped'); //set product type
$groupedproduct->setWeight(0); //set product weight
$groupedproduct->setNewsFromDate('08-20-2014'); //product set as new from
$groupedproduct->setNewsToDate('09-20-2014'); //product set as new to
$groupedproduct->setCreatedAt(strtotime('now'));
$groupedproduct->setCountryOfManufacture('IN'); //set 2 latters country name 
$groupedproduct->setAttributeSetId(Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId()); //set default attribute id
$groupedproduct->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //get store website ids
$groupedproduct->setStatus(1); //product status (1 - enabled,2 - disabled)
$groupedproduct->setVisibility(4); //set product visibility (1 - Not Visible Individually,2 - Catalog,3 - Search,4 - Catalog, Search)
$stock_data=array(
   'is_in_stock' => 1 //stock availability
 );
$groupedproduct->setData('stock_data',$stock_data);
$groupedproduct->setCategoryIds(array(2,3)); //assign categories to product
$groupedproduct->addImageToMediaGallery('C:\1.jpg', array('image','small_image','thumbnail'), false, false);
/*
addImageToMediaGallery function parameters
1) C:\1.jpg = ABSOLUTE IMAGE PATH
2) array('image','small_image','thumbnail') = 'IMAGE DEFINE AS MAIN IMAGE,SMALL AND THUMBNAIL'
3) flase = DO NOT MOVE PRODUCT(true for remove product from source)
4) false = DISPLAY PRODUCT IN FONTEND (true for exclude product in frontend)
*/
$groupedproduct->setMetaTitle('PRODUCT META TITLE');
$groupedproduct->setMetaKeyword('PRODUCT META KEYWORDS');
$groupedproduct->setMetaDescription('PRODUCT META DESCRIPTION');
$groupedproduct->save();
$group_productid = $groupedproduct->getId(); //new saved grouped product id
Mage::getModel('catalog/product_link_api')->assign ("grouped",$group_productid,array(1,2)); //assign products as group


BUNDLE PRODUCT


$bundleproduct = Mage::getModel('catalog/product');
$bundleproduct->setName('PRODUCT NAME');
$bundleproduct->setSkuType(0); //product SKU type (0 - dynamic,1 - fixed)
$bundleproduct->setSku('PRODUCT SKU');
$bundleproduct->setShortDescription('SHORT DESCRIPTION');
$bundleproduct->setDescription('PRODUCT FULL DESCRIPTION');
$bundleproduct->setTypeId('bundle'); //set product type
$bundleproduct->setWeightType(0); //product weight type (0 - dynamic, 1 - fixed)
$bundleproduct->setWeight(0); //set product weight
$bundleproduct->setNewsFromDate('08-20-2014'); //product set as new from
$bundleproduct->setNewsToDate('09-20-2014'); //product set as new to
$bundleproduct->setPriceType(0); //price type (0 - dynamic,1 - fixed)
$bundleproduct->setPriceView(0); //price view (0 - price range,1 - as low as)
$bundleproduct->setSpecialPrice(1.0); //special price
$bundleproduct->setSpecialFromDate('08-20-2015'); //special price from (MM-DD-YYYY)
$bundleproduct->setSpecialToDate('09-20-2015'); //special price to (MM-DD-YYYY)
$bundleproduct->setCreatedAt(strtotime('now'));
$bundleproduct->setAttributeSetId(Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId()); //set default attribute id
$bundleproduct->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //get store website ids
$bundleproduct->setStatus(1); //product status (1 - enabled,2 - disabled)
$bundleproduct->setVisibility(4); //set product visibility (1 - Not Visible Individually,2 - Catalog,3 - Search,4 - Catalog, Search)
$stock_data=array(
   'use_config_manage_stock' => 1, //use config settings checkbox
   'manage_stock' => 1, //manage stock
   'is_in_stock' => 1 //stock availability
 );
$bundleproduct->setData('stock_data',$stock_data);
$bundleproduct->setCategoryIds(array(2,3)); //assign categories to product
$bundleproduct->addImageToMediaGallery('C:\1.jpg', array('image','small_image','thumbnail'), false, false);
/*
addImageToMediaGallery function parameters
1) C:\1.jpg = ABSOLUTE IMAGE PATH
2) array('image','small_image','thumbnail') = 'IMAGE DEFINE AS MAIN IMAGE,SMALL AND THUMBNAIL'
3) flase = DO NOT MOVE PRODUCT(true for remove product from source)
4) false = DISPLAY PRODUCT IN FONTEND (true for exclude product in frontend)
*/
$bundleproduct->setShipmentType(0); //shipment type (0 - together, 1 - separately)
$bundleproduct->setMetaTitle('PRODUCT META TITLE');
$bundleproduct->setMetaKeyword('PRODUCT META KEYWORDS');
$bundleproduct->setMetaDescription('PRODUCT META DESCRIPTION');
$bundleoptions = array(
 '0' => array( //option array key (0,1,2,etc..)
  'title' => 'Option 0', //option title
  'option_id' => '',
  'delete' => '',
  'type' => 'select', //option type select,radio,checkbox,multi
  'required' => '1', //option is required or not (0 - not required,1- required)
  'position' => '1' //set option position
 )
);
$bundleselections = array(
        '0' => array( //option array key according to $bundleoptions
            '0' => array( //product list array key (0,1,2,etc..)
                'product_id' => '1', //product id
                'delete' => '',
                'selection_price_value' => '10', //selected option price
                'selection_price_type' => 0,
                'selection_qty' => 1, //selected product quantity
                'selection_can_change_qty' => 0, //user can chnage quantity (0 - NO,1 - YES)
                'position' => 0,
                'is_default' => 1 //set default selected option
            )
  )
 );
Mage::register('product', $bundleproduct);
Mage::register('bundleproduct', $bundleproduct);
$bundleproduct->setCanSaveConfigurableAttributes(false);
$bundleproduct->setCanSaveCustomOptions(true);
$bundleproduct->setBundleOptionsData($bundleoptions);
$bundleproduct->setBundleSelectionsData($bundleselections);
$bundleproduct->setCanSaveBundleSelections(true);
$bundleproduct->setAffectBundleProductSelections(true);
$bundleproduct->save();


CONFIGURABLE PRODUCT


$configurableproduct = Mage::getModel('catalog/product');
$configurableproduct->setName('PRODUCT NAME');
$configurableproduct->setSku('PRODUCT SKU');
$configurableproduct->setShortDescription('SHORT DESCRIPTION');
$configurableproduct->setDescription('PRODUCT FULL DESCRIPTION');
$configurableproduct->setAttributeSetId(13); // set same attribute id which is use for configure product
$configurableproduct->setWebsiteIds(array(1));
$configurableproduct->setTypeId('configurable'); //set product type
$configurableproduct->setWeight(0); //set product weight
$configurableproduct->setNewsFromDate('08-20-2014'); //product set as new from
$configurableproduct->setNewsToDate('09-20-2014'); //product set as new to
$configurableproduct->setPrice(10.01); //set product price
$configurableproduct->setSpecialPrice(00.10); //set product special price
$configurableproduct->setSpecialFromDate('08-20-2014'); //special price from (MM-DD-YYYY)
$configurableproduct->setSpecialToDate('09-20-2014'); //special price to (MM-DD-YYYY)
$configurableproduct->setMsrpEnabled(1); //apply MAP
$configurableproduct->setMsrpDisplayActualPriceType(4); //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)
$configurableproduct->setMsrp(12.0); //manufacturer's suggested retail price
$configurableproduct->setTaxClassId(0); //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
$configurableproduct->setCreatedAt(strtotime('now'));
$configurableproduct->setCountryOfManufacture('IN'); //set 2 latters country name 
$configurableproduct->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //get store website ids
$configurableproduct->setStatus(1); //product status (1 - enabled,2 - disabled)
$configurableproduct->setVisibility(4); //set product visibility (1 - Not Visible Individually,2 - Catalog,3 - Search,4 - Catalog, Search)
$stock_data=array(
   'use_config_manage_stock' => 1, //use config settings checkbox
   'is_in_stock' => 1 //stock availability
 );
$configurableproduct->setData('stock_data',$stock_data);
$configurableproduct->setCategoryIds(array(2,3)); //assign categories to product
//$configurableproduct->addImageToMediaGallery('C:\1.jpg', array('image','small_image','thumbnail'), false, false);
/*
addImageToMediaGallery function parameters
1) C:\1.jpg = ABSOLUTE IMAGE PATH
2) array('image','small_image','thumbnail') = 'IMAGE DEFINE AS MAIN IMAGE,SMALL AND THUMBNAIL'
3) flase = DO NOT MOVE PRODUCT(true for remove product from source)
4) false = DISPLAY PRODUCT IN FONTEND (true for exclude product in frontend)
*/
$configurableproduct->setMetaTitle('PRODUCT META TITLE');
$configurableproduct->setMetaKeyword('PRODUCT META KEYWORDS');
$configurableproduct->setMetaDescription('PRODUCT META DESCRIPTION');
$configurableproduct->getTypeInstance()->setUsedProductAttributeIds(array(92)); //set attribute id here 92 attribute id for 'color'
$configurableProductsData = array();
$configurableAttributesData = $configurableproduct->getTypeInstance()->getConfigurableAttributesAsArray();
 
$simpleProductsData = array(
    'label'         => 'Black', //attribute option label
    'attribute_id'  => 92, //set attribute id here 92 attribute id for 'color'
    'value_index'   => 10, //set value of selected color here 10 is value of 'Black' color
    'is_percent'    => 0, //set option price (0 - fixed,1 - percentage)
    'pricing_value' => 100, //selected option price
);
 
$configurableProductsData[10] = $simpleProductsData; // here 10 is configure product id which is match below attribute set and value. 
$configurableAttributesData[0]['values'][] = $simpleProductsData;
$configurableproduct->setConfigurableProductsData($configurableProductsData);
$configurableproduct->setConfigurableAttributesData($configurableAttributesData);
$configurableproduct->setCanSaveConfigurableAttributes(true);
$configurableproduct->save();


DOWNLOADABLE PRODUCT


$downloadableproduct = Mage::getModel('catalog/product');
$downloadableproduct->setName('PRODUCT NAME');
$downloadableproduct->setSku('PRODUCT SKU');
$downloadableproduct->setShortDescription('SHORT DESCRIPTION');
$downloadableproduct->setDescription('PRODUCT FULL DESCRIPTION');
$downloadableproduct->setTypeId('downloadable'); //set product type
$downloadableproduct->setWeight(0); //set product weight
$downloadableproduct->setNewsFromDate('08-20-2014'); //product set as new from
$downloadableproduct->setNewsToDate('09-20-2014'); //product set as new to
$downloadableproduct->setPrice(10.01); //set product price
$downloadableproduct->setSpecialPrice(00.44); //set product special price
$downloadableproduct->setSpecialFromDate('08-20-2014'); //special price from (MM-DD-YYYY)
$downloadableproduct->setSpecialToDate('09-20-2014'); //special price to (MM-DD-YYYY)
$downloadableproduct->setMsrpEnabled(1); //apply MAP
$downloadableproduct->setMsrpDisplayActualPriceType(4); //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)
$downloadableproduct->setMsrp(12.0); //manufacturer's suggested retail price
$downloadableproduct->setTaxClassId(0); //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
$downloadableproduct->setCreatedAt(strtotime('now'));
$downloadableproduct->setCountryOfManufacture('IN'); //set 2 latters country name 
$downloadableproduct->setAttributeSetId(Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId()); //set default attribute id
$downloadableproduct->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId())); //get store website ids
$downloadableproduct->setStatus(1); //product status (1 - enabled,2 - disabled)
$downloadableproduct->setVisibility(4); //set product visibility (1 - Not Visible Individually,2 - Catalog,3 - Search,4 - Catalog, Search)
$stock_data=array(
   'use_config_manage_stock' => 1, //use config settings checkbox
   'qty' => trim(10), //quantity
   'min_qty' => 0, 
   'use_config_min_qty'=>1,
   'min_sale_qty' => 0, //minimum quantity allowed in shopping cart
   'use_config_min_sale_qty'=>1,
   'max_sale_qty' => 9999, //maximum quantity allowed in shopping cart
   'use_config_max_sale_qty'=>1,
   'is_qty_decimal' => 0,
   'backorders' => 0,
   'notify_stock_qty' => 1,
   'is_in_stock' => 1 //stock availability
 );
$downloadableproduct->setData('stock_data',$stock_data);
$downloadableproduct->setCategoryIds(array(2,3)); //assign categories to product
//$downloadableproduct->addImageToMediaGallery('C:\1.jpg', array('image','small_image','thumbnail'), false, false);
/*
addImageToMediaGallery function parameters
1) C:\1.jpg = ABSOLUTE IMAGE PATH
2) array('image','small_image','thumbnail') = 'IMAGE DEFINE AS MAIN IMAGE,SMALL AND THUMBNAIL'
3) flase = DO NOT MOVE PRODUCT(true for remove product from source)
4) false = DISPLAY PRODUCT IN FONTEND (true for exclude product in frontend)
*/
$downloadableproduct->setMetaTitle('PRODUCT META TITLE');
$downloadableproduct->setMetaKeyword('PRODUCT META KEYWORDS');
$downloadableproduct->setMetaDescription('PRODUCT META DESCRIPTION');
$downloadableproduct->setLinksTitle("Download");
$downloadableproduct->setLinksPurchaseType(0);//links can be purchased separately (0 - NO,1 - YES)
$downloadableproduct->setSamplesTitle("Sample");
$downloadableproduct->save();

$_highfilePath = "1.jpg";
$_samplefilePath = "2.jpg";
$paths = array('highurl' => $_highfilePath, 'sampleurl' => $_samplefilePath);
$samplefile[] = array(
  'file' => $_samplefilePath,
  'name' => $_samplefilePath,
  'size' => filesize($_samplefilePath),
  'status' => 'new'
);
$linkfile[] = array(
  'file' => $_highfilePath,
  'name' => $_highfilePath,
  'size' => filesize($_highfilePath),
  'status' => 'new'
);
$linkFileName = Mage::helper('downloadable/file')->moveFileFromTmp(Mage_Downloadable_Model_Link::getBaseTmpPath(),Mage_Downloadable_Model_Link::getBasePath(),$linkfile);
$linkModel = Mage::getModel('downloadable/link')->setData(array(
  'product_id' => $downloadableproduct->getId(),
  'sort_order' => 0, //set link order
  'number_of_downloads' => 0, // set numbers of download (0 - unlimited)
  'is_shareable' => 2, // shareable download link (0 - NO,1 - YES,2 - Use config) 
  'link_url' => '',
  'link_type' => 'file', //download link type url,file
  'link_file' => json_encode($linkfile),
  'sample_url' => 'http://www.site.com/1.jpg', //set sample file url
  'sample_file' => '', 
  'sample_type' => 'url', //download sample type url,file
  'use_default_title' => false, //title assign by user or not
  'title' => 'DOWNLOAD LINK TITLE',
  'default_price' => 0,
  'price' => 10, //add price for download links
  'website_id' => $downloadableproduct->getStore()->getWebsiteId(),
));
$linkModel->setLinkFile($linkFileName)->save();

$sampleFileName = Mage::helper('downloadable/file')->moveFileFromTmp(Mage_Downloadable_Model_Link::getBaseTmpPath(),Mage_Downloadable_Model_Link::getBasePath(),$samplefile);
$sampleModel = Mage::getModel('downloadable/sample')->setData(array(
  'product_id' => $downloadableproduct->getId(),
  'sort_order' => 0, //set sample order
  'sample_url' => 'http://www.site.com/1.jpg', //set sample file url
  'sample_file' => '', 
  'sample_type' => 'url', //sample file type url,file
  'title' => 'SAMPLE LINK TITLE',
  'website_id' => $downloadableproduct->getStore()->getWebsiteId(),
));
$sampleModel->setSampleFile($sampleFileName)->save();

Solve Re-indexing Error `Cannot initialize the indexer process` in Magento

If you have a Magento store than whenever you changes in attributes or product or category settings than must re-indexing data for regenerate all products URL and relation with others in website.Re-indexing website data from Admin panel  System -> Index Management.
But sometimes seen error "There was a problem with re-indexing process" or "Cannot initialize the indexer process" and all data not re-indexing mostly category flat data,product flat data.This error because of products,categories or stores and execution time.
Solve this error with follow one or more of below solutions.Must backup of your website with database before applying any method.

#Solution - 1

 

Enter into phpMyAdmin and find all tables with `PREFIX_catalog_product_flat_%` and `PREFIX_catalog_category_flat_store_%` truncate all tables and than after clear Magento caches and than try to re-indexing data


#Solution -2

 

This type of error because of large database and small execution time so increase execution time by write below code in .htaccess file.
   php_value memory_limit 256M  
   php_value max_execution_time 18000
You can also increse memory limit by writing below code in index.php file
   ini_set("memory_limit","256M");
   ini_set('max_execution_time',18000);

 

#Solution -3

 

Create new reindex.php file in magento root folder and add below code on that file.

<?php  
 require_once 'app/Mage.php';  
 $app = Mage::app('admin');  
 umask(0);  
 for ($index = 1; $index <= 8; $index++) {  
     $process = Mage::getModel('index/process')->load($index);  
     $process->reindexAll();  
 }
 ?>
than clear all caches and run file on browser as http://www.YOURSITE.com/reindex.php you can also use below shell script for run this file.
php shell/indexer.php reindex all

 

#Solution -4

 

 Enter into magento root directory clear all folder in var/ directory and set file permission as '777' including all sub folders.than run below two query in phpMyAdmin according to database prefix.
    DELETE cpop.* FROM catalog_product_option_price AS cpop
    INNER JOIN catalog_product_option AS cpo
    ON cpo.option_id = cpop.option_id
    WHERE
    cpo.type = 'checkbox' OR
    cpo.type = 'radio' OR
    cpo.type = 'drop_down';
    
    DELETE cpotp.* FROM catalog_product_option_type_price AS cpotp
    INNER JOIN catalog_product_option_type_value AS cpotv
    ON cpotv.option_type_id = cpotp.option_type_id
    INNER JOIN catalog_product_option AS cpo
    ON cpotv.option_id = cpo.option_id
    WHERE
    cpo.type <> 'checkbox' AND
    cpo.type <> 'radio' AND
    cpo.type <> 'drop_down';
After execute query clear all caches and re-indexing data.

 

#Solution -5

 

Enter into phpMyAdmin and find table `PREFIX_catalog_category_product_index`drop table from database (Disable foreign key using "SET FOREIGN_KEY_CHECKS=0").
Reset foreign key using "SET FOREIGN_KEY_CHECKS=1"than run below code in phpMyAdmin.
    ALTER TABLE `catalog_category_product_index`
    ADD CONSTRAINT `FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `FK_CATALOG_CATEGORY_PROD_IDX_PROD_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
After execute query clear all caches and re-indexing data.

Sunday, November 22, 2015

Change Current Website Language in Drupal


Drupal is an open source Content Management System based on PHP for creating a website to easily manage content, user and pages for development. For each site language is most important according to website locality and information.
When you install new Drupal than must display selection for choose site language. From there you can select language and create website in that language, but if you create website in English and then after you want to convert that into another language then you can easily convert using the Drupal admin panel.
Here below given example for convert English to French. Just follow as below steps for all other language translation.
  • First login to Drupal admin panel if not login (using http://www.yourdomain.com/user or http://www.yourdomain.com/admin)
  • Go to Modules and enable `Locale` module from CORE modules if disable.
  • Go to Configuration-> REGIONAL AND LANGUAGE-> Languages where display list of all installed languages.
  • Click on `Add language` link at top.
  • Select `PREDEFINED LANGUAGE` from selection and click on Add Language button (For French select "French (Français)") after installation success message display there.
  • Now go to http://localize.drupal.org pick language and click on co there button (for French click French and click on button on sidebar)
  • From there display language po file according to Drupal version in Drupal core download that according to your Drupal version (Ex. Download 7.XX for Drupal 7.XX version)
  • Go to Configuration-> REGIONAL AND LANGUAGE-> Translate interface in Drupal admin panel.
  • Click on Import tab at top of page.
  • Now choose po file download from Drupal localize with associate Drupal language.
After importing file new language installed into your Drupal website.configure language from Configuration-> REGIONAL AND LANGUAGE-> Languages and set French as default instead of English for complete website and its content translate into English to French.
In Translate interface Translate tab you can see all core words translation into local language. Here you can change that translation word according to use. During coding whoever you add new text with using `t('XXX')` than XXX word display there for translation. See below video for translating Drupal website one language to another language.

Monday, November 9, 2015

Add a Custom Attribute to the Category in Magento


Magento use for creating an e - commerce website so in that category is the most important functionality. When you install new Magento than there is one category named “Default Category” assign and all new categories and subcategories. We select a product category, so that a product display in associate category in Magento. So all products display in the website according to category and all category display in the Magento main menu.
In Magento category, there are some default fields provide by Magento like Name, Description, Image, Thumbnail Image, Meta Keywords and Description. When you fill the details that its display on front category page according to a filed location.
Sometimes you need an extra category filed like extra category images, link page or any date or text field so you can do with simple creating PHP file in a Magento root folder or anywhere with call “Mage.php” file for use Magento functions. Here below code for adding extra category image field with instruction for another field

require_once "app/Mage.php";
if (!Mage::isInstalled())
{
 echo "Application is not installed yet, please complete install wizard first.";
 exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$installer = new Mage_Eav_Model_Entity_Setup('core_setup'); 
$installer->startSetup();
$attribute  = array(
 'type' => 'varchar', //datetime,decimal,int,static,text,varchar
 'label'=> 'Category Image 1', //custome field label
 'input' => 'image', //date,image,media_image,gallery,multiselect,price,select,textarea,text,weight
  /*
   for date select type='datetime'
   for image/media_image/gallery select type='varchar'
   for price/weight select type='decimal'
  */
 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
 'default' => '1', //set default value
 'source'  => 'catalog/category_attribute_source_sortby', //select model for select and multiselect dropdown values
 /*
 for date 'eav/entity_attribute_backend_datetime'
 for YES/NO selection 'eav/entity_attribute_source_boolean'
 for page layout selection 'catalog/category_attribute_source_layout'
 for ENABLE/DISABLE selection 'catalog/product_status' 
 */
 'backend' => 'catalog/category_attribute_backend_image', //select backend model for save data
 /*
 for image/media_image 'catalog/category_attribute_backend_image'
 for date 'eav/entity_attribute_backend_datetime'
 for price 'catalog/product_attribute_backend_price'
 for gallery 'catalog/product_attribute_backend_media'
 */
 'required' => false, //is required or not
 'sort_order' => 1, //set order
 'group' => "General Information" //General Information,Display Settings,Custom Design
);
$installer->addAttribute('catalog_category', 'category_image_1', $attribute);
$installer->endSetup();

When you run below code file than new category fields added to your Magento admin panel. You can see on catalog->categories and edit any category. If you didn’t see them clear all caches run compile and then check again.
Now it’s also important for display or getting extra field value in front. For this, just use below code according to category id and extra field name assign while creating new in below code.

$category_id = '3'; //enter category id for get custome field data
$cat = Mage::getModel("catalog/category")->load($category_id);
echo $cat->getData('category_image_1');
//for image get full path
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/category/'.$cat->getData('category_image_1');

Sunday, October 25, 2015

Turn Your Phone into Wireless CCTV Camera

CCTV camera mostly uses in many public places for stop crime or caught criminal or any thief. In some places it is used for security. Now many person uses CCTV at home for many other reasons.But installation of CCTV camera is costly, so normal people avoid of that. so don't worry about that if you have your old smartphone, then you can convert that into the camera and see live scream on another camera. Here below simple steps for that.
  • For that you need two smartphone one for CCTV camera and one for seeing live view of that camera. for CCTV you can use any old or unused smartphone.
  • Download "AtHome Video Streamer- Monitor" apps from Google play store and install on smartphone which you want to make as camera.
  • Now download another apps "AtHome Camera - Home Security" from google play and install on that phone you want to see live video. 
  • Now run "AtHome Video Streamer" on camera phone.
  • On this application there is option for generate QR code.click on that and generate QR code.
  • Now run "AtHome Camera" on other phone which you want to see live video.
  • On this application there is option for read QR code click on it and read QR code that generate from camera phone.
  • Now both smartphone links each other.
Now, Your camera is running for CCTV use there are many options for use according to your requirement.

Set Product Quantity Dropdown Instead of Textbox in Magento


Maganto is an open source eCommerce platform for creates shopping based website. Magento also provides community and enterprise edition.community edition is free for download and easy to use for storing many products and categories.
If you use Magento very well than must know that Magento provides a product quantity selection textbox for selecting product quantity. when you add that products in the shopping cart then you can see in the chart, there is also a textbox for change product quantity. So, according to website design sometimes it's important to change that text box and replace product quantity drop-down. Then it's easy to change the textbox to selection box with some changes in below files.

1. app/design/frontend/{THEME}/default/template/catalog/product/view/addtocart.phtml
See input box for quantity and replace that to selection dropdown for that find

<input type="text" pattern="\d*" name="qty" id="qty" maxlength="12" value="<?php echo max($this->getProductDefaultQty() * 1, 1) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" />
Replace with

<select name="qty" id="qty" class="input-text qty">
<?php
        //for get current product stock.
 $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
 for($i = 1;$i<=$stock->getQty();$i++)
 {
 if($this->getProductDefaultQty() == $i){$sel = 'selected="selected"';}else{$sel = '';}
 echo '<option '.$sel.' value="'.$i.'">'.$i.'</option>';
 }
?>
</select>

Here change input box according to product type here below code only for simple product type change associate product type files according to product type.
for getting current product stock use below code as total quantity.

$qunt = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product->getProduct())->getQty();

This is changes for add dropdown on product details page for changes in shopping cart page change in below file.

2.  app/design/frontend/{THEME}/default/template/checkout/cart/item/default.phtml
See input box for quantity in table data item.find below code

<input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4"
 data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" />
Replace with

<select name="cart[<?php echo $_item->getId() ?>][qty]" id="qty" class="input-text qty">
<?php
 //for get current product stock.
 $productsstk = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getQty();
 for($i = 1;$i<=$productsstk;$i++)
 {
  if($this->getQty() == $i){$sel = 'selected="selected"';}else{$sel = '';}
  echo '<option '.$sel.' value="'.$i.'">'.$i.'</option>';
 }
?>
</select>
 
According to below files changes product quantity textbox replaced with dropdown you can apply the same change for any other files like wishlist,my cart column for setting product quantity dropdown instead of the textbox.