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)
-   -   Order ID: Next, Prev, Possible Product ID: Next, Prev (https://forum.x-cart.com/showthread.php?t=9046)

xcell67 08-23-2004 04:43 PM

Order ID: Next, Prev, Possible Product ID: Next, Prev
 
I'm sure most of you are pretty aware of the "previous" and "next" options when viewing orders. My task, to implement the same feature for product.php so the customer can shuffle through products without having to go back to products.tpl.

Example:
Customer views product b, and on product b's detailed page, there is a link to view product a and product c.

history_order.tpl:

Code:

{if $orderid_prev ne "" || $orderid_next ne ""}

{if $orderid_prev ne ""}<<{$lng.lbl_order} #{$orderid_prev}{/if}

{if $orderid_next ne ""}{if $orderid_prev ne ""} | {/if}{$lng.lbl_order} #{$orderid_next}>>{/if}


history_order.php

Code:

} else {
        $order_data = func_order_data($orderid);
        $smarty->assign("order", $order_data["order"]);
        $smarty->assign("customer", $order_data["userinfo"]);
        $smarty->assign("products", $order_data["products"]);
        $smarty->assign("giftcerts", $order_data["giftcerts"]);
        if ($order_data) {
                $owner_condition = "";
                if ($current_area == "C")
                        $owner_condition = " AND $sql_tbl[orders].login='".$login."'";
                elseif ($current_area == "P" && !$single_mode ) {
                        $owner_condition = " AND $sql_tbl[order_details].provider='".$login."'";
                }
                # find next
                $tmp = func_query_first("SELECT $sql_tbl[orders].orderid FROM $sql_tbl[orders], $sql_tbl[order_details] WHERE $sql_tbl[orders].orderid>'".$orderid."' AND $sql_tbl[order_details].orderid=$sql_tbl[orders].orderid $owner_condition ORDER BY $sql_tbl[orders].orderid ASC LIMIT 1");
                if (!empty($tmp["orderid"]))
                        $smarty->assign("orderid_next", $tmp["orderid"]);
                # find prev
                $tmp = func_query_first("SELECT $sql_tbl[orders].orderid FROM $sql_tbl[orders], $sql_tbl[order_details] WHERE $sql_tbl[orders].orderid<'".$orderid."' AND $sql_tbl[order_details].orderid=$sql_tbl[orders].orderid $owner_condition ORDER BY $sql_tbl[orders].orderid DESC LIMIT 1");
                if (!empty($tmp["orderid"]))
                        $smarty->assign("orderid_prev", $tmp["orderid"]);
        }
}


Anyone know where to start? Thanks :lol:

Jerrad 01-06-2005 07:25 AM

Hi, xcell67

I'm aware you posted this a few months ago, but did you ever
manage to implement those "previous" and "next" links/buttons
into the detailed product page?

Or maybe anybody else know how to do this?

Thanks in advance!

xcell67 01-06-2005 05:51 PM

nope never figured it out :cry:

rjcbear 01-06-2005 06:00 PM

Here guy check that link out. I use it on my site,

http://www.bcsengineering.com/store/customer/product.php?productid=85&cat=0&page=1

Kind regards,
Ricky

Jerrad 01-07-2005 01:35 AM

Thanks for the reply, xcell67.
It's a pity that you (or anybody else) never figured this out... :cry:

And thanks for the link, rjcbear.
I knew the mod already, but I hoped I could do it myself... :wink:

Thanks again!

B00MER 01-08-2005 09:24 AM

:arrow: http://www.cart-lab.com/lab/customer/product.php?productid=54

Just updated the code to better support current main category of products, and not just use productid's to base the sequence off of.

Anyhow the code is very easy to implement also.


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

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