ajax link
<li class="video-li"> <a class="fancybox-video fancybox.ajax" href="<?php echo $this->getUrl('catalog/ajax/video') .'?attr=video_url_1&product_id='.$_product->getId();?>"> <img src="<?php try { echo (string)$_image_helper->init($_product, 'video_img_1')->resize(240,160); } catch(Exception $e) { ; }?>" /> </a> </li> <li class="video-li"> <a class="fancybox-video fancybox.ajax" href="<?php echo $this->getUrl('catalog/ajax/video') .'?attr=video_url_2&product_id='.$_product->getId();?>"> <img src="<?php try { echo (string)$_image_helper->init($_product, 'video_img_2')->resize(240,160); } catch(Exception $e) { ; }?>" /> </a> </li>
fancy box:
$(".fancybox-video").fancybox({ 'padding' : 0, closeBtn:false, wrapCSS : 'share_container', });
3.custom ajax controller send param to phtml
<?php class Bysoft_Mycatalog_AjaxController extends Mage_Core_Controller_Front_Action { public function shareAction(){ $this->loadLayout(); $this->renderLayout(); } public function videoAction() { /* * catalog/product/view/video.phtml*/ $_attr = $_REQUEST['attr']; $_product_id= $_REQUEST['product_id']; $block = Mage::app()->getLayout()->getBlock('product_video'); $_product = Mage::getModel('catalog/product')->load($_product_id); echo $this->getLayout()->createBlock('core/template')->setData('video',$_product->getData($_attr))->setTemplate('catalog/product/view/video.phtml')->toHtml(); }
3.custom phtml files: to load video player code
<video width="100%" height="auto" controls="controls" autoplay="autoplay" id="video"> <source src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'video/'.$this->getData('video');?>.mp4" type="video/mp4"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" EnableContextMenu="false" autostart="false" height="330" width="360" loop="false" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'video/'.$this->getData('video');?>.avi" /> </video>
相关推荐
magento lazylaod插件可以使图片异步加载 减少页面的请求次数加快页面速度
Assuming you are not using your own module, you should create a local layout file at location app/design/frontend/[package]/[theme]/layout/local.xml and assuming you are seeing the compare block which...
您的网站未达到预期效果的原因之一是图片过多。 网站加载速度是SEO在分析和排名网站时考虑的关键因素之一。... Magento 2图像延迟加载扩展允许您启用图像的延迟加载,以减小页面大小并提高网站性能。
required to use extensions in a Magento 2 installation. It contains a brief introduction to new methods introduced in the Magento 2 framework and examples on how to create basic functions. Chapter 8, ...
magento数据结构分析 magento数据字典
magik shoes magento 模板, magento 1.7 模板
You’ll start by getting a general understanding of what Magento is, why and how you should use it, and whether it is possible and feasible to migrate from an old web store to Magento 2. As you work ...
magento的SMTP插件magento的SMTP插件magento的SMTP插件
Magento 汉化语言包 放在 app/local/下面即可
深入理解Magento 由精东博客下载下来制作成pdf
Magento插件开发手册 Magento Extension Developers Guide
Athlete Magento主题,兼容Magento 1.9.x, 1.8.x, 1.7.x ,特点:完全自适应(响应式布局),自定义子主题,无限颜色,完全自定义,一键安装演示,小工具化横幅系统,颜色选择,MEGA菜单,多商店支持,自定义产品...
magento2 developers cookbook, magento 开发手册,magento教程
Magento Magento商城 Magento目录结构
主要包括的内容有:magento的常用设置、Magento模板制作教程、Magento商城_目录结构说明、Magento中文教程实用文档、常用的xml的文件的作用以及自定义模块的应用
快速在服务器上复制为另一个站,版本用的是magento,php语言
required to use extensions in a Magento 2 installation. It contains a brief introduction to new methods introduced in the Magento 2 framework and examples on how to create basic functions. Chapter 8, ...
Magento 的配置系统就像是 Magento 的心脏,支撑着 Magento 的运行。这套 配置系统掌管着几乎所有“module/model/class /template/etc”。它把整个 Magento 系统抽象出来,用一个配置文件来描述。这里的“配置文件”...
magento插件