woff 發表於 2015-5-3 01:29:42

如何在OPENACART 頭部增加IMAGE路徑?


因為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 woffcatalog/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 woffcatalog/view/theme/default/template/common/header.tpl
增加
<meta property="og:image" content="<?php echo $base; ?>image/<?php echo $image; ?>" />即可

完成



頁: [1]
查看完整版本: 如何在OPENACART 頭部增加IMAGE路徑?