服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > php教程 >

如何在OPENACART头部增加IMAGE路径?

时间:2016-01-02 21:06来源:未知 作者:最模板 点击:
因为FB分享头部需要路径 meta property=og:image content=?php echo $thumb; ? / 但是这样用缩图是找不到的 搜寻了一下 找到 system/library/document.php 增加 //add by woff public function setImage($image) { $this-imag
如何在OPENACART头部增加IMAGE路径?
  
因为FB分享头部需要路径
<meta property="og:image" content="<?php echo $thumb; ?>" />
 
但是这样用缩图是找不到的
 
搜寻了一下
找到
system/library/document.php
增加
        //add by woff
        public function setImage($image) {
                $this->image = $image;
        }
        
        public function getImage() {
                return $this->image;
        }
        //add by woff
 
catalog/controller/product/product.php
$this->document->setTitle($product_info['name']);
 
 
下面增加
                        //add by woff
                        $this->document->setImage($product_info['image']);
                        //add by woff
复制代码
 
catalog/controller/common/header.php
$this->data['description'] = $this->document->getDescription();
 
下面增加
                //add by woff
                $this->data['image'] = $this->document->getImage();
                //add by woff
 
catalog/view/theme/default/template/common/header.tpl
增加
<meta property="og:image" content="<?php echo $base; ?>image/<?php echo $image; ?>" />
 
即可
 
完成
 
(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容