Friday, February 28, 2014

Netflix engineers hack Fitbit to track when you fall asleep during a video

What do you get when a bunch of Netflix engineers participate in an internal hack day competition? Lots of really cool stuff, of course.

One group of engineers decided to use a Fitbit activity tracking gadget to determine when you fall asleep while watching a movie or TV show on Netflix. When you do finally pass out, the hack remembers the exact place in that video and allows you to resume watching at that point when you wake up.
As someone who requires the TV to be on before passing out at night, this is kind of awesome. I usually resort to watching old episodes of Star Trek Voyager, but if I could use this hacked Fitbit, I’d be able to watch stuff I’d never seen before without worrying that I’d lose my place when I fall asleep.
But that isn’t the only thing Netflix engineers did. They also managed to use Apple’s Bluetooth enabled iBeacon device to “bump” videos from one device to another — sort of like that Bump contact/business card sharing app.
For a close look at the hacking projects, check out the demo videos embedded below.

Tuesday, February 25, 2014

Moving Magento From One Server To Another Server

If you are a Magento developer sometimes you need to move the Magento eCommerce shop from one host server domain to new host server domain or from one directory location to another directory location. Migrating Magento to a new server is a simple task once you know how to do it. This “move Magento from one server to another” post will outline the steps involved to successfully migrate a Magento website.


  • Back up the files in the test server.But,Before Taking Backup Go to your test site admin backend and refresh Cache by System > Cache Management.
  • Here i'll show you how to take Backup on Test Server.First,If you have Installed Magento using softaculous Installer then Go to Softaculous Page using cpanel as shown below:














  • On Softaculous page,In the Top Right Corner Click on backup & restore  Option.After that, You Just Click on the file to Which backup You want.It will automatically take backup of all files & Folders and myaql database as well.
  • It will automatically create Folder named Softaculous where you can find all the Files as shown In below Screenshot:

  • Export the magento Database. Enter your server control panel phpmyadmin database area and EXPORT your magento shop database in to “name.sql.zip “format.
  • Now,Move magento Backup files to the new server.
    Upload the root directory (all the files) of your test magento shop backup taken on the step 1 in to the new server domain folder.
  • Import the database to the new server.
    Go to your new host account MySql Databases Under Databases Section and create a new database.After That,On that Same page,Create database user and database user password. Then open the database sql file saved on step 2 with a text editor and edit the database name mention in to the new database name as shown in Below Screenshot & save it. Then import the “name.sql.zip “database backup saved on the step 2 in to this new database.

























  • Next step is to edit the database details file. To do this go to magento live site folder, find out “app/etc/local.xml” file and enter the latest Database details which is created on the step 4.Here is the Screenshot of Local.xml. Update Field Values which you created before using mysql Databases Wizard.














  • Next is to replace old server domain name with new domain name. For this go to your new server phpmyadmin magento database and modify core_config_data table as shown below.
    1. web/unsecure/base_url     >   http://www.newdomain.com/
    2. web/secure/base_url         >   http://www.newdomain.com/
  • Refresh cache and Reindex Data.
    The final step is to clear the cache. Go to your sites admin panel (Login with the test site username and password) System > Cache management > Select all & disable cache management. Then navigate through System—>Index Management. Select fields in Status — ‘REINDEX REQUIRED’, then choose ‘Reindex Data’ from drop down and click Submit or delete all the files in “var/session” and “/var/cache” folders of new site.
  • Take a look to your new magento ecommerce store frontend.

Magento Performance Tips You Can Set From Admin Panel

Magento is slow. Seriously now, Magento is so slow that the Magento team is always going through great lengths to help store owners and hosting providers improve the overall performance of the Magento shopping cart application.
While most performance tips require deep knowledge of server management or coding experiences, I wanted to share with you 7 Magento performance tips that are easy to set from the Admin Panel. Let me know what you think and what ultimately worked for you!

1. Turn Logging Off

