X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   list all products (https://forum.x-cart.com/showthread.php?t=910)

adpboss 01-04-2004 12:47 PM

OK, I still need help. ^^^

Please.

adpboss 01-05-2004 09:56 AM

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

Puleeze.

see two posts back.

funkydunk 01-05-2004 11:01 PM

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

adpboss 01-06-2004 09:38 AM

Thank you FD. You are my hero! =D>

funkydunk 01-06-2004 10:54 PM

Glad it worked :)

Darren 02-20-2004 08:56 AM

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>



nerd luv 06-01-2004 12:51 PM

Wonderful and much needed mod. Thank you much!

WPOO 09-21-2004 12:28 PM

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

Jon 09-21-2004 12:34 PM

^ Your using x-cart 4, I believe this mod is for x-cart 3.

deonya 09-24-2004 08:42 PM

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


All times are GMT -8. The time now is 10:27 PM.

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