2016-09-08 3 views
1

私はJoomla 2.5.18とVirtue Mart 2.5でeshopを持っています 私の製品ページにFacebookのようなコードボタンを追加したいと思います。 私はFacebookの開発者向けツールからコードを持っている:Virtue Mart Joomlaにソーシャルメディアボタンを追加

<iframe src="https://www.facebook.com/plugins/share_button.php?href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&layout=button_count&size=small&mobile_iframe=true&width=88&height=20&appId" width="88" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

私は、ファイルを変更することで期待していた

public_htmlの/コンポーネント/ com_virtuemart /ビュー/ productdetails/TMPL/default_manufacturer.php

製造元の情報の下に製品のページに表示されるコードを追加することはできますが、何も起こりません。

<?php 
 
/** 
 
* 
 
* Show the product details page 
 
* 
 
* @package \t VirtueMart 
 
* @subpackage 
 
* @author Max Milbers, Valerie Isaksen 
 

 
* @link http://www.virtuemart.net 
 
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. 
 
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php 
 
* VirtueMart is free software. This version may have been modified pursuant 
 
* to the GNU General Public License, and as distributed it includes or 
 
* is derivative of works licensed under the GNU General Public License or 
 
* other free or open source software licenses. 
 
* @version $Id: default_manufacturer.php 5409 2012-02-09 13:52:54Z alatak $ 
 
*/ 
 
// Check to ensure this file is included in Joomla! 
 
defined('_JEXEC') or die('Restricted access'); 
 
?> 
 
<div class="manufacturer"> 
 

 

 
    <?php 
 
    $link = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' . $this->product->virtuemart_manufacturer_id . '&tmpl=component', FALSE); 
 
    $text = $this->product->mf_name; 
 

 
    /* Avoid JavaScript on PDF Output */ 
 
    if (strtolower(JRequest::getWord('output')) == "pdf") { 
 
\t echo JHTML::_('link', $link, $text); 
 
    } else { 
 
\t ?> 
 
     <span class="bold"><?php echo "123" ?><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DETAILS_MANUFACTURER_LBL') ?></span><a class="modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $link ?>"><?php echo $text ?></a> 
 
    <?PHP } ?> 
 

 
</div>

私は、トピックを調査し、生憎

CLICK SOCIAL BUTTONS

を動作しません。このような仕事をするためのいくつかのプラグインがあるように見えるか、彼らが支払われていますプロジェクトは低予算です。

答えて

0

コアまたはエクステンションのファイルを直接変更することは、次回のアップデートで失われる可能性が高いため、非常に悪い考えです。 template overrideを作成する必要があります。おそらく、あなたのアクティブなテンプレートに既に1つがあり、それが変更が適用されない理由です。

次の場所からファイルをコピーすることができます:私は、そのファイルの終わり(virtuemart 3.0.18)であなたの生成されたウィジェットを追加することであることをテストし、それいる

/templates/*your_template/html/com_virtuemart/productdetails/default_manufacturer.php 

:に

/components/com_virtuemart/views/productdetails/tmpl/default_manufacturer.php 

うまく動作します。

また、そのメーカーのテンプレートが、このコードによって(default.phpで)含まれているご注意:設定が無効のメーカーを持っているか、存在しない場合はすべてのそれは勝った製品に割り当てられた

<?php 
    // Manufacturer of the Product 
    if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) { 
     echo $this->loadTemplate('manufacturer'); 
    } 
?> 

もしそうなら負荷はありません。

希望すると便利です。

関連する問題