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

Order ID: Next, Prev, Possible Product ID: Next, Prev

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-23-2004, 04:43 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default 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
Reply With Quote
  #2  
Old 01-06-2005, 07:25 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

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!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #3  
Old 01-06-2005, 05:51 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

nope never figured it out
Reply With Quote
  #4  
Old 01-06-2005, 06:00 PM
  rjcbear's Avatar 
rjcbear rjcbear is offline
 

X-Adept
  
Join Date: Jun 2004
Location: Alabama,U.S.A
Posts: 503
 

Default

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
__________________
X-CART Gold version 4.0.14 & 4.1.11
Apache Version 1.3.29 (Unix)
EWDHosting-Quality X-cart Hosting
We will always sell you the right shoe and the left one is free.
Reply With Quote
  #5  
Old 01-07-2005, 01:35 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

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

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

Thanks again!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #6  
Old 01-08-2005, 09:24 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
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 12:36 PM.

   

 
X-Cart forums © 2001-2020