[comment]
ui_component: cross
ui_component_type: content, vertical
ui_component_group: promotions
ui_component_label: Cross-sell or specific feature
ui_component_help: depends on setting cross_codes or cross_category in page, \
falls back to featured/specials.

size:
	label: Number of selections
	widget: select
	options: 1,2,3*,4,5,6,7,8,9,10

cols:
	label: Number of columns
	widget: select
	options: 1,2,3*,4,5,6,7,8,9,10

banner:
	label: Top row banner
	widget: text
	width: 40
	default: See also...

cross_codes:
	label: Specific featured products (sku)
	widget: text
	width: 40

random:
	label: Random order?
	widget: yesno

[/comment]

<!-- BEGIN COMPONENT [control component cross_horizontal] -->
[if !scratch cross_codes]
[tmp cross_codes][control cross_codes][/tmp]
[/if]
[if !scratch cross_codes]
[tmp cross_codes][loop search="
[if scratch cross_category]
						st=db
						fi=merchandising
						sf=cross_category
						se=[scratch cross_category]
[else]
						st=db
						fi=merchandising
						sf=featured
						se=specials
[/else]
[/if]
					"] [loop-code][/loop][/tmp]
[/if]
[if !scratch cross_codes]
[tmp cross_codes][loop search="
						st=db
						fi=merchandising
						ra=yes
						tf=times_ordered
						ml=10
					"] [loop-code][/loop][/tmp]
[/if]

<table width="[control width 95%]" align="[control table_align center]">
<tr> 
  <td class="categorybar">
    &nbsp;<b>[control banner Best sellers...]</b>
  </td>
</tr>
<tr>
  <td> 
    [calc]
  	my $n = [control cols 3];
	$Scratch->{width_percent} = q{[control width_percent 100%]}
							  || int(100 / $n) . '%';
	my $rand = q{[control random]};
	delete $Scratch->{random};
	if($rand) {
		$Scratch->{random} = q{[control size 3]};
	}
	return;
    [/calc]
    <table border="0" width="100%">
    [table-organize embed=1 pretty=1 cols="[control cols 3]"]
    [loop random="[scratch random]" list="[strip interpolate=1][scratch cross_codes][/strip]"]
      <TD width="[scratch width_percent]"> 
	<table border="0">
	<tr>
    	  
    [if-loop-field thumb]
      <td>
	    <a href="[area [loop-code]]">
	      <img border="0" src="thumb/[loop-field thumb]"></a>
	  </td>
    [else]
      <td>&nbsp;
      </td>
    [/else]
    [/if-loop-field]

          <td valign="middle">
            <table cellspacing="0">
     	    <tr>
  	      <td align="left" class="contentbar1">
	        &nbsp;[loop-description]
              </td>
	    </tr>
	    <tr> 
	      <td align="left">
			[if-loop-data options o_modular]
				[page [loop-code]]
				[else][order [loop-code]]
				[/else]
				[/if-loop-data]
  		<img src="__THEME_IMG_DIR__buynow.gif" border="0" align="top"></a>
	        <a href="[area [loop-code]]">More Info</a>
              </td>
	    </tr>
	    <tr> 
	      <td align="left">
		Our Price: <B>[loop-price]</B>
	      </td>
	    </tr>
	    </table>
	  </td>
        </tr>
        </table>
      </TD>
    [/loop]
    [/table-organize]
    </table>
  </td>
</tr>
</table>

<!-- END COMPONENT [control component cross_horizontal] -->