Most Magento developers are unaware that there is an extended mechanism for logging within Magento and that it is turned on by default. This logging mechanism was once set to be on by default and therefore, setting it off in the next release can potentially break havoc across the tens of thousands of Magento websites or extensions out there. It will probably won’t affect as many sites as one would think but this is the answer I got from Magento’s chief architect, and is a solid consideration for such software with the large base of installations as Magento.
So, what can you do about it? simple: turn it off. In the Magento Admin Panel go to “System” > “Configuration”, from the left panel choose “Advanced” from the “Advanced” Panel at the bottom left. Look for the module “Mage_Log” and set it to ‘disable’ and save.
2. Turn Compilation On
Compilation is a new feature in Magento version 1.4.x.x and above. This feature actually existed as beta and was turned off by default in previous versions of Magento but from version 1.4.x.x and on it is now turned on by default and ready for production. This new feature compiles files and scopes into more easily accessible blocks of HTML.According to the Magento Core team, using this feature provides “between 25% to 50% better performance depending on the page requested.”
To enable, go in the Magento Admin Panel to “System” > “Tools” > “Compilation” and click on the “Run Compilation Process” button.

3. Combine Javascript and CSS files

Combining files feature is now built in by default in Magento version 1.4 and above. Notice that in some versions this is still in beta and it does not compress or minify the files, only combines them. In any case, this is a great features for performance and always shows significant improvement in the browser rendering time.
To turn this on, go in the Magento Admin Panel to “System” > “Configuration”, from the left navigation panel, click on “Developer” link from the “Advance” panel (all the way at the bottom). Look for the two tabs “Javascript Settings” and “CSS Settings” and you want to select “Yes” for the Merge files options in both.
If you need additional horse power you may want to look at Fooman speedster extension which merges and compresses Javascript and CSS files on the fly. The Fooman extension also uses advanced caching mechanism for the compressed files and has more options to tweak for the more advanced store owners out there.

4. Enable Magento Flat Catalog

Magento inherently uses the EAV database module. This means that each product or category has information spread throughout dozens of tables. Every time that a product page is requested or a category page is requested a big join query is made to gather all these pieces of information and build the product object. While extremely flexible this feature is a huge bottleneck for performance – this is where the flat catalog comes handy. The flat catalog essentially allows Magento to build the same objects with one single DB query from one single DB table.
To turn this feature on, go in the Magento Admin Panel to “System” > “Configuration”, choose “Catalog” from the “Catalog” panel. Expand the top panel which should say “Frontend” and at the bottom you should see two options “Use Flat Catalog Product” and “Use Flat Catalog Category”. Set both to Yes.
Note: if these options are grayed out, you probably need to enable indexing for these features (In the “System” > “Index Management” page).

5. Avoid Using Layered Navigation if You Don’t Need It

Layered Navigation is actually a great feature for shopping carts with a large catalog. It helps your users find the right product by narrowing down the product attributes it wishes to buy. These feature unfortunately slows down Magento significantly, hence if you do not use it or understand what it is, go ahead and disable it until you are ready.
In order to disable this feature, set the attribute ‘Anchor Category’ to ‘No’ for all your categories.

6. Extend Minimally: Only Install Extensions You Need

This tip is trivial, but I often see this mistake been made by existing store owners. To install a new Magento extension is so easy these days, that many simply go for it and try out a variety of extensions. The problem is that the vast majority of these extensions may not be programmed with performance in mind, hence they are a hindrance on the site performance. Even worst, some extensions may introduce security wholes that you may never know about until it is too late. Hence, it is always a safe practice to use as little extensions as you need and never leave any extension just because you never had the time to remove it. Less extensions also means easier upgrades, which is my next performance tip.

7. Use the Latest Stable Edition & Update Often

