如何在“产品详细信息”视图中显示邻居产品图像

时间:2019-10-31 09:08:10

标签: php virtuemart

我使用Joomla 3.9.12和Virtuemart 3.6.4。在产品详细信息页面上时,我想显示下一个和上一个产品及其图像和价格。现在只显示产品名称。

以下内容来自/ productdetails文件夹中的default.php文件。

<?php
// Product Navigation
if (VmConfig::get('product_navigation', 1)) {
?>
    <div class="product-neighbours">
    <?php
    $previous = $this->product->neighbours['previous'][0];
    if (!empty($this->product->neighbours ['previous'][0])) {
    $prev_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['previous'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
    echo JHtml::_('link', $prev_link, $this->product->neighbours ['previous'][0]
        ['product_name'], array('rel'=>'prev', 'class' => 'previous-page','data-dynamic-update' => '1'));
    }
    if (!empty($this->product->neighbours ['next'][0])) {
    $next_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['next'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
    echo JHtml::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('rel'=>'next','class' => 'next-page','data-dynamic-update' => '1'));
    }
    ?>
    <div class="clear"></div>
    </div>
<?php } // Product Navigation END

0 个答案:

没有答案