Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

'next product' & 'previous product'?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-26-2003, 11:56 PM
 
guytje guytje is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 50
 

Default 'next product' & 'previous product'?

Hi again,

Another question: I want to add a next product/previous product button to the shop (per category, on the 'see details' page, so that a user can easily browse my product database... I'm sure this has to be possible, but I really don't know how.

Hope someone can help me.
Guy
Reply With Quote
  #2  
Old 01-28-2003, 10:36 AM
  Satyr's Avatar 
Satyr Satyr is offline
 

Member
  
Join Date: Jan 2003
Location: Lexington, KY
Posts: 20
 

Default this might help a little

Hey, Im not sure how this code would need to be modified or where it would need to go, But I did find something that might help a little

Code:
Function next2prev($count) { global $offset, $limit; if($count == 0) { echo " There are no messages to display."; exit; } $prev = $offset - 10; $newoffset = $offset + 10; if($offset == 0) { // am I on the first page yet? // I think I am :) if($newoffset < $count) { echo "<font style=\"font-family: verdana; font-size: 9pt; color: #ffffff; cursor: default;\">Previous</font> | "; slacker_link("$PHP_SELF?BID=$BID&offset=$newoffset", 'Next'); echo " "; } else { echo "<font style=\"font-family: verdana; font-size: 9pt; color: #ffffff; cursor: default;\">Previous</font> | <font style=\"font-family: verdana; font-size: 9pt; color: #ffffff; cursor: default;\">Next</font>"; } } else if($newoffset >= $count) { // am I on the first page? // looks like Im not // a prev link needs to be generated here slacker_link("$PHP_SELF?BID=$BID&offset=$prev", 'Previous'); echo " | <font style=\"font-family: verdana; font-size: 9pt; color: #ffffff; cursor: default;\">Next</font>"; echo " "; } else if($offset >= $limit) { // am I there yet? slacker_link("$PHP_SELF?BID=$BID&offset=$prev", 'Previous'); echo " | "; slacker_link("$PHP_SELF?BID=$BID&offset=$newoffset", 'Next'); echo " "; } }

Description:
This little Script build the prev- , Pages- and next- Button for a given Select-Statement.

i found it here
http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=181

hope that helps a little, Maybe someone alse here would know what to do with it
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:20 AM.

   

 
X-Cart forums © 2001-2020