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)
-   -   More Categoryies for items... (https://forum.x-cart.com/showthread.php?t=2020)

cellgeek 03-26-2003 02:28 AM

More Categoryies for items...
 
Not sure if other people are having the same thing happening... but 4 categories per item just arenБ─≥t enough.... IБ─≥m forced to clone and item and add more categories with the same item... but then you get duplicate items in the search.... I have some items that go into 7 or more different categories... let me know what you guys thing...
I was writing a shopping cart script my self... and thatБ─≥s one of the things that really got my attention. The way I was doing it was having a different table in MySQL that would refer to the category and products table...
Instead of an item pointing to a category, a list of categories can be added to one product...
Example:
Category table
ID 1 - Name Something
ID 2 - Name Else

Item Table
ID 34 - First Item
ID 56 - Second Item

Link Table
CategoryID 1 - ItemID 34
CategoryID 1 - ItemID 56

And so on...
That way... You can have one item in as many categories as you want.

Let me know what you guys think.... would really like to see something like this added to the script... I know itБ─≥s a BIG change but IБ─≥m sure its well worth it.

Pogos Abdunuryan
______________________

funkydunk 03-26-2003 10:44 PM

I have been working on this mod to enable 8 categories fro each prod but as yet is unfinished.

The hardest part of it is making it so that you can modify or add products in the admin area. If all product management was via imports it would be easier (for once)

cellgeek 03-27-2003 01:12 AM

Thanks for the update... ill be waiting for this one.

funkydunk 03-27-2003 04:14 AM

will let you know when I have finished the code

John7 03-28-2003 06:59 AM

Please keep me informed
 
Please keep me informed I'd like this mod also.

Thanks

John

kangus 03-29-2003 11:00 PM

Just get it done
 
:( Had to get a site up and data imported:
ALTER TABLE `xcart_products` ADD `categoryid4` INT DEFAULT '0' NOT NULL AFTER `categoryid3` ,
ADD `categoryid5` INT DEFAULT '0' NOT NULL AFTER `categoryid4` ,
ADD `categoryid6` INT DEFAULT '0' NOT NULL AFTER `categoryid5` ,
ADD `categoryid7` INT DEFAULT '0' NOT NULL AFTER `categoryid6` ;

//line 61 in customer/products.php
$search_query = "($sql_tbl[products].categoryid='$cat' or $sql_tbl[products].categoryid1='$cat' or $sql_tbl[products].categoryid2='$cat' or $sql_tbl[products].categoryid3='$cat' or $sql_tbl[products].categoryid4='$cat' or $sql_tbl[products].categoryid5='$cat' or $sql_tbl[products].categoryid6='$cat' or $sql_tbl[products].categoryid7='$cat') and $sql_tbl[products].forsale='Y'";

The categoryid should not be in the product table, there should be a relation table with a productid joined to a categoryid that way we would have unlimited product placement and lose (in this case) 7 OR's which really SUCK.

In case your interested, the complete select: 6 AND, 6 OR and a group function, if you add the other four categories that makes it 10 OR's

select xcart_products.*, xcart_categories.category,
min(xcart_pricing.price) as price
from xcart_products, xcart_pricing, xcart_categories
where xcart_pricing.productid=xcart_products.productid
and xcart_pricing.quantity=1
and xcart_products.categoryid=xcart_categories.categor yid
AND (xcart_categories.membership=''
OR xcart_categories.membership='')
and (xcart_pricing.membership=''
or xcart_pricing.membership='')
and (xcart_products.categoryid='105'
or xcart_products.categoryid1='105'
or xcart_products.categoryid2='105'
or xcart_products.categoryid3='105'
or xcart_products.categoryid4='105')
and xcart_products.forsale='Y'
group by xcart_products.productid limit 12

cellgeek 04-01-2003 03:50 PM

After getting a reply from the admin saying its gunna take some time to make the change.. i actually sat there for a while and modified a few of the files... i now have 30 categories per item and changing it is very simple... i can add more (but im sure 30 is fine) in a few mins if needed..
i gotta look at which files i modified tho.. dont really remember.. but if anyone wants the code.. let me know and ill post it.

John7 04-01-2003 04:01 PM

Yes
 
Please post the code before you forget what you did!!!

Thanks!

cellgeek 04-01-2003 10:59 PM

SQL Stuff:
Code:

ALTER TABLE `xcart_products` ADD `categoryid4` INT DEFAULT '0' NOT NULL AFTER `categoryid3`,
ADD `categoryid5` INT DEFAULT '0' NOT NULL AFTER `categoryid4`,
ADD `categoryid6` INT DEFAULT '0' NOT NULL AFTER `categoryid5`,
ADD `categoryid7` INT DEFAULT '0' NOT NULL AFTER `categoryid6`,
ADD `categoryid8` INT DEFAULT '0' NOT NULL AFTER `categoryid7`,
ADD `categoryid9` INT DEFAULT '0' NOT NULL AFTER `categoryid8`,
ADD `categoryid10` INT DEFAULT '0' NOT NULL AFTER `categoryid9`,
ADD `categoryid11` INT DEFAULT '0' NOT NULL AFTER `categoryid10`,
ADD `categoryid12` INT DEFAULT '0' NOT NULL AFTER `categoryid11`,
ADD `categoryid13` INT DEFAULT '0' NOT NULL AFTER `categoryid12`,
ADD `categoryid14` INT DEFAULT '0' NOT NULL AFTER `categoryid13`,
ADD `categoryid15` INT DEFAULT '0' NOT NULL AFTER `categoryid14`,
ADD `categoryid16` INT DEFAULT '0' NOT NULL AFTER `categoryid15`,
ADD `categoryid17` INT DEFAULT '0' NOT NULL AFTER `categoryid16`,
ADD `categoryid18` INT DEFAULT '0' NOT NULL AFTER `categoryid17`,
ADD `categoryid19` INT DEFAULT '0' NOT NULL AFTER `categoryid18`,
ADD `categoryid20` INT DEFAULT '0' NOT NULL AFTER `categoryid19`,
ADD `categoryid21` INT DEFAULT '0' NOT NULL AFTER `categoryid20`,
ADD `categoryid22` INT DEFAULT '0' NOT NULL AFTER `categoryid21`,
ADD `categoryid23` INT DEFAULT '0' NOT NULL AFTER `categoryid22`,
ADD `categoryid24` INT DEFAULT '0' NOT NULL AFTER `categoryid23`,
ADD `categoryid25` INT DEFAULT '0' NOT NULL AFTER `categoryid24`,
ADD `categoryid26` INT DEFAULT '0' NOT NULL AFTER `categoryid25`,
ADD `categoryid27` INT DEFAULT '0' NOT NULL AFTER `categoryid26`,
ADD `categoryid28` INT DEFAULT '0' NOT NULL AFTER `categoryid27`,
ADD `categoryid29` INT DEFAULT '0' NOT NULL AFTER `categoryid28`;


------------------------------------
include/categories.php
------------------------------------
Code:

<?
#for increase speed
$enable_subcategories_count = $config["General"]["count_products"]=="Y"?1:0;

if ($current_area == "C") {
        $membership_condition = " AND ($sql_tbl[categories].membership='$user_account[membership]' OR $sql_tbl[categories].membership='') ";
} else {
        $membership_condition = "";
}

$categories_data = func_query("select $sql_tbl[categories].*, 0 as product_count from $sql_tbl[categories] ".($current_area=="C"?"where $sql_tbl[categories].avail='Y' $membership_condition ":"")." group by $sql_tbl[categories].categoryid order by ".($current_area=="C" ? "order_by" : "category"));

#
# Put all categories into $all_categories array and find current_category
# by categoryid stored in $cat
#
if(!$categories_data) $categories_data = array();

$all_categories = $categories_data;

foreach($categories_data as $category_data) {
        if ($category_data["categoryid"]==$cat) {
                $current_category = $category_data;
                        $current_category["product_count"] = array_pop(func_query_first("
                        SELECT COUNT(*) FROM $sql_tbl[products] WHERE (
                        categoryid=$category_data[categoryid]
                        OR categoryid1=$category_data[categoryid]
                        OR categoryid2=$category_data[categoryid]
                        OR categoryid3=$category_data[categoryid]
                        OR categoryid4=$category_data[categoryid]
                        OR categoryid5=$category_data[categoryid]
                        OR categoryid6=$category_data[categoryid]
                        OR categoryid7=$category_data[categoryid]
                        OR categoryid8=$category_data[categoryid]
                        OR categoryid9=$category_data[categoryid]
                        OR categoryid10=$category_data[categoryid]
                        OR categoryid11=$category_data[categoryid]
                        OR categoryid12=$category_data[categoryid]
                        OR categoryid13=$category_data[categoryid]
                        OR categoryid14=$category_data[categoryid]
                        OR categoryid15=$category_data[categoryid]
                        OR categoryid16=$category_data[categoryid]
                        OR categoryid17=$category_data[categoryid]
                        OR categoryid18=$category_data[categoryid]
                        OR categoryid19=$category_data[categoryid]
                        OR categoryid20=$category_data[categoryid]
                        OR categoryid21=$category_data[categoryid]
                        OR categoryid22=$category_data[categoryid]
                        OR categoryid23=$category_data[categoryid]
                        OR categoryid24=$category_data[categoryid]
                        OR categoryid25=$category_data[categoryid]
                        OR categoryid26=$category_data[categoryid]
                        OR categoryid27=$category_data[categoryid]
                        OR categoryid28=$category_data[categoryid]
                        OR categoryid29=$category_data[categoryid]
                        ) and $sql_tbl[products].forsale='Y'"));
        }
}

#
# Put all root categories to $categories array
# Put all subcategories of current_category to $categories array
#

foreach($all_categories as $all_category) {

        $category=$all_category["category"];

        $cur_dir_len = strlen($current_category["category"]);

        if(!strstr($category,"/")) {
            $categories[]=$all_category;
                        if(empty($current_category)) {
                            if($enable_subcategories_count)
                                        $all_category["product_count"]=array_pop(func_query_first("
                                        SELECT COUNT(*) FROM $sql_tbl[products] WHERE $sql_tbl[products].forsale='Y' and (
                                        categoryid='$all_category[categoryid]'
                                        OR categoryid1='$all_category[categoryid]'
                                        OR categoryid2='$all_category[categoryid]'
                                        OR categoryid3='$all_category[categoryid]'
                                        OR categoryid4='$all_category[categoryid]'
                                        OR categoryid5='$all_category[categoryid]'
                                        OR categoryid6='$all_category[categoryid]'
                                        OR categoryid7='$all_category[categoryid]'
                                        OR categoryid8='$all_category[categoryid]'
                                        OR categoryid9='$all_category[categoryid]'
                                        OR categoryid10='$all_category[categoryid]'
                                        OR categoryid11='$all_category[categoryid]'
                                        OR categoryid12='$all_category[categoryid]'
                                        OR categoryid13='$all_category[categoryid]'
                                        OR categoryid14='$all_category[categoryid]'
                                        OR categoryid15='$all_category[categoryid]'
                                        OR categoryid16='$all_category[categoryid]'
                                        OR categoryid17='$all_category[categoryid]'
                                        OR categoryid18='$all_category[categoryid]'
                                        OR categoryid19='$all_category[categoryid]'
                                        OR categoryid20='$all_category[categoryid]'
                                        OR categoryid21='$all_category[categoryid]'
                                        OR categoryid22='$all_category[categoryid]'
                                        OR categoryid23='$all_category[categoryid]'
                                        OR categoryid24='$all_category[categoryid]'
                                        OR categoryid25='$all_category[categoryid]'
                                        OR categoryid26='$all_category[categoryid]'
                                        OR categoryid27='$all_category[categoryid]'
                                        OR categoryid28='$all_category[categoryid]'
                                        OR categoryid29='$all_category[categoryid]'
                                        )
                                        "));
                                $subcategories[]=$all_category;
                        }
        }

        if(substr($category,0,$cur_dir_len+1) == $current_category["category"]."/" and $category!=$current_category["category"])
                if(!strstr(substr($category,$cur_dir_len+1),"/")) {
                        if($enable_subcategories_count)
                                $all_category["product_count"]=array_pop(func_query_first("
                                select count(*) from $sql_tbl[products] where $sql_tbl[products].forsale='Y' and (
                                categoryid='$all_category[categoryid]'
                                OR categoryid1='$all_category[categoryid]'
                                OR categoryid2='$all_category[categoryid]'
                                OR categoryid3='$all_category[categoryid]'
                                OR categoryid4='$all_category[categoryid]'
                                OR categoryid5='$all_category[categoryid]'
                                OR categoryid6='$all_category[categoryid]'
                                OR categoryid7='$all_category[categoryid]'
                                OR categoryid8='$all_category[categoryid]'
                                OR categoryid9='$all_category[categoryid]'
                                OR categoryid10='$all_category[categoryid]'
                                OR categoryid11='$all_category[categoryid]'
                                OR categoryid12='$all_category[categoryid]'
                                OR categoryid13='$all_category[categoryid]'
                                OR categoryid14='$all_category[categoryid]'
                                OR categoryid15='$all_category[categoryid]'
                                OR categoryid16='$all_category[categoryid]'
                                OR categoryid17='$all_category[categoryid]'
                                OR categoryid18='$all_category[categoryid]'
                                OR categoryid19='$all_category[categoryid]'
                                OR categoryid20='$all_category[categoryid]'
                                OR categoryid21='$all_category[categoryid]'
                                OR categoryid22='$all_category[categoryid]'
                                OR categoryid23='$all_category[categoryid]'
                                OR categoryid24='$all_category[categoryid]'
                                OR categoryid25='$all_category[categoryid]'
                                OR categoryid26='$all_category[categoryid]'
                                OR categoryid27='$all_category[categoryid]'
                                OR categoryid28='$all_category[categoryid]'
                                OR categoryid29='$all_category[categoryid]'
                                )
                                "));
                        $all_category["category"]=ereg_replace("^.*/","",$all_category["category"]);
                        $subcategories[]=$all_category;
                }

}
#
# Put  subcategory_count  to $subcategories array
#
if ($subcategories)
foreach($subcategories as $key =>$subcategory) {
       
        $subcategory["subcategory_count"]=0;

        foreach($all_categories as $all_category) {
                if ($all_category["categoryid"]==$subcategory["categoryid"]) {               
                        $cur_dir_len = strlen($all_category["category"]);
                        $current_subcategory=$all_category["category"];
                }               
        }
       
        foreach($all_categories as $all_category) {
                $category=$all_category["category"];
                if(substr($category,0,$cur_dir_len+1) == $current_subcategory."/" and $category!=$current_subcategory)
                        if(!strstr(substr($category,$cur_dir_len+1),"/"))
                                $subcategory["subcategory_count"]++;
        }
        $subcategories[$key]["subcategory_count"]=$subcategory["subcategory_count"];
}

#
# Generate category sequence, i.e.
# Books, Books/Poetry, Books/Poetry/Philosophy ...
#

$current_category_array = explode("/",$current_category["category"]);
$prev = $current_category_array[0];
list($key,$val)=each($current_category_array);

$new_array = array($val);

while(list($key,$val)=each($current_category_array)) {
        $new_array[] = $prev."/".$val;
        $prev = $prev."/".$val;
}
unset($current_category_array);

#
# Generate array for displaying categories sequence in location
#

$category_location=array();
reset($all_categories);

$my_cats = array ();

foreach($all_categories as $all_category) {

        $categoryid=$all_category["categoryid"];
        $category=$all_category["category"];

        $my_cats [$categoryid] = $category;
}

asort ($my_cats);

foreach ($my_cats as $categoryid => $category) {
        reset ($new_array);
        while(list($key,$val)=each($new_array))
                if ($val==$category) $category_location[]=array(ereg_replace(".*/","",$val),"home.php?cat=".$categoryid);
}

#
# Assign Smarty variables
#

$smarty->assign("allcategories",$all_categories);
$smarty->assign("categories",$categories);
$smarty->assign("subcategories",$subcategories);
$smarty->assign("current_category",$current_category);
$smarty->assign("enable_subcategories_count",$enable_subcategories_count);
$smarty->assign("cat",$cat);
?>


------------------------------
\skin1\main\product_modify.tpl
------------------------------
Code:

{* $Id: product_modify.tpl,v 1.60.2.1 2003/02/18 09:19:54 svowl Exp $ *}
{if $product.productid ne ""}
{assign var="last_location" value=$lng.lbl_product_modify}
{else}
{assign var="last_location" value=$lng.lbl_add_product}
{/if}
{ include file="location.tpl" last_location=$last_location }
{capture name=dialog}
<form name="modifyform" action="product_modify.php?productid={$product.productid}" method=post enctype="multipart/form-data">
<table border=0 cellpadding="0">
<tr>
  <td valign="top" class="ProductDetailsTitle">{$lng.lbl_classification}</td>
  <td></td>
</tr>
<tr>
  <td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td>
</tr>
<tr>
  <td></td>
  <td></td>
</tr>
<tr>
  <td class=ProductDetails>{$lng.lbl_main_category}</td>
  <td class=ProductDetails>
    <select name="categoryid">
{section name=cat_num loop=$allcategories}
<option value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid}selected{/if}>{ $allcategories[cat_num].category }</option>
{/section}
    </select>
{if $fillerror ne "" and $product.categoryid eq ""}<font class=Star>&lt;&lt;</font>{/if}
  </td>
<!--</tr>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #1</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid1">
  <OPTION value=0 {if $product.categoryid1 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
<option value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid1}selected{/if}>{ $allcategories[cat_num].category }</option>
{/section}
  </SELECT></TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #2</TD>
 <TD class=ProductDetails>

  <SELECT name="categoryid2">
  <OPTION value=0 {if $product.categoryid2 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
<OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid2}selected{/if}>{ $allcategories[cat_num].category }</OPTION>
{/section}
  </SELECT></TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #3</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid3">
  <OPTION value=0 {if $product.categoryid3 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid3}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>


<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #4</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid4">
  <OPTION value=0 {if $product.categoryid4 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid4}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #5</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid5">
  <OPTION value=0 {if $product.categoryid5 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid5}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #6</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid6">
  <OPTION value=0 {if $product.categoryid6 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid6}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #7</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid7">
  <OPTION value=0 {if $product.categoryid7 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid7}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #8</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid8">
  <OPTION value=0 {if $product.categoryid8 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid8}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #9</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid9">
  <OPTION value=0 {if $product.categoryid9 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid9}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #10</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid10">
  <OPTION value=0 {if $product.categoryid10 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid10}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #11</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid11">
  <OPTION value=0 {if $product.categoryid11 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid11}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #12</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid12">
  <OPTION value=0 {if $product.categoryid12 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid12}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #13</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid13">
  <OPTION value=0 {if $product.categoryid13 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid13}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #14</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid14">
  <OPTION value=0 {if $product.categoryid14 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid14}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #15</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid15">
  <OPTION value=0 {if $product.categoryid15 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid15}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #16</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid16">
  <OPTION value=0 {if $product.categoryid16 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid16}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #17</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid17">
  <OPTION value=0 {if $product.categoryid17 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid17}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #18</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid18">
  <OPTION value=0 {if $product.categoryid18 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid18}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #19</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid19">
  <OPTION value=0 {if $product.categoryid19 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid19}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #20</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid20">
  <OPTION value=0 {if $product.categoryid20 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid20}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #21</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid21">
  <OPTION value=0 {if $product.categoryid21 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid21}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #22</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid22">
  <OPTION value=0 {if $product.categoryid22 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid22}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #23</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid23">
  <OPTION value=0 {if $product.categoryid23 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid23}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #24</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid24">
  <OPTION value=0 {if $product.categoryid24 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid24}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #25</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid25">
  <OPTION value=0 {if $product.categoryid25 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid25}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #26</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid26">
  <OPTION value=0 {if $product.categoryid26 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid26}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #27</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid27">
  <OPTION value=0 {if $product.categoryid27 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid27}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>
<TR>
 <TD class=ProductDetails>{$lng.lbl_category} #28</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid28">
  <OPTION value=0 {if $product.categoryid28 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid28}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
<!--</TR>
<TR>-->
 <TD class=ProductDetails>{$lng.lbl_category} #29</TD>
 <TD class=ProductDetails>
  <SELECT name="categoryid29">
  <OPTION value=0 {if $product.categoryid29 eq "0"}selected{/if}></OPTION>
{section name=cat_num loop=$allcategories}
  <OPTION value="{$allcategories[cat_num].categoryid}" {if $allcategories[cat_num].categoryid eq $product.categoryid29}selected{/if}>{ $allcategories[cat_num].category }</OPTION> 
{/section}
  </SELECT>
 </TD>
</TR>


<tr>
  <td class=ProductDetails height=11>{$lng.lbl_availability}</td>
  <td class=ProductDetails height=11>
    <select name="forsale">
<option value="Y" {if $product.forsale eq "Y"}selected{/if}>{$lng.lbl_avail_for_sale}</option>
<option value="N" {if $product.forsale eq "N"}selected{/if}>{$lng.lbl_disabled}</option>
    </select>
  </td>

<td></td>
<td></td>


</tr>
</table>



<table border="0" cellpadding="0">
<tr>
  <td valign="top" class="ProductDetailsTitle">{$lng.lbl_details}</td>
  <td></td>
</tr>
<tr>
  <td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td>
</tr>
<tr>
  <td></td>
  <td></td>
</tr>
<tr>
  <td class=ProductDetails nowrap>{$lng.lbl_sku}</td>
  <td class=ProductDetails>
    <input type="text" name="productcode" size="20" value="{ $product.productcode }">
  </td>
</tr>
<tr>
  <td class=ProductDetails nowrap>{$lng.lbl_product_name}</td>
  <td class=ProductDetails>
    <input type="text" name="product" size="45" value="{ $product.product|escape }">
{if $fillerror ne "" and $product.product eq ""}<font class=Star>&lt;&lt;</font>{/if}
  </td>
</tr>
{if $active_modules.Egoods ne ""}
{include file="modules/Egoods/egoods.tpl"}
{/if}
<tr>
  <td valign="top" class=ProductDetails>{$lng.lbl_description}</td>
  <td valign="top" class=ProductDetails>
    <textarea name="descr" cols="45" rows="6">{ $product.descr|replace:"
":"\n"|escape:"html"}</textarea>
{if $fillerror ne "" and $product.descr eq ""}<font class=Star>&lt;&lt;</font>{/if}
  </td>
</tr>
<tr>
  <td valign="top" class=ProductDetails>{$lng.lbl_det_description}</td>
  <td valign="top" class=ProductDetails>
    <textarea name="fulldescr" cols="45" rows="10">
{ $product.fulldescr|replace:"
":"\n"|escape:"html"}</textarea>
  </td>
</tr>
<tr>
  <td></td>
  <td></td>
</tr>
{if $config.General.show_thumbnails eq "Y"}
<tr>
  <td class=ProductDetails valign=top height="15">{$lng.lbl_thumbnail_msg}</td>
  <td class=ProductDetails valign="middle">
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product}


    <input type="file" name="userfile">
  </td>
</tr>
{/if}
<tr>
  <td valign=middle class=Text>{$lng.lbl_price} ({$config.General.currency_symbol})</td>
  <td valign="middle">
    <input type="text" name="price" size="18" value="{if $product.productid eq ""}0.00{else}{ $product.price }{/if}">
{if $fillerror ne "" and $product.price eq ""}<font class=Star>&lt;&lt;</font>{/if}
  </td>
</tr>
<tr>
{if $config.General.use_vat eq "Y"}
<tr>
  <td valign=middle class=Text>Including VAT (%)</td>
  <td valign="middle">
    <input type="text" name="vat" size="18" value="{if $product.productid eq ""}0{else}{ $product.vat }{/if}">
  </td>
</tr>
{/if}
<tr>
  <td valign="middle" class=Text>{$lng.lbl_adv_discount} <span class=Text>
    (%)</span></td>
  <td valign="middle">
    <input type="text" name="discount" size="18" value="{if $product.productid eq ""}0{else}{$product.discount}{/if}">
  </td>
</tr>
<tr>
  <td valign="middle" class=ProductDetails>{$lng.lbl_quantity_in_stock}</td>
  <td valign="middle" class=ProductDetails>
    <input type="text" name="avail" size="18" value="{if $product.productid eq ""}1000{else}{ $product.avail }{/if}">
{if $fillerror ne "" and $product.avail eq ""}<font class=Star>&lt;&lt;</font>{/if}
  </td>
</tr>
<tr>
  <td valign="middle" class=ProductDetails>{$lng.lbl_lowlimit_in_stock}</td>
  <td valign="middle" class=ProductDetails>
    <input type="text" name="low_avail_limit" size="18" value="{if $product.productid eq ""}10{else}{ $product.low_avail_limit }{/if}">
{if $fillerror ne "" and $product.low_avail_limit le 0}<font class=Star>&lt;&lt;</font>{/if}
  </td>
</tr>
<TR>
  <TD valign=middle class=ProductDetails>{$lng.lbl_min_order_amount}</TD>
  <TD valign=middle class=ProductDetails>
    <INPUT type=text name=min_amount size=18 value="{if $product.productid eq ""}1{else}{$product.min_amount}{/if}">
  </TD>
</TR>
<tr>
  <td valign="middle" class=ProductDetails>{$lng.lbl_weight} ({$config.General.weight_symbol})</td>
  <td valign="middle" class=ProductDetails>
    <input type="text" name="weight" size="18" value="{if $product.productid eq ""}0.00{else}{ $product.weight }{/if}">
  </td>
</tr>
<tr>
  <td class=ProductDetails height="11">{$lng.lbl_free_shipping}</td>
  <td class=ProductDetails height="11">
  <select name=free_shipping>
        <option value='N' {if ($product.free_shipping eq 'N')} selected {/if}>{$lng.lbl_no}</option>
        <option value='Y' {if ($product.free_shipping eq 'Y')} selected {/if}>{$lng.lbl_yes}</option>
  </select>
  </td>
</tr>
<TR>
 <TD class=ProductDetails height="11">{$lng.lbl_shipping_freight} ({$config.General.currency_symbol})</TD>
 <TD class=ProductDetails height="11">
  <INPUT type=text name=shipping_freight size="18" value="{if $product.shipping_freight eq ""}0.00{else}{$product.shipping_freight}{/if}">
 </TD>
</TR>
<TR>
 <TD class=ProductDetails height="11">{$lng.lbl_apply_global_discounts}</TD>
 <TD class=ProductDetails height="11">
  <INPUT type=checkbox name=discount_avail value="Y" {if $product.productid eq ""}checked{elseif $product.discount_avail eq "Y"}checked{/if}>
 </TD>
</TR>
{if $active_modules.Extra_Fields ne ""}
{include file="modules/Extra_Fields/product_modify.tpl"}
{/if}
<tr>
<td colspan=2 align=center>


<input type=submit value="{$lng.lbl_submit_changes}">
</td>
</tr>
</table>



<input type=hidden name=productid value="{$product.productid}">
<input type=hidden name=mode value=product_modify>
</form>
{/capture}
{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"}
{if $product.productid ne ""}


{if $product_languages ne "" or $other_languages}
{include file="main/products_lng.tpl"}


{/if}
{if $active_modules.Subscriptions ne ""}
{include file="modules/Subscriptions/subscription_plans.tpl"}
{/if}


{if $active_modules.Product_Options ne ""}
{include file="modules/Product_Options/product_options.tpl"}
{/if}
{if $active_modules.Wholesale_Trading ne ""}


{include file="modules/Wholesale_Trading/product_wholesale.tpl"}
{/if}
{if $active_modules.Upselling_Products ne ""}


{include file="modules/Upselling_Products/product_links.tpl"}
{/if}
{if $active_modules.Detailed_Product_Images ne ""}


{include file="modules/Detailed_Product_Images/product_images_modify.tpl"}
{/if}
{if $active_modules.Tax_Zones ne ""}


{include file="modules/Tax_Zones/product_taxes.tpl"}
{/if}
{if $active_modules.Customer_Reviews ne ""}


{include file="modules/Customer_Reviews/admin_reviews.tpl"}
{/if}
{/if}


---------------------
\customer\products.php
---------------------
Code:

<?
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart                                                                      |
| Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved.            |
+-----------------------------------------------------------------------------+
| The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized  |
| reproduction of software or use of illegally obtained software. Making      |
| illegal copies of software is prohibited. Individuals who violate copyright |
| law and software licensing agreements may be subject to criminal or civil  |
| action by the owner of the copyright.                                      |
|                                                                            |
| 1. It is illegal to copy a software, and install that single program for    |
| simultaneous use on multiple machines.                                      |
|                                                                            |
| 2. Unauthorized copies of software may not be used in any way. This applies |
| even though you yourself may not have made the illegal copy.                |
|                                                                            |
| 3. Purchase of the appropriate number of copies of a software is necessary  |
| for maintaining legal status.                                              |
|                                                                            |
| DISCLAIMER                                                                  |
|                                                                            |
| THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY  |
| EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE      |
| DISCLAIMED.  IN NO EVENT SHALL Ruslan R. Fazliev OR ITS          |
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,      |
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,        |
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,    |
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR    |
| OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF      |
| ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                  |
|                                                                            |
| The Initial Developer of the Original Code is Ruslan R. Fazliev.          |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002          |
| Ruslan R. Fazliev. All Rights Reserved.                                    |
+-----------------------------------------------------------------------------+
\*****************************************************************************/

#
# $Id: products.php,v 1.30 2002/11/19 12:06:10 alfiya Exp $
#
# Navigation code
#

$objects_per_page = $config["General"]["products_per_page"];

$total_nav_pages = ceil($current_category["product_count"]/$config["General"]["products_per_page"])+1;

require "../include/navigation.php";

if($active_modules["Advanced_Statistics"])
    include "../modules/Advanced_Statistics/cat_viewed.php";


#
# Get products data for current category and store it into $products array
#
$search_query = "(
        $sql_tbl[products].categoryid='$cat'
        or $sql_tbl[products].categoryid1='$cat'
        or $sql_tbl[products].categoryid2='$cat'
        or $sql_tbl[products].categoryid3='$cat'
        or $sql_tbl[products].categoryid4='$cat'
        or $sql_tbl[products].categoryid5='$cat'
        or $sql_tbl[products].categoryid6='$cat'
        or $sql_tbl[products].categoryid7='$cat'
        or $sql_tbl[products].categoryid8='$cat'
        or $sql_tbl[products].categoryid9='$cat'
        or $sql_tbl[products].categoryid10='$cat'
        or $sql_tbl[products].categoryid11='$cat'
        or $sql_tbl[products].categoryid12='$cat'
        or $sql_tbl[products].categoryid13='$cat'
        or $sql_tbl[products].categoryid14='$cat'
        or $sql_tbl[products].categoryid15='$cat'
        or $sql_tbl[products].categoryid16='$cat'
        or $sql_tbl[products].categoryid17='$cat'
        or $sql_tbl[products].categoryid18='$cat'
        or $sql_tbl[products].categoryid19='$cat'
        or $sql_tbl[products].categoryid20='$cat'
        or $sql_tbl[products].categoryid21='$cat'
        or $sql_tbl[products].categoryid22='$cat'
        or $sql_tbl[products].categoryid23='$cat'
        or $sql_tbl[products].categoryid24='$cat'
        or $sql_tbl[products].categoryid25='$cat'
        or $sql_tbl[products].categoryid26='$cat'
        or $sql_tbl[products].categoryid27='$cat'
        or $sql_tbl[products].categoryid28='$cat'
        or $sql_tbl[products].categoryid29='$cat'
        ) and $sql_tbl[products].forsale='Y'";

$products = func_search_products($search_query, $user_account['membership'], $first_page,$current_category["product_count"]);
if (count($products) ==0) $products="";

if($active_modules["Subscriptions"]) {
    include "../modules/Subscriptions/subscription.php";
}

$smarty->assign("products",$products);
$smarty->assign("navigation_script","home.php?cat=$cat");
?>


------------------------
\include\product_modify.php
------------------------
Code:

<?
#
# $Id: product_modify.php,v 1.61.2.1 2003/01/22 13:45:01 svowl Exp $
#
# Add, modify product
# Get product information
#

if ($productid != "") {
        $product_info = func_select_product($productid, $user_account['membership']);
        $product_languages = func_query ("SELECT $sql_tbl[products_lng].*, $sql_tbl[countries].country, $sql_tbl[countries].language FROM $sql_tbl[products_lng], $sql_tbl[countries] WHERE $sql_tbl[products_lng].productid='$productid' AND $sql_tbl[products_lng].code=$sql_tbl[countries].code");
}

$int_languages = func_query ("SELECT DISTINCT($sql_tbl[languages].code), $sql_tbl[countries].country, $sql_tbl[countries].language FROM $sql_tbl[languages], $sql_tbl[countries] WHERE $sql_tbl[languages].code=$sql_tbl[countries].code AND $sql_tbl[languages].code!='$config[default_admin_language]'");

$other_languages = array ();
if ($int_languages) {
        foreach ($int_languages as $key=>$value) {
                $found = false;

                if ($product_languages) {
                        foreach ($product_languages as $key1 => $lng) {
                                $product_languages[$key1]["descr"] = stripslashes($lng["descr"]);
                                $product_languages[$key1]["full_descr"] = stripslashes($lng["full_descr"]);
                                if ($lng["code"] == $value["code"])
                                        $found = true;
                        }
                }
                if (!$found)
                        $other_languages[] = $value;
        }
}

$smarty->assign("int_languages", $int_languages);
$smarty->assign("other_languages", $other_languages);
$smarty->assign("product_languages", $product_languages);

if (($REQUEST_METHOD == "POST") && ($mode == "product_modify")) {
        $fillerror = (($categoryid == "") || empty($product) || empty($descr) || ($price == "") || ($avail == "") || empty($low_avail_limit));

        if (func_is_image_userfile($userfile, $userfile_size, $userfile_type)) {
                move_uploaded_file($userfile, "$file_temp_dir/$userfile_name");
                $userfile = "$file_temp_dir/$userfile_name";

                list($image_size, $image_x, $image_y) = func_get_image_size($userfile);

                $fd = fopen($userfile, "rb");
                $image = addslashes(fread($fd, $image_size));
                fclose($fd);

                unlink($userfile);
        }
#
# Replace newlines by
's in description fields
#
        $descr = str_replace("\n", "
", $descr);
        $fulldescr = str_replace("\n", "
", $fulldescr);

        if (!$fillerror) {
                if ($productid == "") {
#
# New product
#

#
# Get the last pos in products' category
#
                        $orderby = 1 + array_pop(func_query_first("select max(orderby) from $sql_tbl[products] where categoryid='$categoryid'"));

                        db_query("insert into $sql_tbl[products] (provider, add_date, orderby) values ('$login', '".time()."', '$orderby')");

                        $productid = db_insert_id();
#
# Insert pricing and image
#
                        db_query("insert into $sql_tbl[pricing] (productid, quantity, price) values ('$productid', '1', '$price')");

                        if (func_is_image_userfile($userfile, $userfile_size, $userfile_type))
                                db_query("insert into $sql_tbl[thumbnails] (productid, image, image_type) values ('$productid', '$image', '$userfile_type')");

                        $smarty->assign("main", "product_add_message");
                } else {
#
# Update existing product
# For security reasons check if provider owners the
# product and then update pricing
#
                        db_query("update $sql_tbl[pricing] set price='$price' where productid='$productid' and quantity='1' and membership=''");

                        if (func_is_image_userfile($userfile, $userfile_size, $userfile_type)) {
                                db_query("delete from $sql_tbl[thumbnails] where productid='$productid'");
                                db_query("insert into $sql_tbl[thumbnails] (productid, image, image_type) values ('$productid', '$image', '$userfile_type')");
                                db_query("update $sql_tbl[products] set image_x='$image_x', image_y='$image_y' where productid='$productid'");
                        }

                        $smarty->assign("main","product_modify_message");
                }
#
# Update product data
#
                db_query(
                        "update $sql_tbl[products] set product='$product', "
                        . "categoryid='$categoryid', "
                        . "categoryid1='$categoryid1', "
                        . "categoryid2='$categoryid2', "
                        . "categoryid3='$categoryid3', "
                        . "categoryid4='$categoryid4', "
                        . "categoryid5='$categoryid5', "
                        . "categoryid6='$categoryid6', "
                        . "categoryid7='$categoryid7', "
                        . "categoryid8='$categoryid8', "
                        . "categoryid9='$categoryid9', "
                        . "categoryid10='$categoryid10', "
                        . "categoryid11='$categoryid11', "
                        . "categoryid12='$categoryid12', "
                        . "categoryid13='$categoryid13', "
                        . "categoryid14='$categoryid14', "
                        . "categoryid15='$categoryid15', "
                        . "categoryid16='$categoryid16', "
                        . "categoryid17='$categoryid17', "
                        . "categoryid18='$categoryid18', "
                        . "categoryid19='$categoryid19', "
                        . "categoryid20='$categoryid20', "
                        . "categoryid21='$categoryid21', "
                        . "categoryid22='$categoryid22', "
                        . "categoryid23='$categoryid23', "
                        . "categoryid24='$categoryid24', "
                        . "categoryid25='$categoryid25', "
                        . "categoryid26='$categoryid26', "
                        . "categoryid27='$categoryid27', "
                        . "categoryid28='$categoryid28', "
                        . "categoryid29='$categoryid29', "
                        . "brand='$brand', model='$model', descr='$descr', fulldescr='$fulldescr', "
                        . "avail='$avail', discount='$discount', weight='$weight', productcode='$productcode', "
                        . "forsale='$forsale', distribution='$distribution', free_shipping='$free_shipping', "
                        . "shipping_freight='$shipping_freight', discount_avail='$discount_avail', "
                        . "min_amount='$min_amount', param00='$param00', param01='$param01', param02='$param02', "
                        . "param03='$param03', param04='$param04', param05='$param05', param06='$param06', "
                        . "param07='$param07', param08='$param08', param09='$param09', low_avail_limit='$low_avail_limit', "
                        . "vat='$vat' where productid='$productid'"
                );

        } else {
#
# Form filled with errors
#
                $product_info = $HTTP_POST_VARS;
                $product_info["productid"] = $productid;
                $smarty->assign("main", "product_modify");
        }
} else {
#
# GET request
#
        $smarty->assign("main", "product_modify");
}

#
# International descriptions
#
if ($mode == "update_lng") {
        if ($product_lng_code) {
                foreach ($product_lng_code as $value) {
                        db_query ("UPDATE $sql_tbl[products_lng] SET descr='".$product_lng_descr[$value]."', full_descr='".$product_lng_full_descr[$value]."' WHERE code='$value' AND productid='$productid'");
                }
        }

        if ($product_new_descr or $product_new_full_descr) {
                db_query ("INSERT INTO $sql_tbl[products_lng] (code, productid, descr, full_descr) VALUES ('$product_new_language','$productid','$product_new_descr','$product_new_full_descr')");
        }

        header ("Location: product_modify.php?productid=$productid&lng_updated");
        exit;
}

if ($mode == "del_lang") {
        db_query ("DELETE FROM $sql_tbl[products_lng] WHERE productid='$productid' AND code='$code'");

        header ("Location: product_modify.php?productid=$productid&lng_deleted");
        exit;
}

#
# Detailed__Product_Images module
#
if ($active_modules["Detailed_Product_Images"]) {
        include "../modules/Detailed_Product_Images/product_images_modify.php";
        include "../modules/Detailed_Product_Images/product_images.php";
}
#
# Subscription module
#
if ($active_modules["Subscriptions"])
    include "../modules/Subscriptions/subscription_modify.php";
#
# Wholesale trading module
#
if ($active_modules["Wholesale_Trading"])
        include "../modules/Wholesale_Trading/product_wholesale.php";
#
# Product options module
#
if ($active_modules["Product_Options"])
        include "../modules/Product_Options/product_options.php";
#
# Extra fields module
#
if ($active_modules["Extra_Fields"]) {
        $extra_fields_provider = $login;
        include "../modules/Extra_Fields/extra_fields.php";
}

#include "../modules/Product_Shipping/product_shipping.php";

#
# Upselling products module
#
if ($active_modules["Upselling_Products"])
        include "../modules/Upselling_Products/edit_upsales.php";


# Tax Zones module
#
if ($active_modules["Tax_Zones"])
        include "../modules/Tax_Zones/edit_product.php";

#
# Customer Reviews module
#
include "../include/reviews.php";

if (($productid != "") && !$fillerror)
        $product_info = func_select_product($productid, $user_account['membership']);

$smarty->assign("product", $product_info);
$smarty->assign("fillerror", $fillerror);

?>


funkydunk 04-01-2003 11:11 PM

dont forget the search side of things aswell. :D

shan 10-22-2003 03:32 AM

any idea what version this was done for ?

funkydunk 10-22-2003 05:16 AM

looks like 3.3.5 ish

Wandrer 12-18-2003 05:13 AM

Any possibility for adding this into the stock 3.5.x version of X-Cart so that it would be available for future versions without continually having to edit the files ?

EZ 12-23-2003 10:41 AM

Code for 3.5.1
 
I am running 3.5.1 and I looked over the code to do this mod and the files are different, does anyone know how to do this mod for 3.5.1? I asked the X-Cart support and they said it would have to be custom work done by them! :roll:

jmell 12-29-2003 12:51 AM

I need this to for 3.5.1 also. Would be happy to share on cost.

EZ 12-29-2003 06:54 AM

Share cost
 
I am having it done to one of my sites they are charging me $125 for the mod.

EZ 12-29-2003 01:02 PM

Custom Mod work
 
I'm in the process of getting it done now for one of my sites

the cost is $125.00

CenturyPerf 01-17-2004 10:35 AM

Adding More Categories
 
This is definitely something I need .... being able to put an item in 30 categories *might* actually be enough for what I need in my store.

It seems obvious by looking at it the previously posted code that I can't just drop it into my version (3.5.3). Is anyone interested in tweaking the code to work in 3.5.3?

Anyone else need this sort of modification as well?

EZ 01-17-2004 10:58 AM

Unlimited Categories
 
I had X-Cart do this mod for a client of mine they did a nice job made it so I can have unlimited categories they charged me $125.00

NuAlpha 01-23-2004 11:01 AM

Anyone get this working for the 3.5.x code?

What is up concerning an update to the search function for this code?

CenturyPerf 01-23-2004 11:17 AM

I plan on having X-Cart devs build the mod for me soon ... wanna share costs?

EZ 01-23-2004 01:51 PM

Unlimited Categories
 
I already had it done and paid for it!

adpboss 01-23-2004 06:26 PM

Re: Unlimited Categories
 
Quote:

Originally Posted by EZ
I already had it done and paid for it!


We know. You posted the price three times. :-D

EZ 01-23-2004 11:17 PM

Post Before
 
If you read the post before mine wise ass you will see someone asking to share the cost, I was just responding to them. Maybe you should stop watching the post if it bothers you so much

B00MER 01-23-2004 11:24 PM

Duplicating the categoryid over and over just isn't very logical. As it becomes a bit redundant. Granted I've done this in the past to give clients 10-20 more categories but its not "unlimited".

So my theory was why not use just one category field in the products table with a delimeter and id's of the categories to associate the product with, then explode the new category field upon searchs, etc.

Just my 2cents. :wink:

btw, one thing I hated about the modify product search is its in-ability to search any other category but the main category. I've got a mod for this if anyone is interested PM me. ;)

CenturyPerf 01-24-2004 01:44 AM

EZ, before you talk trash in the forums you better first get your facts straight. [-X

If you have the ability to pull your head out you will see that I posted that I was going to ask for the same mod, but for version 3.5.3. Then you step in and post AGAIN that you paid $125.

When I posted about sharing costs it was to NuAlpha's post (and to anyone else) who wanted to share the modification costs as a group.

You may not know, but the X-Cart devs are very happy to spread the cost of a mod out to all interested parties. In fact, they will even individually bill (in your member area) each person that is interested in a specific modification.

This support forum is for assistance, sharing information, working on upgrades and tweaks. It is Not for people who want to pull out some name calling and ignorantly attack someone for their posts, especially when the one attacking (you) did not correctly read the posts. :-({|=

You should possibly consider apologizing to those who you mouthed off to. :idea:

shan 01-24-2004 05:44 AM

It would be good as standard to not have only a few categories that a product can be added to.

If below the standard 4 or 5 options to have a 'add new category' and then maybe have it work as boomer said would be spot on and good for everybody

EZ 01-24-2004 08:49 AM

reply
 
We'll first off I thought you were talking to me since I started the post and the post before yours was not very clear on the matter. The member that had posted "We know. You posted the price three times." is not even involved with this post. And I do know that you can share costs. My apologies to you or anyone else except for the member that made the wise ass remark because that's what it was and nothing else. Do you think there was a need for that remark? If you look at the post you will see it wasnБ─≥t you that I made the remark to it was adpboss that had no involvement until his remark. :x

adpboss 01-24-2004 08:57 AM

EZ, YGPM.

B00MER 01-24-2004 09:05 AM

No need to start flame wars, if thats the case take it to PM or email please ;) And be sure to read the forum rules thread in my or any other moderators signature.

CenturyPerf 01-27-2004 09:36 AM

Who Wants to Share This Mod?
 
I've been in contact with the X-Cart Devs and they also quoted me $125.00 for the UNLIMITED category modification.

What we can do is split up the costs for whomever also wants these modified files as part of their cart.

Example:
If one other person wants this mod it only costs us $62.50 each.
If two others want it, the price is now down to under $42.00
3 = $31.25
4 = $25.00
... etc.

I'm want them to get started on this as soon as possible, but I have to list all of those people that want to share in this customization. Payment is required before they get started.

Post or PM me to be added to the list. You will be billed direct from X-Cart in your member area. I would need you to supply the e-mail addres you use in your member area for X-cart to bill you. I would like to have everyone interested to reply within the week please.

shan 01-29-2004 04:07 AM

Similar thread here ...

http://forum.x-cart.com/viewtopic.php?t=8506&highlight=


All times are GMT -8. The time now is 09:15 PM.

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