示例#1
0
			</tr>
		</thead>
		<tbody id="list">
		</tbody>
	</table>

	<div class="row actions">
		<?php 
\Pasteque\form_send();
?>
	</div>

</form>

<?php 
\Pasteque\init_catalog("catalog", "catalog-picker", "addProduct", $categories, $products);
?>

<script type="text/javascript">

	addProduct = function(productId) {
		var product = catalog.products[productId];
		if (jQuery("#line-" + productId).length > 0) {
			// Add quantity to existing line
			var qty = jQuery("#line-" + productId + "-qty");
			var currVal = qty.val();
			qty.val(parseInt(currVal) + 1);
		} else {
			// Add line
			var html = "<tr id=\"line-" + product['id'] + "\">\n";
			html += "<td><img class=\"thumbnail\" src=\"" + product['img'] + "\" /></td>\n";
                <input type="button" onclick="javascript:addAllPrd()" value="<?php 
pi18n('Add all products of the category', PLUGIN_NAME);
?>
">
            </div>
        </fieldSet>
    </div>
</div>
<input type="hidden" name="subgroupData" id="subgroupData" />
        <?php 
\Pasteque\form_save();
?>
</form>

<?php 
\Pasteque\init_catalog("catalog", "catalog-picker", "productPicked", $categories, $products);
?>

<script src="<?php 
echo \Pasteque\get_module_action(PLUGIN_NAME, "control.js");
?>
" type="text/javascript"></script>

<script type="text/javascript">

var tax_rates = new Array();
<?php 
foreach ($taxes as $tax) {
    echo "\ttax_rates[\"" . \Pasteque\esc_js($tax->id) . "\"] = " . $tax->getCurrentTax()->rate . ";\n";
}
?>