VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: onnie12 on March 31, 2013, 19:33:16 PM

Title: Navigation
Post by: onnie12 on March 31, 2013, 19:33:16 PM
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



Title: Re: Navigation
Post by: jenkinhill on March 31, 2013, 23:23:54 PM
http://forum.virtuemart.net/index.php?topic=79799.0
Title: Re: Navigation
Post by: bladeke on July 03, 2013, 13:04:53 PM
Hello,

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

Thanks in advance,
Karl
Title: Re: Navigation
Post by: bladeke on July 03, 2013, 13:22:55 PM
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'));