Order form to interact with VirtueMart

Status
Not open for further replies.

superfly

New Member
Has anyone tried to build an order form with Fabrik?
The user should be able to see list of all current products and "tick to order" the ones that wishes to order.
This is to interact with VirtueMart, that is can read from product tables and then write back to order tables.
My problem is not the VirtueMart tables, as I know the fields that I need to fill up.
My problem is the actual procedure where the user can choose the products to order by ticking, but also fill up the quantity that wishes to order.

I have searched the forums but doesn't seem that sth like this has been actually implemented.

The closest I could find is an order form built with Fabrik where the user selects products and quantity as one but cannot select quantity as desired.

Thanks in advance.

BR,
Kostas
 
I Have done this for a client (using 2.0 SVN), this was the template i used:

Code:
<h1><?php echo $this->table->label;?></h1>
<?php echo $this->table->intro;?>
	
	<?php if($this->showFilters){?>
		<table class="filtertable">
		<tr>
			<th colspan="2" style="text-align:left">Search:</th>
		</tr>
		<?php foreach($this->filters as $filter){?>
		<tr>
			<td><?php echo $filter->label;?></td>
			<td style="text-align:right;"><?php echo $filter->element;?></td>
		</tr>
		<?php } ?>
		<?php if($this->filter_action != 'onchange') {?>
			<tr>
				<td colspan="2" style="text-align:right;"><input type="button"
					onclick="oTable.submitfabrikTable('filter')" class="button" value="Go"
					name="filter" /></td>
			</tr>
		<?php }?>
		</table>
	<?php }?>
	<br style="clear:both;" />


	<?php if(count($this->rows) == 0){?>
		<div class="emptyDataMessage"><?php echo $this->emptyDataMessage;;?></div>
	<?php }else{ 
		foreach($this->rows as $group){?>
		<div id="product_list">
			<?php
			$c = 0;
			foreach($group as $row){ ?>
				<div class="productlist">
				<div class="listImage">
				  <a href="[url]http://www.forest-food.co.uk/index.php?page=shop.product_details&amp;flypage=shop.flypage&amp;product_id=32&amp;category_id=1&amp;manufacturer_id=0&amp;option=com_virtuemart&amp;Itemid=10"[/url] title="est">
				  <?php if( $row->jos_vm_product___product_thumb_image != '' ){?>
				  <img src="components/com_virtuemart/show_image_in_imgtag.php?filename=<?php echo $row->jos_vm_product___product_thumb_image;?>&amp;newxsize=90&amp;newysize=95&amp;fileout=" title="<?php echo $row->jos_vm_product___product_name ;?>" alt="<?php echo $row->jos_vm_product___product_name ;?>" border="0" />
				  <?php }else{?>
				  	<img src="components/com_virtuemart/shop_image//ps_image/noimage.gif" alt="<?php echo $row->jos_vm_product___product_name ;?>" title="<?php echo $row->jos_vm_product___product_name ;?>" />
				  <?php }?> 
				  </a>
			  </div>

			  <div class="listDetails">
			    <h3><a title="est" href="[url]http://www.forest-food.co.uk/index.php?page=shop.product_details&amp;flypage=shop.flypage&amp;product_id=<?php[/url] echo $row->jos_vm_product___product_id ;?>&amp;category_id=1&amp;manufacturer_id=0&amp;option=com_virtuemart&amp;Itemid=10">
			      <?php echo $row->jos_vm_product___product_name ;?></a>
			    </h3>
			    
			    <div class="listDescription">
			     <?php echo $row->jos_vm_product_price___product_s_desc ;?>
			      <a href="[url]http://www.forest-food.co.uk/index.php?page=shop.product_details&amp;flypage=shop.flypage&amp;product_id=<?php[/url] echo $row->jos_vm_product___product_id ;?>&amp;category_id=1&amp;manufacturer_id=0&amp;option=com_virtuemart&amp;Itemid=10" title="Product Details">Details...</a>
			    </div>
			
			    <div class="listPrice">
			    <?php setlocale(LC_MONETARY, 'en_GB');?>
			      <span style="font-weight: bold;">&pound;<?php echo money_format('%i', $row->jos_vm_product_price___product_price);?></span>
			    </div>
			    <div class="listAddToCart">
			    <form action="index.php" method="post" name="addtocart" id="addtocart<?php echo $c;?>">
			        <label for="quantity_<?php echo $c;?>">Qty:</label>
			        <input id="quantity_<?php echo $c;?>" class="inputbox" size="3" name="quantity" value="1" type="text" />
			        <input style="text-align: center; width: 160px; height: 35px; cursor: pointer; font-weight: bold; vertical-align: middle;" value="Add +" title="Add +" type="submit" />
			        <input name="category_id" value="1" type="hidden" />
			        <input name="product_id" value="<?php echo $row->jos_vm_product___product_id ;?>" type="hidden" />
			        <input name="page" value="shop.cart" type="hidden" />
			        <input name="func" value="cartadd" type="hidden" />
			        <input name="Itemid" value="10" type="hidden" />
			        <input name="option" value="com_virtuemart" type="hidden" />
			       </form>
			    </div>
			  </div>
				<?php $c++;?>
				</div>
			<?php }?>
			</div>
		<?php }?>
		<form id="fabrikTableForm" name="fabrikTableForm" method="post">
		<?php echo $this->nav;?>
		<?php print_r($this->hiddenFields);?>
		</form>
<?php }?>


the table you need to create is pretty complicated, basically link your fabirk table to jos_vm_product. the create these joins:

left JOIN jos_vm_product on jos_vm_product.vendor_id = jos_vm_vendor.vendor_id
left JOIN jos_vm_product on jos_vm_product.product_id = jos_vm_product_price.product_id
left JOIN jos_vm_vendor on jos_vm_vendor.vendor_id = jos_vm_shopper_vendor_xref.vendor_id
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top