[comment]
ui_name: upsell
ui_type: component
ui_class: content, vertical
ui_group: promotions
ui_help: depends on setting upsell codes in cart or flypage
ui_label: Upsell

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

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

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

random:
	label: Random order?
	type: yesno

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

[if scratch upsell]

<br clear=all>

<table width="[control table_width 95%]" align=center>
<tr class="[control title_class titletab_small]">
  <td style="[control title_class titletab_small]"><b>
	[control name=banner default="[L]Other items you may like[/L]"]
	</b>
  </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="4">
		  <tr> 
			<td align="center" colspan="2" class="random_description">[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" align="center">
				[L]Our Price[/L]: <b>[loop-price]</b>
			</td>
		  </tr>
		  <tr> 
			<td>
				[b-link [loop-code]][L]MORE INFO[/L][/b-link]
			</td>
			<td align="center">
				[b-link order mv_order_item=[loop-code]]BUY NOW[/b-link]
			</td>
		  </tr>
		</table>
	  </TD>
	[/loop]
    [/table-organize]
    </table>

    <p>&nbsp;</p>

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

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