Friday, October 24, 2008

Order, buy and reserve with Jumi

Well, most of us sell something. And majority of us, Joomla! people, through our webs.

If we are selling products in huge amounts we can make use of specialized components like Virtuemart. If we are selling services in “tons” we can make use of Freeway solution.

But many of us sell only several items of our products or services per month. I do not think it is effective to implement huge and sophisticated solution like those mentioned above in this case. Simple, reliable and elegant solution will suffice. It can be done with Jumi.

An individual Joomla! article can be devoted to an individual item. We can describe the product or service characteristics, its prize and virtually anything we want here. With Jumi plugin we then add to the article an intelligent form which final purpose is to display an order/buy/reserve button. The form sends via method post at the least an article id ($at the least) to the url, where Jumi component application (XYZ) waits for its input. Like this:

<?php
defined('_JEXEC') OR die( "Direct Access Is Not Allowed" );
$html="<div>";
$html .= "<form action=‘index.php?option=com_jumi&fileid=XYZ method='post' name='ORD$article->id'>";
$html .= "<input type='hidden' name='product_id' value='$article->id' />";
$html .= "<input value='Order' class='button' type='submit' />";
$html .= "</form></div>";
echo $html;
?>

That means the component application knows the product ordered ($article->id is stored in $_POST[product_id] global variable) and can continue in the ordering process (e.g. display the article name ($article->title), introtext or the whole text, display a form for picking up personal data, etc, etc).

At the end the order can be stored in the database table and/or send by e-mail for further human processing.

Simple, reliable, elegant. With Jumi.

No comments: