<!-- Layout: donationProductPage-->
<!-- start of item: [[name]]-->
<!--agorascript-pre {
	# Start of controller code, probably should leave this alone ;-)
	local ($myans) = "";
	if ($rowCount == (1+$minCount)) { #very first one, build new row
  		$ags_row_item = 0;
  		$ags_tot_item = 0;
		# do nothing in this layout. Add if you wish to create new div cantainer
		# legacy layouts added table with 1px border around all products on page
  		 $myans .= '' . "\n";
 	}
	$ags_row_item++;
	$ags_tot_item++;
	if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned))) {
		# very last one, need to be two wide
		if ($ags_row_item == 1) { # first and only one
    		$myans = '<div class="row agc_product_row"><div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"><div class="ac_product_opt-add col-xs-12 col-sm-12 col-md-12 col-lg-6">'."\n";
   		}
		else {
			$myans .= '<div class="col-xs-12 col-sm-12 col-md-12 col-lg-6"><div class="ac_product_opt-add col-xs-12 col-sm-12 col-md-12 col-lg-12"><br class="hidden-lg"><hr class="hidden-lg agc_prod_divider" style="height: 2px"><br class="hidden-lg">'."\n";
		}
	}
	elsif ($ags_row_item == 2) { # second one
  		$ags_row_item = 0; #reset counter
  		$myans .= '<div class="col-xs-12 col-sm-12 col-md-12 col-lg-6"><div class="ac_product_opt-add col-xs-12 col-sm-12 col-md-12 col-lg-12"><p class="visible-xs visible-sm visible-md hidden-lg"><br><hr class="hidden-lg agc_prod_divider" style="height: 2px"></p><div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="height: 1px"></div>'."\n";
 	} else { #first one
  		$myans .= '<div class="row agc_product_row"><div class="col-xs-12 col-sm-12 col-md-12 col-lg-6"><div class="ac_product_opt-add col-xs-12 col-sm-12 col-md-12 col-lg-12"><div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"style="height: 11px"></div>'."\n";
 	}
	return $myans;
} # end of agorascript controller code
-->

	<form method="post" action="[[scriptURL]]">
		[[make_hidden_fields]]

		<!--BEGIN SELECT QUANTITY BUTTON-->
		<div class="form-group pull-left ac_add-quantity ">
					<p>%%optionFile%%</p>
					<p class="form-inline">%%QtyBox%%
					<button class="btn btn-primary agc_add_button hidden-xs hidden-sm" role="button" name="add_to_cart_button" value="Add To Cart" title="[[addToCartButtonText]]: [[name]]"[[disableButton]]><i class="fa fa-cart-plus fa-lg"></i> [[addToCartButtonText]]</button>
					<button class="btn btn-primary agc_add_button visible-xs visible-sm" style="margin-top: 6px;" role="button" name="add_to_cart_button" value="Add To Cart" title="[[addToCartButtonText]]: [[name]]"[[disableButton]]><i class="fa fa-cart-plus fa-lg"></i> [[addToCartButtonText]]</button></p>
		</div>
		<div class="ac_product_image visible-xs visible-sm" data-toggle="modal" data-target="#modal[[prod_db_id]]"><img src="[[image]]" class='img-responsive center-block' style="max-height: 230px" alt="[[name]] - [[product]]"></div>
		<div class="ac_product_image pull-right hidden-xs hidden-sm" data-toggle="modal" data-target="#modal[[prod_db_id]]"><img src="[[image]]" class='img-responsive center-block' style="max-height: 230px" alt="[[name]] - [[product]]"></div>
		<!--END SELECT QUANTITY BUTTON-->
	</form>
</div>
<!--agorascript-pre {
	# more agorascript controller code
	local ($myans) = "";
	if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned))) {
		# very last one
  		if ($ags_row_item == 1) { # first and only one
    		$myans .= '<div class="col-xs-12 col-sm-12 col-md-12 col-lg-6">'."\n";
   		}
		else {
			$myans .= '<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">'."\n";
		}
 	}
	else {
		$myans .= '<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">'."\n";
	}
	return $myans;
} # end agorascript controller code
-->


