在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();
随机推荐
- 用DOS命令获取文件列表
其实就是两个命令:dir 跟 tree 在C:盘根目录下生成了一个名为“filelist.txt”的文本文件,该文件中即包含D:盘的文件夹列表. dir d:\ >c:\filelist.txt ...
- PHP PDO sqlite ,Unable to Open database file的解决方法
t.php在网站的根目录. fdy.db在inc文件夹下; t.php中sqlite路径写成相对路径 $db = new PDO('sqlite:inc/fdy.db'); 开始提示 Fatal er ...
- proxool数据库连接池配置
proxool.xml构造 <?xml version="1.0" encoding="UTF-8"?> <something-else-en ...
- rhel6使用的版本数部分intel xeon处理器时间bug
可惜在总前几天"oracle操作和维护的高级别小组"于.BBQ 上帝说,大量RHEL的bug.这bug在这个例子中,下面的URL: https://access.redhat.co ...
- PHP訪问MySql数据库 0基础篇
在站点后台,常常要与数据库打交道.本文介绍怎样使用XAMPP来管理MySql数据库及怎样用PHP来訪问MySql数据库. 一.使用XAMPP来管理MySql数据库 首先使用XAMPP打开MySql的管 ...
- SQLSERVER存储过程语法的具体解释
SQL SERVER存储过程语法: Create PROC [ EDURE ] procedure_name [ ; number ] [ { @parameter data_type } ...
- Apple Watch开发了一些细节和总结
本文旨在总结最近Watch在发展中遇到的问题和细节 1.左右Watch真机调试问题 一般的情况下,你为IOS主应用创建了一个extention,比方说Today Extension .Xcode都会自 ...
- java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layou
于Activity调用它们的定义dialog事件ActionBarImpl can only be used with a compatible window decor layout异常, 解决方法 ...
- 开始的iOS编程之前的准备
原地址:http://www.appcoda.com/what-you-need-to-begin-ios-programming/ 1.准备一台苹果设备 这段基本是废话,我就不翻译了,IOS开发你懂 ...
- <八>阅读<<大话设计模式>>该模型的外观
Facade模式其实很好理解,被表面的东西展示海报.内部的东西,你不知道(因为我们有一个好包).例如,外部和公司内部制度,5交互系统,此5互.那么第一种就是外部系统和5个系统都进行交互:另外一种就是做 ...