|
因為FB分享頭部需要路徑
- <meta property="og:image" content="<?php echo $thumb; ?>" />
複製代碼 但是這樣用縮圖是找不到的
搜尋了一下
找到
system/library/document.php
最上面增加
- //add by woff
- private $image;
- //add by woff
複製代碼
最下面增加
- //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; ?>" />
複製代碼 即可
完成
|
|