[comment]
ui_component: upsell
ui_component_type: content, vertical
ui_component_group: promotions
ui_component_label: Upsell
ui_component_help: depends on setting upsell codes in cart or flypage

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

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

banner:
	label: Top row banner
	widget: text
	width: 40

random:
	label: Random order?
	widget: yesno

[/comment]

<!-- BEGIN COMPONENT [control component upsell] -->

[if scratch upsell]

<br clear=all>

<table width="[control table_width 95%]" align=center>
<tr class="categorybar">
  <td style="categorybar"> 
	[control banner Other items you may like]
  </td>
</tr>
<tr>
  <td> 
    [calc]
  	my $n = [control cols 2];
	$Scratch->{width_percent} = int(100 / $n) . '%';
	return;
    [/calc]

    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
    [table-organize embed=1 pretty=1 cols="[control cols 2]"]
	[loop random="[control size 2]" list="[scratchd upsell]"]
	  <TD width="[scratch width_percent]"> 
		<table border="0" cellspacing="0" cellpadding="0">
		  <tr> 
			<td align="center" colspan="2" class="contentbar1">[loop-description]</td>
		  </tr>

		  [if-loop-field thumb]
		  <tr> 
			<td align="center" colspan="2"> 
				  <td><img src="thumb/[loop-field thumb]"></td>
			</td>
		  </tr>
		  [/if-loop-field]

		  <tr> 
			<td colspan="2">
				Our Price: <b>[loop-price]</b>
			</td>
		  </tr>
		  <tr> 
			<td>
				<a href="[area [loop-code]]">More Info</a>&nbsp;
			</td>
			<td align="center">
				[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" alt="buy now">
				</A>
			</td>
		  </tr>
		</table>
	  </TD>
	[/loop]
    [/table-organize]
    </table>

    <p>&nbsp;</p>

  </td>
</tr>
</table>
[/if]

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