我有一个.tpl页面。我想从“产品详细信息”页面上的“标签”菜单中删除“卖方”标签,然后将其放置在独立于标签菜单的第三列中。
当我在页面上的任意位置放置用于调用卖方信息的代码块时,它将显示登录用户名而不是卖方。 我没有太多的代码知识,我也不知道该怎么做。
以下是我页面的代码:
<div class="row">
<!-- IMAGES / MEDIA -->
<div class="col-md-6 col-xl-7 mb-5">
<?php $media = $listing->getMedia(array('image', 'video')); ?>
<?php
$counter = 0;
$mediaCount = count($media);
if ($mediaCount > 0) { ?>
<div id="jq-mainImage" class="jq-loading-slider">
<?php foreach ($media as $file) { ?>
<div class="item jq-slide hidden">
<?php
if ($file['type'] == \Ppb\Service\ListingsMedia::TYPE_VIDEO) {
echo $this->videoPlayer($file);
}
else {
echo $this->thumbnail($file['value'], 800, true,
array(
'alt' => $listing['name'],
'type' => $file['type'],
'data-gallery-id' => $counter++,
'itemprop' => 'image',
));
} ?>
</div>
<?php } ?>
</div>
<?php if ($mediaCount > 1) { ?>
<div id="jq-thumbnails" class="jq-loading-slider mt-2 mx-4 no-print">
<?php foreach ($media as $file) { ?>
<div class="item jq-slide hidden">
<?php echo $this->thumbnail($file['value'], 250, true,
array('alt' => $listing['name'], 'type' => $file['type'])); ?>
</div>
<?php } ?>
</div>
<?php } ?>
<?php foreach ($media as $file) {
if ($file['type'] == \Ppb\Service\ListingsMedia::TYPE_IMAGE) { ?>
<a class="jq-gallery"
href="<?php echo $this->thumbnail()->generateImagePath($file['value']); ?>"></a>
<?php }
} ?>
<?php } ?>
</div>
<!-- /IMAGES / MEDIA -->
<div class="col-md-6 col-xl-5 mb-5">
<?php
$tabs = array();
$tabs[] = array(
'tabId' => 'details',
'title' => $this->_('Details'),
);
$tabs[] = array(
'tabId' => 'seller',
'title' => $this->_('Seller'),
);
if ($live === true) {
$tabs[] = array(
'tabId' => 'history',
'title' => $this->_('History'),
);
}
?>
<?php $activeTab = 'active'; ?>
<ul class="nav nav-pills nav-fill pb-2 mb-4 border-bottom no-print" role="tablist">
<?php foreach ($tabs as $tab) {
?>
<li class="nav-item">
<a class="nav-link <?php echo $activeTab; ?>" href="#<?php echo $tab['tabId']; ?>"
data-toggle="tab"
role="tab"><?php echo $tab['title']; ?></a>
</li>
<?php
$activeTab = '';
} ?>
</ul>
<?php $activeTab = 'show active'; ?>
<div class="tab-content">
<?php foreach ($tabs as $tab) { ?>
<div class="tab-pane fade <?php echo $activeTab; ?>" id="<?php echo $tab['tabId']; ?>"
role="tabpanel">
<?php if ($tab['tabId'] == 'details') { ?>
<h1 class="title" itemprop="name"><?php echo $listing['name']; ?></h1>
<?php if (!empty($listing['short_description'])) { ?>
<p class="short-description"><?php echo $this->renderHtml($listing['short_description']); ?></p>
<?php } ?>
<h3 class="au-price price">
<?php echo $this->partial('partials/current-price.phtml', array('listing' => $listing, 'id' => 'product-price')); ?>
</h3>
<?php if (($taxType = $listing->getTaxType()) !== false) { ?>
<div class="text-secondary"><?php echo $this->taxType($taxType)->display(); ?></div>
<?php } ?>
<?php if ($listing->isAuction()) { ?>
<?php if ($listing['reserve_price'] > 0) { ?>
<div>
<?php if ($live === true) { ?>
<span class="au-reserve">
<?php echo $this->listing()->reserveMessage(); ?>
</span>
<?php
}
else {
?>
<small class="text-danger">
<?php echo $this->_('Reserve Price:'); ?>
<?php echo $this->amount($listing['reserve_price'], $listing['currency']); ?>
</small>
<?php } ?>
</div>
<?php } ?>
<div class="au-your-bid mt-1 mb-2">
<?php echo $this->listing()->yourBid(); ?>
</div>
<?php } ?>
<?php if ($listing['end_time'] != null && !$listing['draft']) { ?>
<dl class="dl-variable dl-lg mt-1">
<dt>
<span data-feather="clock" title="<?php echo $this->_('Countdown'); ?>"></span>
</dt>
<dd class="au-countdown">
<?php echo $this->listing()->countdown(true); ?>
</dd>
</dl>
<?php } ?>
<?php if ($listing->isProduct() && $live === true) { ?>
<dl class="dl-variable mt-3">
<dt><span><?php echo $this->_('Quantity'); ?></span></dt>
<dd>
<span id="quantity-available">
<?php echo $this->listing()->availableQuantity(); ?>
</span>
</dd>
</dl>
<?php } ?>
<?php if ($listing->isClassified()) { ?>
<div class="mt-4 no-print">
<a href="#questions"
data-href="questionsTab"
class="btn btn-gold tab-link" <?php echo ($live != true) ? 'disabled' : ''; ?>>
<?php echo $this->_('Contact Seller'); ?>
</a>
</div>
<?php } ?>
<!-- PURCHASE FORM -->
<div class="mt-4 no-print">
<?php echo $this->purchaseForm; ?>
</div>
<!-- /PURCHASE FORM -->
<?php if ($live === true && $this->settings['enable_shipping'] && !$listing->isClassified()) {
$seller->getShipping()->clearData()->addData($listing);
$shippableLocations = $seller->getShipping()->getShippableLocations();
$postageTypeCarriers = ($seller->getShipping()->getPostageType() == ShippingModel::POSTAGE_TYPE_CARRIERS) ? true : false;
$showShippingCalculator = (count($shippableLocations) > 0 && !$listing->pickUpOnly()) ? true : false;
?>
<dl class="dl-variable mt-3 mb-1">
<dt><span><?php echo $this->_('Postage'); ?></span></dt>
<dd>
<?php echo (!$postageTypeCarriers || $listing->pickUpOnly()) ? $this->listing()->defaultPostage($seller->getShipping()) : ''; ?>
<?php if ($showShippingCalculator) { ?>
<?php echo (!$postageTypeCarriers) ? '<br>' : ''; ?>
<a data-toggle="collapse" href="#calculateShippingForm"
role="button" aria-expanded="false"
aria-controls="calculateShippingForm" class="no-print">
<?php echo (!$postageTypeCarriers) ? $this->_('Get Additional Rates') : $this->_('Get Rates'); ?>
<span data-feather="chevron-down"></span>
</a>
<?php } ?>
</dd>
</dl>
<?php if ($showShippingCalculator) { ?>
<div class="collapse calculate-shipping mt-3" id="calculateShippingForm">
<?php echo $this->partial('partials/shipping-calculator.phtml', array(
'quantity' => 1,
'listingId' => $listing['id'],
'user' => $seller)); ?>
</div>
<?php } ?>
<?php } ?>
<?php if ($listing->isBuyOut()) { ?>
<!-- schema.org microdata price -->
<div class="d-none" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="<?php echo $listing['currency']; ?>">
<span itemprop="price">
<?php echo $this->amount($listing['buyout_price'], $listing['currency']); ?>
</span>
</div>
<!-- /schema.org microdata price -->
<?php } ?>
<?php if ($live === true) { ?>
<div class="listing-buttons mt-5 no-print">
<!-- wish list button -->
<a class="btn btn-wishlist-async <?php echo ($listing->isWatched()) ? 'btn-gold' : 'btn-default'; ?>"
href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'listing', 'action' => 'watch', 'id' => $listing['id'])); ?>"
data-class-active="btn-gold"
data-class-default="btn-default"
data-bootbox="true"
title="<?php echo $this->_('Wish List'); ?>">
<span data-feather="heart"></span>
<?php echo $this->_('Wish List'); ?>
</a>
<!-- /wish list button -->
<?php if ($this->settings['enable_listings_sharing'] && !$listing->isDraft() && $live === true) { ?>
<!-- listing share button -->
<div class="btn-group">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span data-feather="share"></span>
<?php echo $this->_('Share'); ?>
</button>
<div class="dropdown-menu nowrap">
<div class="mx-3 my-2">
<?php echo $this->social()->listingShareLinks($listing); ?>
</div>
</div>
</div>
<!-- /listing share button -->
<?php } ?>
<!-- print button -->
<?php
echo $this->formElement('\Ppb\Form\Element\PrintButton', 'printButton', '<span data-feather="printer"></span> ' . $this->_('Print'))
->setAttributes(array(
'class' => 'btn btn-default',
'rel' => 'print-area',
))
->render();
?>
<!-- /print button -->
<?php if ($listing->isOwner()) { ?>
<!-- listing management button & dropdown -->
<div class="btn-group">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span data-feather="settings"></span>
<?php echo $this->_('Manage'); ?>
</button>
<div class="dropdown-menu dropdown-menu-right">
<?php echo $this->partial('partials/buttons-listing-manage.phtml',
array(
'listing' => $listing,
'dropdown' => true,
'all' => true,
)); ?>
</div>
</div>
<!-- /listing management button & dropdown -->
<?php }
else { ?>
<!-- report abuse -->
<a class="btn btn-default"
href="<?php echo $this->url(array('module' => 'members', 'controller' => 'messaging', 'action' => 'create', 'listing_id' => $listing['id'], 'topic_type' => \Ppb\Service\Messaging::ABUSE_REPORT_LISTING)); ?>"
title="<?php echo $this->_('Report Abuse'); ?>" rel="nofollow">
<span data-feather="voicemail"></span>
<?php echo $this->_('Report'); ?>
</a>
<!-- /report abuse -->
<?php } ?>
</div>
<?php
$isVisitorsCounter = $seller->getGlobalSettings('visitors_counter');
$isListingWatchedByBox = $seller->getGlobalSettings('listing_watched_by_box');
if ($isVisitorsCounter || $isListingWatchedByBox) { ?>
<div class="d-flex justify-content-between mt-3 pt-2 border-top no-print">
<?php if ($isListingWatchedByBox) { ?>
<small class="text-red">
<?php echo sprintf($this->_('%s watching'), $listing->countWatchers()); ?>
</small>
<?php } ?>
<?php if ($isVisitorsCounter) { ?>
<small class="text-green">
<?php echo sprintf(
$this->pluralize(
$count = $listing['nb_clicks'],
$this->_('%s view'),
$this->_('%s views')
), $count); ?>
</small>
<?php } ?>
</div>
<?php }
} ?>
<?php } ?>
<?php if ($tab['tabId'] == 'seller') { ?>
<h4 class="subtitle print-only mt-3">
<?php echo $this->_('Seller Info'); ?>
</h4>
<h6><?php echo $this->userDetails()->display(); ?></h6>
<dl class="mb-3">
<dt><?php echo $this->_('Registered Since'); ?></dt>
<dd><?php echo $this->date($seller->getData('created_at')); ?></dd>
<dt><?php echo $this->_('Feedback'); ?></dt>
<dd><?php echo $this->fieldDisplay($seller->getReputationPercentage(), null, $this->_('n/a')); ?></dd>
<dd>
<a class="btn btn-secondary no-print"
href="<?php echo $this->url($seller->otherItemsLink()); ?>">
<?php echo $this->_('View Other Items'); ?>
</a>
</dd>
<?php if ($seller->getData('store_active')) { ?>
<dt><?php echo $this->_('Store'); ?></dt>
<dd>
<a href="<?php echo $this->url($seller->storeLink()); ?>">
<?php echo $seller->storeName(); ?>
</a>
</dd>
<?php } ?>
</dl>
<?php echo $this->social()->socialMediaLinks($seller); ?>
<?php } ?>
<?php if ($tab['tabId'] == 'history') { ?>
<?php
$historyTabs = array();
if ($listing->isAuction()) {
$historyTabs[] = array(
'tabId' => 'bids',
'title' => $this->_('Bids'),
'class' => 'au-bids-history',
'content' => $this->partial('listings/history/bids.phtml',
array('listing' => $listing)),
);
}
if ($listing->isMakeOffer()) {
$historyTabs[] = array(
'tabId' => 'offers',
'title' => $this->_('Offers'),
'class' => 'au-offers-history',
'content' => $this->partial('listings/history/offers.phtml',
array('listing' => $listing)),
);
}
$historyTabs[] = array(
'tabId' => 'sales',
'title' => $this->_('Sales'),
'class' => 'au-sales-history',
'content' => $this->partial('listings/history/sales.phtml',
array('listing' => $listing)),
);
?>
<div class="no-print">
<?php if (count($historyTabs) > 1) {
$activeHistoryTab = 'active'; ?>
<ul class="nav nav-pills pb-2 mb-4 border-bottom <?php echo $activeHistoryTab; ?>"
role="tablist">
<?php foreach ($historyTabs as $historyTab) {
?>
<li class="nav-item">
<a class="nav-link <?php echo $activeHistoryTab; ?>"
href="#<?php echo $historyTab['tabId']; ?>"
data-toggle="tab"
role="tab"><?php echo $historyTab['title']; ?></a>
</li>
<?php
$activeHistoryTab = '';
} ?>
</ul>
<?php } ?>
<div class="tab-content">
<?php $activeHistoryTab = 'active'; ?>
<?php foreach ($historyTabs as $historyTab) { ?>
<div class="tab-pane <?php echo $historyTab['class']; ?> <?php echo $activeHistoryTab; ?>"
id="<?php echo $historyTab['tabId']; ?>">
<?php echo $historyTab['content']; ?>
</div>
<?php $activeHistoryTab = null; ?>
<?php
} ?>
</div>
</div>
<?php } ?>
</div>
<?php $activeTab = '';
} ?>
</div>
</div>
</div>