Hikashop Search Module Fabrik Form

ontarget

Active Member
Hi I wish to create a form in Fabrik which will search and filter products in hikashop.
E.g.
Product Name
Product Category
Price
I have setup a form which uses a databasejoin element on the table
j_hikashop_product to search the product_name.

This works fine however - how do I get the form result to render the hikashop products as links that would take the user to the actual product?
Also the search results are saved in a list in fabrik - can this list be deleted as soon as the search query is complete?

Are there any fabrik tutorials on setting up a search form for a Joomla component?
thanks for any indicators
 
Try adding a calc element and use that to run the query - then loop through the results to create html code that is an unordered list containing links to the products. Set the calc element to use Ajax so that when the database join element selections are changed the calc element is re-calculated - and the user sees their selected product links. That way there would be no need to store the search results in another list - the results will already be stored (as html text) in the calc element.

I've used this method - i.e. a calc element to display links created from selections in a databasejoin - and it seems to work fine.

I've never used hikashop so I have no idea what exact syntax to use for the hikashop link or the databasejoin element name. But here's an example of the calc php that should give you an idea what I'm talking about...
PHP:
$selected_products = '{tablename___dbjoinElementName_raw}';
$db = JFactory::getDbo();
$db->setQuery( 'SELECT id, product_name FROM j_hikashop_product WHERE id IN (' .$selected_products. ')' );
$results = $db->loadAssocList();
$calc_display = '<ul>';
foreach($results as $row)  $calc_display .= '<li><a href="hikashop?id='.$row['id'].'">'.$row['product_name'].'</a></li>';
$calc_display .= '<ul>';
return $calc_display;
You'll also probably need to add some ccs styling for the unordered list in the calc element (to get rid of the bullets or margins).
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top