News:

Support the VirtueMart project and become a member

Main Menu

Forward and Back navigation buttons on product pages

Started by buzzbored, August 02, 2016, 21:38:17 PM

Previous topic - Next topic

buzzbored

I would like to know if there is anything that I can do about this. when you do a search and get products returned, then click on one you get 2 arrows (like a previous / next) with products next to them. these products aren't the previous or next in the listings from your search though. If you go to my page with all products and select one the same thing happens the forward and back arrows don't take you to the next or previous product.
Can this be fixed?
Joomla 3.5.1, VM 3.0.16, PHP 5.4.x

MagikCommerce

Hello buzzbored,
Please insert code at start of product details block in overrided template file : /templates/selected_template/html/com_virtuemart/productdetails/default.php
       
        <?php
             // Product Navigation
            if (VmConfig::get('product_navigation', 1)) {
    ?>

   <div class="product-next-prev">
<?php
     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_idFALSE);
    //$this->product->neighbours ['next'][0] ['product_name']
    echo JHtml::_('link'$next_link'', array('rel'=>'next','class' => 'product-next product-prevnext-page','data-dynamic-update' => '1'));
      }
     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_idFALSE);
    //echo JHtml::_('link', $prev_link, $this->product->neighbours ['previous'][0]['product_name']
    echo JHtml::_('link'$prev_link'', array('rel'=>'prev''class' => 'product-prev previous-page','data-dynamic-update' => '1'));
    }
?>
   
</div>
<?php
              
// Product Navigation END
?>



Enjoy!!!

buzzbored

#2
when i put this in the place to the other code i get no prev/next links. all i want is for the products to page / forward and backwards through the results - Accurately.
Joomla 3.5.1, VM 3.0.16, PHP 5.4.x