<!-- Modal for: [[name]]-->
<div class="modal fade" id="modal[[prod_db_id]]" tabindex="-1" role="dialog" aria-labelledby="modal[[prod_db_id]]Label">
  <div class="modal-dialog" role="document">
    <div class="modal-content" itemprop="mainEntity" itemscope itemtype="https://schema.org/Product">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="modal[[prod_db_id]]Label">[[name]]</h4>
      </div>
      <div class="modal-body">

			  <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
				<form method="post" action="[[scriptURL]]">
		  		[[make_hidden_fields]]
				<p><br></p>

		  		<!--BEGIN SELECT QUANTITY BUTTON-->
		  		<div class="form-group pull-left ac_add-quantity ">
		  					<p>%%optionFile%%</p>
		  					<p class="form-inline">%%QtyBox%%
							<button class="btn btn-primary agc_add_button hidden-xs hidden-sm" role="button" name="add_to_cart_button" value="Add To Cart" title="[[addToCartButtonText]]: [[name]]"[[disableButton]]><i class="fa fa-cart-plus fa-lg"></i> [[addToCartButtonText]]</button>
							<button class="btn btn-primary agc_add_button visible-xs visible-sm" style="margin-top: 6px;" role="button" name="add_to_cart_button" value="Add To Cart" title="[[addToCartButtonText]]: [[name]]"[[disableButton]]><i class="fa fa-cart-plus fa-lg"></i> [[addToCartButtonText]]</button></p>
							<p class="ac_product_price" itemprop="price" content="[[price_raw]]">[[price]]</p>
		  		</div>
		  		<div class="ac_product_image pull-right" itemprop="image"><img src="[[image]]" class='img-responsive center-block' style="max-height: 230px" alt="[[name]] - [[product]]"></div>
		  		<!--END SELECT QUANTITY BUTTON-->
		  	</form></div>
			<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
			<h3 class="ac_product_name" itemprop="name">[[name]]</h3>
			<p class="ac_product_desc" itemprop="description">[[description]]</p>
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">[[closeModalText]]</button>
		<a class="btn btn-primary agc_add_button" role="button" href="[[scripturl]]?dc=1&amp;[[href_fields]]" rel="nofollow" title="View Your Shopping Cart"><i class="fa fa-shopping-cart fa-lg"></i> [[viewcart]]</a>
		<a class="btn btn-primary agc_add_button" role="button" href='[[StepOneURL]]?order_form_button.x=1&amp;[[href_fields]]' rel="nofollow" title="Start Checkout Process"><i class="fa fa-check fa-lg"></i> [[checkout]]</a>
      </div>
    </div>
  </div>
</div>

<!-- Regular store page display -->
	<h3 class="ac_product_name">[[name]]</h3>
	<p class="ac_product_desc">[[description_teaser]] ... <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#modal[[prod_db_id]]" title="[[seemoreButtonName]] [[name]]"><i class="fa fa-info-circle fa-lg"></i>[[seemoreButtonText]]</button></p>

	<table width='100%' border=0 cellpadding=0 cellspacing=0 class="ac_product_desc">
		<tr><td width='50%' align=center><span class="ac_product_price">[[price]]</span></td>
			<td width='50%' align=center><a class="btn btn-default btn-xs" role="button" href="[[scripturl]]?dc=1&amp;[[href_fields]]" rel="nofollow"><i class="fa fa-shopping-cart"></i> [[viewcart]]</a>
				<p class="hidden-lg"></p>
				<a class="btn btn-primary btn-xs" role="button" href='[[StepOneURL]]?order_form_button.x=1&amp;[[href_fields]]' rel="nofollow"><i class="fa fa-check"></i> [[checkout]]</a>
			</td>
		</tr>
	</table>
</div>

<!--agorascript-pre {
	# more controller code
	local ($myans)="";
	if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned))) {
		# very last one, need to be two wide
  		$myans .= '</div></div>'."\n";
	}
	elsif ($ags_row_item == 1) { # first one
  		$myans .= '</div>'."\n";
 	} else { # second one
  		$myans .= '</div></div><hr class="agc_prod_divider">'."\n";
 	}
	return $myans;
} # end controller code
-->

<!-- end of item: [[name]] -->
