找回密碼
 註冊
搜索
查看: 2592|回復: 0

[教學] 如何在OPENACART 頭部增加IMAGE路徑?

  [複製鏈接]
發表於 2015-5-3 01:29:42 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
1.png
因為FB分享頭部需要路徑
  1. <meta property="og:image" content="<?php echo $thumb; ?>" />
複製代碼
但是這樣用縮圖是找不到的

搜尋了一下
找到
system/library/document.php
最上面增加
  1. //add by woff
  2. private $image;
  3. //add by woff
複製代碼


最下面增加
  1.         //add by woff
  2.         public function setImage($image) {
  3.                 $this->image = $image;
  4.         }
  5.         
  6.         public function getImage() {
  7.                 return $this->image;
  8.         }
  9.         //add by woff
複製代碼
catalog/controller/product/product.php
  1. $this->document->setTitle($product_info['name']);
複製代碼

下面增加
  1.                         //add by woff
  2.                         $this->document->setImage($product_info['image']);
  3.                         //add by woff
複製代碼

catalog/controller/common/header.php
  1. $this->data['description'] = $this->document->getDescription();
複製代碼
下面增加
  1.                 //add by woff
  2.                 $this->data['image'] = $this->document->getImage();
  3.                 //add by woff
複製代碼
catalog/view/theme/default/template/common/header.tpl
增加
  1. <meta property="og:image" content="<?php echo $base; ?>image/<?php echo $image; ?>" />
複製代碼
即可

完成



 
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-5-1 04:25 , Processed in 0.025568 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表