Another trivial performance tip that many store owners skip for the sake of adding features or lack of resources is upgrading often. Magento is still in its infancy as a shopping cart platform and there are tons of features that are now being discussed and added into the core code. In the last 12 months the Magento Core team has been putting a lot of effort in closing bugs and adding performance enhancements, like the flat catalogs, caching & indexing mechanisms, and now the compilation mechanism. So, if there is a new stable version available out there you should focus on upgrading your core platform and learn in what new ways you will be able to boost performance, and most importantly sales!

Monday, February 24, 2014

Adding an Existing Block to the Theme In Drupal

Drupal’s page layout is customarily divided into a number of regions which are laid out
differently from theme to theme. For example, a theme could have regions named Left
sidebar and Right sidebar which will be displayed to the left and right hand side respectively of another region named Content. Regions serve as containers for blocks.
Blocks are self-contained elements which are located within regions and typically contain
information or functionality that is repeated consistently across multiple pages. They can
contain contextual information that complements the actual content of a page such as a block that outputs information about the author of the node currently being displayed, or static information such as a login form block or a block that displays advertisements.

For this example, we will be adding a Recent Comments block to the Left sidebar region, assuming that such a region exists, of the Garland core theme.

How to do it:

  • Login to your drupal site.
  • Navigate to Admin  | Structure |  Blocks.You'll see something like below Image.

















  • Look for the Recent Comments block under the Disabled section.
  • Click on the crosshairs icon to its left and drag the block to the Left sidebar region.
  • Alternatively, we could have simply chosen the Left sidebar in the Region drop downand then used the crosshairs to order the block within the region. This is the quickeroption when there are a lot of blocks and regions to deal with on this page.
  • Click on the Save blocks button at the bottom of the page to save our changes.
  • The block should now be visible in the left sidebar as can be seen with the Garland theme in the following screenshot:














How It Works:
  • Drupal maintains a table named blocks in its database which contains a list of all the blocks exposed by the modules in its installation. By moving the Who’s online block to the Left sidebar region, we are effectively just manipulating this table in the database. When a page is displayed, Drupal uses this table to determine the status and location of each block for the current theme and the theme system positions them accordingly.

Displaying a Different Theme For Administration in Drupal

This recipe describes how to set up Drupal to use a different theme only for administration pages. This is a frequent requirement especially on brochure sites which have a limited number of regions where blocks can be placed or have missing page elements such as breadcrumbs which reduces usability. Having a separate administration theme also comes in handy during custom theme design as the site could well be largely unusable during the initial stages of development. A stable administration interface will therefore ensure that administrative tasks can still be performed effortlessly until the new theme becomes ready.

How To Do It:
  • Login to your drupal Site.
  • Navigate to Admin | Appearance | Administration theme



















  • Choose Garland (or any other theme of choice) in the Administration theme drop down at the bottom of the page.
  • Click the Save configuration button to save our changes in the database.
  • Viewing an administration page should confirm that the specified administration theme being used in preference to the default theme.
How It Works:
  • Every time a page is displayed, Drupal checks to see if the URL of the page begins with admin. If it does and if we have specified an administration theme, Drupal overrides the default theme being used with the specified theme.

Wednesday, February 19, 2014

Adding Video On Products Page In magento

There are several ways to embed videos on products page in magento store.They Can be Added directly on to a Content Page,embedded in static block,placed on products page or category page using attributes.

Today I'll show you How to add Videos using Attributes.Take a Look:
  • Login to your admin control panel.
  • Go to Catalog --> Attributes --> Manage Attributes
  • You will see something like this: 











  • Click on "Add New Attribute" in the top right corner as shown above.
  • In Attribute Properties Column,Enter the new Product Attribute Code as "video".
  • Select Scope from drop down menu.It should be Global.
  • Select Catalog input type as "Text Field".
  • Unique Value --> No
  • Apply to all products --> Select "All Product Types".





















