News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Navigation

Started by onnie12, March 31, 2013, 19:33:16 PM

Previous topic - Next topic

onnie12

Hi

In the following code I think I need to change something to use the phrases 'Go to previous item' and 'Go to next item' instead of the product names that are used at the moment. The code is:

<?php
    // Product Navigation
    if (VmConfig::get('product_navigation', 1)) {
   ?>
        <div class="product-neighbours">
       <?php
       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);
      echo JHTML::_('link', $prev_link, $this->product->neighbours ['previous'][0]
         ['product_name'], array('class' => 'previous-page'));
       }
       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);
      echo JHTML::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('class' => 'next-page'));
       }
       ?>
       <div class="clear"></div>
        </div>
    <?php } // Product Navigation END
    ?>

I tried several things, but changing anything makes the navigation dissappear. Does anyone know what to change?
Your help is much appreciated.

Kind regards




jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

bladeke

Hello,

I have the exact same question - how to replace product names with Next item? VM 2.0.20b.

Thanks in advance,
Karl

bladeke

And figured it out - replace

echo JHTML::_('link', $prev_link, $this->product->neighbours ['previous'][0]['product_name'], array('class' => 'previous-page'));

with

echo JHTML::_('link', $prev_link, 'Previous', array('class' => 'previous-page'));