NivoSlider, a free jQuery powered slider
extension for Magento, allows you to display a slider on any page of
your Magento store, and it enables you
6 Steps to creating a featured products jQuery slider for Magento
This tutorial has come out of necessity
for a homepage featured product slider, I had tried quite a few
different tutorials but never achieved what I was looking for. Magento
is a great open-source ecommerce package, but Im a little surprised that
featured products isn’t a feature built-in. Hopefully this tutorial
will help. Help support open source!
Step 1: Create a Feature Products Category.
Make sure the category is directly under your root category, or this will not work.
(see screenshot). Take note of the category ID, you will need this later.
Step 2: Create a feature products block
You will need to create featured-products.phtml and place it in /app/design/frontend/yourtheme/template/catalog/product/
Use the following code in featured-products.phtml:
001
<?php
002
/**
003
* Magento
004
*
005
* NOTICE OF LICENSE
006
*
007
* This source file is subject to the Open Software License (OSL 3.0)
008
* that is bundled with this package in the file LICENSE.txt.
009
* It is also available through the world-wide-web at this URL:
Step 3: Add necessary files to /js directory which is located at the root.
If it doesnt already exist, create a /jquery directory within the /js
directory. So your path will look like this: root/js/jquery. Add the
following files to the new directory.
add jquery no conflict which prevents jQuery from screwing up
prototype which is built into Magento. Make sure that it is added to the
very end of the jQuery library file.
1
jQuery.noConflict();
Step 4: Update page.xml to reflect new /js files that were added. The path to page.xml is: /app/design/frontend/yourtheme/layout/page.xml
Step 5: Update header.phtml to call Slider function. The path to header.phtml is: /app/design/frontend/yourtheme/template/page/html/header.phtml
01
<script type="text/javascript">
02
jQuery(document).ready(function(){
03
jQuery("#slider").easySlider({
04
auto: true,
05
continuous: true,
06
numeric: true,
07
speed: 1000
08
});
09
});
10
</script>
Step 6: Add the featured products block to your homepage using the Magento CMS. The category ID can be obtained from the category ID of the featured products category that you setup in Step 1.
Voila! You now should have a featured products slider powered by jQuery and Easy Slider
on your homepage. Any products that you add to the featured products
category, will show up in this slider. And each subsequent product that
is added, will increase the numbered navigation along the bottom.
No comments:
Post a Comment