In FrontEnd Properties Column, Enter the values as per your Need. for example. If you want to add Video Products in search then just select option :

  • Use in Quick Search:Yes 
  • Use in Advanced Search: Yes/No
  • Used for Sorting in Product Listing: Yes




























  • After This Select manage Label/Options On left side.
  • Enter title for your video Attribute as shown below:













  • Now you Have successfully created video Attribute for adding video on product page.
  • Next Important  Part is Managing video attribute sets.
  • go to catalog --> Attributes -->manage Attributes sets
  • Select the Default Attribute set from the lIst.
  • On the right side,under "Unassigned attribute" video Attribute is listed.
  • Just Drag That Video attribute to any Group Of your choice.for example.general --> below Short Description.
  • Just see the Below Attachment
































  • Now the Important Part is to add Code in Backend To Show video On Products page.
  • For that, go to magento root Folder.
  • Then Go to app\design\frontend\base\default\template\catalog\product/view.html
  • Search for "short-description".

Immediately after that,Put this code: 

<?php if($_product->getVideo()): ?>
<iframe width="260" height="130" src="http://www.youtube.com/embed/<?php echo $_product->getVideo() ?>?rel=0" frameborder="0" allowfullscreen></iframe>
<?php endif; ?>

On the Product page,You just have to add video Code From youtube And you're done.Here is the Final attachment:


Adding Products on Homepage in Magento

Suppose Anybody Wants to put a category products on home page then here is the Solution:
  • Login to Your Admin panel.
  • then First go to catalog tab --> Manage Category
  • Click on category which you want to show on homepage.
  • just note down the category id which is mentioned on the top as shown below:












  • After that,Go to CMS --> Pages.
  • In that,Click on Home page .then click on content tab on left side.
  • Add this code wherever you want to show a category product on home page using an editor.
  • {{block type="catalog/product_list" category_id="30" template="catalog/product/list.phtml" }}
  • here in my case id is "30". add your category id.Clear the cache.
  • Go to Home page and you will see the particular category products on homepage.

Tuesday, February 18, 2014

Importing & Exporting Products in Magento Using CSV Files

If you want to make changes to multiple product or customer records, it is often more efficient to do so in a tabular interface, such as a spreadsheet. With Magento Community’s Export and Import tools which resides in System tab, you can do just that. First, you export the data from your store to a spreadsheet file. After you add or update the records in the spreadsheet, you re-import the data back to your store.

Here are the steps for Exporting Data in Magento:

  • Go to Import/export -> Data Flow-Profiles Option in the System's tab,Choose option from the List of profiles which shows that what you want to export. In these Case, We are choosing Export all products option.You'll see something like this:











After Clicking On Export All Products Screen will look like below Image:
  • Under Profile Information -> Store choose the desired store where you will be importing the products.
  • This should also match the store where you have previously created a sample product. Under Data Transfer drop down menu choose Local/Remote Server
  • Under Data Format make sure CSV / Tab Separated is selected for type and click Save Profile.















  •  Then click export all products again and click Run Profile in Popup.






















This will save a file named “export_all_products.csv” under the var/export/ directory for your Magento installation. The export success screen will look like this and will specify the filename where the products were exported.






















Now we going to see the import part.

Here are the steps for Importing Data in Magento:
  • Now you have "export_all_products.csv" file in hand.
  • Again,Just Navigate to Import/export -> Data Flow-Profiles Option in the System's tab,Choose option from the List of profiles which shows that what you want to export. In these Case, We are choosing Import all products option.You'll see something like this:










After Clicking On Import All Products Screen will look like below Image:
  • Under Profile Information -> Store choose the desired store where you will be importing the products.
  • This should also match the store where you have previously created a sample product. Under Data Transfer drop down menu choose Local/Remote Server
  • Under upload Tab make sure export_all_products file is uploaded.Check the Below Screenshot:








  • After Uploading,Just Click on Run Profile Tab.Then select the .csv file you have just uploaded from the drop down menu and click Run Profile in Popup. A status screen will open and the products will start importing.

















When the import completes you will get an export success message.

















You can now go to the products section of the Magento administrator backend and check the imported products. They will be present there and assigned to the corresponding categories with the attributes you have added for them.