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

list all products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 01-04-2004, 12:47 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

OK, I still need help. ^^^

Please.
Reply With Quote
  #32  
Old 01-05-2004, 09:56 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Bump for "I could really use some help please X-Pals".

Puleeze.

see two posts back.
Reply With Quote
  #33  
Old 01-05-2004, 11:01 PM
 
funkydunk funkydunk is offline
 

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

Default

This variable isn't available from the template without modifying func.php.

This can be done as follows (for 3.4 site)

change func_search_products where it says:
Code:
if ($current_area == "C" && $store_language != $config["default_customer_language"]) $search_query = "select $sql_tbl[products].*, $sql_tbl[categories].category, min($sql_tbl[pricing].price) as price from $sql_tbl[pricing], $sql_tbl[categories], $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid where $sql_tbl[pricing].productid=$sql_tbl[products].productid and $sql_tbl[pricing].quantity=1 and $sql_tbl[products].categoryid=$sql_tbl[categories].categoryid $membership_condition and ($sql_tbl[pricing].membership='$membership' or $sql_tbl[pricing].membership='') and $avail_condition ".$query.$tail; else $search_query = "select $sql_tbl[products].*, $sql_tbl[categories].category, min($sql_tbl[pricing].price) as price from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories] where $sql_tbl[pricing].productid=$sql_tbl[products].productid and $sql_tbl[pricing].quantity=1 and $sql_tbl[products].categoryid=$sql_tbl[categories].categoryid $membership_condition and ($sql_tbl[pricing].membership='$membership' or $sql_tbl[pricing].membership='') and $avail_condition ".$query.$tail;

to

Code:
if ($current_area == "C" && $store_language != $config["default_customer_language"]) $search_query = "select $sql_tbl[products].*, $sql_tbl[categories].category, min($sql_tbl[pricing].price) as price from $sql_tbl[pricing], $sql_tbl[categories], $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid where $sql_tbl[pricing].productid=$sql_tbl[products].productid and $sql_tbl[pricing].quantity=1 and $sql_tbl[products].categoryid=$sql_tbl[categories].categoryid $membership_condition and ($sql_tbl[pricing].membership='$membership' or $sql_tbl[pricing].membership='') and $avail_condition ".$query.$tail; else $search_query = "select $sql_tbl[products].*, $sql_tbl[categories].category, SUBSTRING_INDEX($sql_tbl[categories].category, '\/', 1) as maincat, min($sql_tbl[pricing].price) as price from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories] where $sql_tbl[pricing].productid=$sql_tbl[products].productid and $sql_tbl[pricing].quantity=1 and $sql_tbl[products].categoryid=$sql_tbl[categories].categoryid $membership_condition and ($sql_tbl[pricing].membership='$membership' or $sql_tbl[pricing].membership='') and $avail_condition ".$query.$tail;

the top level category will then be available as:

{$products[product].maincat} in products.tpl

hth
__________________
ex x-cart guru
Reply With Quote
  #34  
Old 01-06-2004, 09:38 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Thank you FD. You are my hero!
Reply With Quote
  #35  
Old 01-06-2004, 10:54 PM
 
funkydunk funkydunk is offline
 

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

Default

Glad it worked
__________________
ex x-cart guru
Reply With Quote
  #36  
Old 02-20-2004, 08:56 AM
 
Darren Darren is offline
 

Member
  
Join Date: Dec 2002
Posts: 19
 

Default

This is a great mod, but how would we add a thumbnail picture?

Thanks!

Quote:
Originally Posted by cyberactive
Here's my php code to create a product list.

I've made a seperate php file for this. But I don't know how to integrate it into the look and feel of X-cart....

Code:
<TABLE ALIGN=CENTER VALIGN=TOP WIDTH=100%> <? $db = mysql_connect("address","username","password"); mysql_select_db("datasename",$db); $cats = mysql_query("SELECT * FROM xcart_categories order by category"); while ($row1 = mysql_fetch_array($cats)) { $currentcat = $row1["category"]; echo " <tr> <td> </td> </tr> <tr> <td width=\"300\"> <font face=\"arial\">$currentcat:</font> </td> </tr> "; $result = mysql_query("SELECT xcart_categories.category, xcart_pricing.price, xcart_products.product, xcart_products.descr FROM (xcart_categories INNER JOIN xcart_products ON xcart_categories.categoryid=xcart_products.categoryid) INNER JOIN xcart_pricing ON xcart_pricing.productid=xcart_products.productid WHERE xcart_categories.category = \"$currentcat\""); while ($myrow = mysql_fetch_array($result)) { $product = $myrow["product"]; $prijs = $myrow["price"]; $desc = $myrow["desc"]; echo " <tr> <td> <font face=\"arial\">$product</font> </td> <td width=\"100\" align=\"right\"> <font face=\"arial\">$prijs</font> </td> </tr> "; } } ?> </table>
Reply With Quote
  #37  
Old 06-01-2004, 12:51 PM
 
nerd luv nerd luv is offline
 

Advanced Member
  
Join Date: Jun 2003
Location: California, USA
Posts: 58
 

Default

Wonderful and much needed mod. Thank you much!
__________________
Always happy to Paypal over some money for X-Cart solutions. I need to get this store running! Help!
--Testing 3.5.8, heavily modified, Linux, Apache 1.3.31, PHP 4.3.4--
Reply With Quote
  #38  
Old 09-21-2004, 12:28 PM
 
WPOO WPOO is offline
 

Advanced Member
  
Join Date: May 2004
Location: Delft - Netherlands -
Posts: 31
 

Default mod not working for me with 4.03

When i installed de mod and go to the following url

www.mydomain.com/customer/total_list.php?main=listall

i get

Not Found
The requested URL /customer/index.php was not found on this server.

that is correct because there is no index.php in customer.

anyone know why it wants to go to index.php
__________________
X-Cart Gold 4.13
X-Configurator
X-ROM
Easy Checkout
Reply With Quote
  #39  
Old 09-21-2004, 12:34 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

^ Your using x-cart 4, I believe this mod is for x-cart 3.
Reply With Quote
  #40  
Old 09-24-2004, 08:42 PM
 
deonya deonya is offline
 

Member
  
Join Date: Oct 2003
Posts: 18
 

Default

I used this I have x-cart 4

<FORM method="POST" action="search.php" name="showall">
<INPUT type="hidden" name="mode" value="search">
<INPUT type="hidden" name="posted_data[by_title]" value="Y">
<INPUT type="hidden" name="posted_data[by_shortdescr]" value="Y">
<INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y">
<INPUT type="hidden" name="posted_data[substring]" size="16" value="">
Show all products{include file="buttons/search_head.tpl"}
</FORM>

I added it at the top of my site next to the drop down http://www.pixellab.biz
__________________
Deonya Fields
--------------------------
X-Cart Gold 4.0.4
--------------------------
http://www.pixellab.biz
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 05:30 AM.

   

 
X-Cart forums © 2001-2020