• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Can I add a Next Link to the Products Detail Page?
PostPosted: Wed Oct 14, 2009 7:05 pm 
Offline
Forum Members
Forum Members

Joined: Fri Jan 09, 2009 10:00 pm
Posts: 131
Within the Products (2.43) module, I'd like to be able to click next to view next product listed under a category.  Currently, the user has to click back to the product listing. Does anyone know if there's a way I can put a Next link within the detail template of Products to allow for this?

Thanks!


Top
 Profile  
 
 Post subject: Re: Can I add a Next Link to the Products Detail Page?
PostPosted: Tue Mar 30, 2010 11:41 pm 
Offline
Forum Members
Forum Members

Joined: Fri Jan 09, 2009 10:00 pm
Posts: 131
Hi there,
I posted this thread a number of months back and still haven't figured it out.  Can anyone help me?  Thanks so much.


Top
 Profile  
 
 Post subject: Re: Can I add a Next Link to the Products Detail Page?
PostPosted: Wed Mar 31, 2010 12:20 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
you'd need to make a udt to do that.. the simplest way would be to look to the news that is much like this request.  it should be only like 2 db quires if that and you'll have the info to build the correct links... this also show how ... the news next and prev code can show you how to start.. HTH -J

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Can I add a Next Link to the Products Detail Page?
PostPosted: Wed Mar 31, 2010 12:22 am 
Offline
Forum Members
Forum Members

Joined: Fri Jan 09, 2009 10:00 pm
Posts: 131
Awesome - thanks Jeremy.  I'll look to that.  Thanks for your reply - I appreciate it.


Top
 Profile  
 
 Post subject: Re: Can I add a Next Link to the Products Detail Page?
PostPosted: Wed Mar 31, 2010 1:14 am 
Offline
Forum Members
Forum Members

Joined: Fri Jan 09, 2009 10:00 pm
Posts: 131
Hey Jeremy,
I was wondering if you might be able to help me tweak this.  I was able to make a UDT based off of a similar News one I found in the forum and it works great, except for the fact that my products are ordered by product name, not id.  I can't seem to figure out how to modify this to have it know to go in the order of product name.

Here's the code:

Code:
//Establish database connection
global $gCms;
$db =& $gCms->GetDb();

//Start Prev-Next
echo('<div class="products_prevnext">');

// Determine previous link
$sql = "SELECT MAX( id ) AS productid FROM cms_module_products WHERE id < " . $params['id'] . ";";
$dbresult =& $db->Execute($sql);
// Print previous links
while ($dbresult && $row = $dbresult->FetchRow())
{     
if($row['productid'] != '') {
  echo '<a href="products/' . $row['productid'] . '/26/">Previous</a>';
}
else {
  echo 'Previous';
}
}

//Determine next link
$sql = "SELECT MIN( id ) AS productid FROM cms_module_products WHERE id > " . $params['id'] . ";";
$dbresult =& $db->Execute($sql);

// Print next links
while ($dbresult && $row = $dbresult->FetchRow())
{     
if($row['productid'] != '') {
  echo '<a href="products/' . $row['productid'] . '/26/">Next</a>';
}
else {
  echo 'Next';
}
}

//End navigation div
echo ('</div>');


I've tried using product_name and rearrange the path (in many scenarios), but it breaks it. I'm doing something wrong that's just not clicking in my head... 

Any idea what I need to change here?

Thanks again for any help you might offer.


Top
 Profile  
 
 Post subject: Re: Can I add a Next Link to the Products Detail Page?
PostPosted: Thu Apr 01, 2010 12:24 am 
Offline
Forum Members
Forum Members

Joined: Fri Jan 09, 2009 10:00 pm
Posts: 131
*bump*... sorry to bother... is there anyone that might be able to help me out?  :-[


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Rolf


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner