Navigation products details

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed May 15, 2013 10:18 am
Reply with quote
Report this post
Hello

Product navigation (previous / next product links on product details page) i'ts possible ?

In default.php does not appear the same

thanks for your support
User avatar
Fresh Boarder

GK User
Wed May 15, 2013 11:27 am
Reply with quote
Report this post
Please see following changes. Backup current file.

File: /templates/gk_storebox/html/com_virtuemart/productdetails/default.php
Lines: 74 to 83
Which is below
Code: Select all
<div class="productdetails-view">
   <?php // Back To Category Button
   if ($this->product->virtuemart_category_id) {
      $catURL =  JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id);
      $categoryName = $this->product->category_name ;
   } else {
      $catURL =  JRoute::_('index.php?option=com_virtuemart');
      $categoryName = jtext::_('COM_VIRTUEMART_SHOP_HOME') ;
   }
?>

Replace with below
Code: Select all
<div class="productdetails-view">
    <?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
    ?>

   <?php // Back To Category Button
   if ($this->product->virtuemart_category_id) {
      $catURL =  JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id);
      $categoryName = $this->product->category_name ;
   } else {
      $catURL =  JRoute::_('index.php?option=com_virtuemart');
      $categoryName = jText::_('COM_VIRTUEMART_SHOP_HOME') ;
   }
   ?>
   <div class="back-to-category">
       <a href="<?php echo $catURL ?>" class="product-details" title="<?php echo $categoryName ?>"><?php echo JText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName) ?></a>
   </div>


See you around...
User avatar
Platinum Boarder

GK User
Wed May 15, 2013 3:45 pm
Reply with quote
Report this post
Perfect ¡¡¡ :)

Thank you NormanUK
User avatar
Fresh Boarder

GK User
Wed May 15, 2013 8:18 pm
Reply with quote
Report this post
No problem at all, see you around...
User avatar
Platinum Boarder

GK User
Fri May 17, 2013 10:01 am
Reply with quote
Report this post
Hi,
I activated it also and it works!
But I would prefer to display it on bottom instead of on top page...

Kind regards,
Yo
User avatar
Gold Boarder

GK User
Sat Jun 29, 2013 11:49 am
Reply with quote
Report this post
Hi, How could we replace the product name with the words "previous and next"?

Kind regards,
User avatar
Gold Boarder

GK User
Sun Jun 30, 2013 3:50 am
Reply with quote
Report this post
Make following changes in the code I have posted.
Find below twice, one for previous and one for next page.
Code: Select all
echo JHTML::_('link', $prev_link, $this->product->neighbours ['previous'][0] ['product_name'], array('class' => 'previous-page'));
echo JHTML::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('class' => 'next-page'));

Replace with below.
Code: Select all
echo JHTML::_('link', $prev_link, 'Previous', array('class' => 'previous-page'));
echo JHTML::_('link', $next_link, 'Next', array('class' => 'next-page'));

If you are using multi language then add joomla strings to any language file and call it in the code. Such as using Next and Previous from joomla en-Gb.ini file standard joomla code.
Code: Select all
echo JHTML::_('link', $prev_link, JText::_('JPREVIOUS'), array('class' => 'previous-page'));
echo JHTML::_('link', $next_link, JText::_('JNEXT'), array('class' => 'next-page'));


See you around...
User avatar
Platinum Boarder

GK User
Sun Jun 30, 2013 7:26 pm
Reply with quote
Report this post
Hi Norman,
awesome, thanks!
I wonder if my code is ok, my prev and next links looks different (next links to home). :?
Here is my code, please let me know if is the right one:

Code: Select all
// 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, JText::_('JPREVIOUS'), array('class' => 'previous-page'));
echo JHTML::_('link', $next_link, JText::_('JNEXT'), array('class' => 'next-page'));
           }
           ?>
           <div class="clear"></div>
            </div>
        <?php } // Product Navigation END


Thanks a lot,
Kind Regards,
User avatar
Gold Boarder

GK User
Mon Jul 01, 2013 10:15 pm
Reply with quote
Report this post
@Yolingrana,

You have added next link code together with previous link code.
Following is corrent code of what you posted.
Code: Select all
     <div class="productdetails-view">
        <?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, JText::_('JPREVIOUS'), 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, JText::_('JNEXT'), array('class' => 'next-page'));
           }
           ?>
           <div class="clear"></div>
            </div>
        <?php } // Product Navigation END


See you around...
User avatar
Platinum Boarder

GK User
Tue Jul 02, 2013 1:24 pm
Reply with quote
Report this post
Opps I had the wrong code!
Thank you very much Norman!
See you around,

Kind Regards,
User avatar
Gold Boarder

GK User
Tue Jul 02, 2013 1:30 pm
Reply with quote
Report this post
No problem at all, see you around...
User avatar
Platinum Boarder


cron