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

Upselling Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-01-2003, 07:33 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Upselling Products

I can seem to get the upselling products to arrange in any type of order.

I set the order then they do their own thing.

Can someone please help with this feature? My client wants them in a particular order.

Thanks

John
Reply With Quote
  #2  
Old 04-03-2003, 10:13 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Yeah - the file to edit is modules/Upselling_products/related_products.php

Look for a line that is:

$product_links = func_query($search_query = "select DISTINCT $sql_tbl[products].*, $sql_tbl[categories].category, $sql_tbl[pricing].price from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories], $sql_tbl[product_links] where ($sql_tbl[pricing].membership='') and ($sql_tbl[pricing].productid=$sql_tbl[products].productid) and ($sql_tbl[pricing].quantity=1) and ($sql_tbl[products].categoryid=$sql_tbl[categories].categoryid) and $sql_tbl[products].forsale='Y' and ($sql_tbl[products].productid=$sql_tbl[product_links].productid2) and ($sql_tbl[product_links].productid1='$productid') ORDER BY $sql_tbl[products].product");

The thing to change is the last part - if you want to change it, change to "table_name.field_name" eg:
to order by the orderby setting in the cart admin:

ORDER BY $sql_tbl[products].orderby
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 04-03-2003, 11:56 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Error

INVALID SQL: 1109 : Unknown table 'table_name' in order clause
SQL QUERY FAILURE: select DISTINCT xcart_products.*, xcart_categories.category, xcart_pricing.price from xcart_products, xcart_pricing, xcart_categories, xcart_product_links where (xcart_pricing.membership='') and (xcart_pricing.productid=xcart_products.productid) and (xcart_pricing.quantity=1) and (xcart_products.categoryid=xcart_categories.catego ryid) and xcart_products.forsale='Y' and (xcart_products.productid=xcart_product_links.prod uctid2) and (xcart_product_links.productid1='2') ORDER BY table_name.field_name




Here is what happens when I do that
Reply With Quote
  #4  
Old 04-03-2003, 12:39 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Where I said:

The thing to change is the last part - if you want to change it, change to "table_name.field_name" eg:

table_name.field should not be put in literally, but should be replaced by the xcart table and field name as demonstrated. ie. xcart_products.orderby.

__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:54 AM.

   

 
X-Cart forums © 2001-2020