X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   'next product' & 'previous product'? (https://forum.x-cart.com/showthread.php?t=1295)

guytje 01-26-2003 11:56 PM

'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

Satyr 01-28-2003 10:36 AM

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 :wink:


All times are GMT -8. The time now is 12:16 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.