在Magento产品页面的使用jqZoom
- <?
xml version="1.0"?>
- <config>
- <modules>
- <MagentoBoy_Jqzoom>
- <active>true</active>
- <codePool>local</codePool>
- </MagentoBoy_Jqzoom>
- </modules>
- </config>
- <?xml version="1.0"?>
- <config>
- <modules>
- <MagentoBoy_Jqzoom>
- <version>0.1.0</version>
- </MagentoBoy_Jqzoom>
- </modules>
- </config>
- <?xml version="1.0"?>
- <layout>
- <catalog_product_view>
- <reference name="head">
- <action method="addItem"><type>js</type><name>jqzoom/js/jquery.jqzoom-core.js</name></action>
- <action method="addItem"><type>js_css</type><name>jqzoom/css/jquery.jqzoom.css</name></action>
- </reference>
- <reference name="product.info.media">
- <action method="setTemplate"><template>jqzoom/media.phtml</template></action>
- </reference>
- </catalog_product_view>
- <review_product_list>
- <reference name="head">
- <action method="addItem"><type>js</type><name>jqzoom/js/jquery.jqzoom-core.js</name></action>
- <action method="addItem"><type>js_css</type><name>jqzoom/css/jquery.jqzoom.css</name></action>
- </reference>
- <reference name="product.info.media">
- <action method="setTemplate"><template>jqzoom/media.phtml</template></action>
- <action method="disableGallery"/>
- </reference>
- </review_product_list>
- </layout>
- <config>
- <frontend>
- <layout>
- <updates>
- <jqzoom>
- <file>jqzoom.xml</file>
- </jqzoom>
- </updates>
- </layout>
- </frontend>
- </config>
- <?
php
- $_product = $this->getProduct();
- $_helper = $this->helper('catalog/output');
- ?>
- <?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
- <p class="product-image">
- <a href="<?php
echo $this->helper('catalog/image')->init($_product, 'image');?>" class="jqzoom" rel="gal1" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"> - <img id="image" src="<?
php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(265);?>" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" title="<?php echo
$this->htmlEscape($this->getImageLabel());?>" style="width:265px;" /> - </a>
- </p>
- <p class="zoom-notice" id="track_hint"><?php echo $this->__('Hover
on image to zoom in the picture') ?></p> - <?php else: ?>
- <p class="product-image">
- <?php
- $_img = '<img
src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'"
alt="'.$this->htmlEscape($this->getImageLabel()).'"
title="'.$this->htmlEscape($this->getImageLabel()).'"
/>'; - echo $_helper->productAttribute($_product, $_img, 'image');
- ?
>
- </p>
- <?
php endif; ?>
- <?
php if (count($this->getGalleryImages()) > 0): ?
>
- <div class="more-views">
- <h2><?php echo $this->__('More
Views') ?></h2>
- <ul>
- <li>
- <a class="zoomThumbActive" href="javascript:void(0);" rel="{gallery:'gal1',
smallimage:'<?php echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(265);?>', largeimage:'<?php echo $this->helper('catalog/image')->init($_product, 'image');?>'}" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"><img src="<?php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail')->resize(56);?>" width="56" height="56" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" /></a> - </li>
- <?php foreach ($this->getGalleryImages() as $_image): ?
>
- <li>
- <a href="javascript:void(0);" rel="{gallery:'gal1',
smallimage:'<?php echo Mage::helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(265);?>', largeimage:'<?php echo $this->helper('catalog/image')->init($_product, 'image', $_image->getFile());?>'}" title="<?php
echo $this->htmlEscape($this->getImageLabel());?>"><img src="<?php
echo Mage::helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(56);?>" width="56" height="56" alt="<?php
echo $this->htmlEscape($this->getImageLabel());?>" /></a> - </li>
- <?php endforeach; ?
>
- </ul>
- </div>
- <?
php endif; ?
>
- <script type="text/javascript">
- //<![CDATA[
- var $j = jQuery.noConflict();
- $j(document).ready(function(){
- $j('.jqzoom').jqzoom({
- 'zoomWidth' : 300,
- 'zoomHeight' : 300,
- 'xOffset' : 10,
- 'yOffset' : 0,
- 'position' : 'right',
- 'preloadImages' : true,
- 'preloadText' : 'Loading zoom',
- 'title' : true,
- 'lens' : true,
- 'imageOpacity' : '0.4',
- 'showEffect' : 'show',
- 'hideEffect' : 'hide',
- 'fadeinSpeed' : 'slow',
- 'fadeoutSpeed' : '2000'
- });
- });
- //]]>
- </script>
版权声明:本文博客原创文章。博客,未经同意,不得转载。
在Magento产品页面的使用jqZoom的更多相关文章
- Magento给新产品页面添加分页
本文介绍如何让magento创建一个带分页功能的新到产品页面,方便我们在首页或者其它CMS Page调用和展示新到产品. 在Magento我们经常有的做法是建立一个可以调用新产品的block,然后通过 ...
- 如何给magento的产品页面添加返回按钮
如何给magento的产品页面添加返回按钮,最模板提供教程 第一步: 打开 E:\xampp\htdocs\magento\skin\frontend\default\bluescale\css\st ...
- 如何修改magento产品详细页面的栏目
magento默认模板里面的产品信息页面的布局是以两栏带右侧栏显示的,那么如何修改为两栏带左侧栏或者三栏.一栏的方式显示呢?下面教大家一种很简单的方法就可以实现.下面是默认的布局预览:
- 如何实现Magento产品批量导入?
从事外贸的我们在工作中,经常需要添加成千上万个的产品,如果一个一个的去上传,要花费很多时间,有是很让人头痛,那么应该如何实现产品批量上传?如果使用的是Magento系统的话,那么你现在有福利了,因为M ...
- Magento产品批量导入方法?
从事外贸的我们在工作中,经常需要添加成千上万个的产品,如果一个一个的去上传,要花费很多时间,有是很让人头痛,那么应该如何实现产品批量上传?如果使用的是Magento系统的话,那么你现在有福利了,因为M ...
- magento产品批量导出导入
magento产品批量导出导入 博客分类: WP / Joomla! / Magento / Shopify / Drupal / Moodle / Zimbra ExcelMobile配置管理XML ...
- magento产品成功添加到购物车后跳转到不同页面 添加 add to cart 按钮
1 添加产品到购物车成功后是跳转到购物车页面或不跳转.这个在后台可以设置 system -> configuration -> After Adding a Product Redirec ...
- 如何修改magento分类页面的产品的显示个数
经常的有客户问,怎么修改分类页面的产品的个数 这个是magneto后台操作的设置问题 打开后台,在英文状态下: system-->configuration 进入后,点击catalog Prod ...
- magento 获得当前产品页面的产品id
$product_id = Mage::registry('current_product')->getId();
随机推荐
- HTC M7日文版HTL22刷机包 毒蛇2.5.0 ART NFC Sense6.0
ROM介绍 日文版的蝰蛇2.5.0简短的介绍: *根据最新的M8蝰蛇版本号2.5.0 *经过我的朋友和机器测试.功能是否正常,当然,并非所有的功能进行测试,以,假设遇到BUG请反馈 *删除国外社会.谷 ...
- ajaxFileUpload+struts2多文件上传(动态添加文件上传框)
上一篇文章http://blog.csdn.net/itmyhome1990/article/details/36396291介绍了ajaxfileupload实现多文件上传, 但仅仅是固定的文件个数 ...
- nginx随着passenger构造ruby on rails页
1.备份nginx简介 cp /opt/nginx/html/nginx.conf /opt/nginx/html/nginx.conf.bak 2.编者nginx简介 server { listen ...
- 默认情况下安装的应用程序C盘后提示权限不足,当你开始介意。。。
最近,不少用户抱怨的经销商.正在使用win 7我们的计算机系统上安装软件后,提示权限不够开放系统,无法启动软件. 在xp该系统是没有问题的.原因是,我们会选择在默认安装路径系统C-disk.和win ...
- 【Stackoverflow好问题】祛烦“!=null"()判处空语句
问题 为了避免空指针调用,我们常常会看到这种语句 ...if (someobject != null) { someobject.doCalc();}... 终于.项目中会存在大量判空代码.多么丑陋繁 ...
- 为RadComboBox添加SelectionChanging事件
代码非标准,仅供参考. using System; using System.Collections.Generic; using System.Linq; using System.Windows. ...
- 第十二章——SQLServer统计信息(3)——发现过期统计信息并处理
原文:第十二章--SQLServer统计信息(3)--发现过期统计信息并处理 前言: 统计信息是关于谓词中的数据分布的主要信息源,如果不知道具体的数据分布,优化器不能获得预估的数据集,从而不能统计需要 ...
- JAVA学习课第五十八届 — GUI
GUI Graghical User Interface(图形用户接口) java为GUI提供的对象都存在java.awt和java.swing包中 Java的GUI做的的确干只是C++等.不打算浪费 ...
- What is Observer and Observable and when we used these?
转会:http://stackoverflow.com/questions/13744450/interview-when-do-we-use-observer-and-observable
- 大虾翻译(一):jQuery.extend()
本文是在JavaScript之三里面链接内容的中文翻译.我会尽可能做到信达雅且保持作者原意不变,OK,let's Go! jQuery.extend(target,[object1],[objectN ...