Auto assign product category
Can anyone help me figure this out? When a provider creates a new product I am trying to automatically assign Category 2 with the $login of that provider. I know it is in the product_modify.tpl. I would just like to know how to assign a value that will be written to the products_categoryid1 when the new product is created.
I have been working with this section of the product_modify.tpl and have tried everything I know but I just can't figure it out.
<TR>
<TD class="TableCenterProductDetails">{$lng.lbl_catego ry2}</TD>
<TD class="TableCenterProductDetails">
<SELECT name="categoryid1">
<OPTION value=0 {if $product.categoryid1 eq "0"}selected{/if}>{$lng.lbl_undefined}</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>
If anyone can help me I would be so very grateful. Thanks very much.
Becky
Xcart V. 3.2.4
|