TShopping

 找回密碼
 註冊
搜索
查看: 2178|回復: 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, 2024-3-19 17:29 , Processed in 0.166642 second(s), 25 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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