因为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; ?>" />
即可
完成
|