View Single Post
  #2  
Old 08-20-2005, 11:10 AM
 
delphighse delphighse is offline
 

Member
  
Join Date: Jan 2003
Location: Washington State USA
Posts: 20
 

Default

I am attempting to assign the category 2 of a product automatically and I have changed product_modify.tpl from this:

<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>

To This:

{assign var="categoryid1" value="Vendors/$login "}
{section name=cat_num loop=$allcategories}
{if $categoryid1 eq $allcategories[cat_num].category}
{assign var="product.categoryid1" value="$allcategories[cat_num].categoryid"}
{else}
{$categoryid1|count_characters:true}
{$allcategories[cat_num].category|count_characters:true}
{$allcategories[cat_num].category}{$categoryid1}

{/if}
{/section}

The problem I am having is that the variable $categoryid1 is not eq to the $allcategories[cat_num].category. In the else statement I am verifying that the character count is the same as well as the value. When I run this I can verify that there is a match but the compare is turning up false. What am I doing wrong? Any help would be very much appreciated. It's probably something very simple, but I have spend days on this and can't seem to come up with the answer.
Thanks very much.
Becky
xcart V3.2.4
Reply With Quote