For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
I have created a "shipping price" table with id - weight - price.
with a databasejoin field and data = table "objects" value = total-weight Associated label = id.
So the sql request, where do I put it?
That is the question...
It looks like a simple form but behind that is a lot of things and what is going on.This is why I want to go through simple fabrik forms to fill out for novices.
$mydb = JFactory::getDbo();
//get multiselect option ids (comma separated string)
$selected_options = '{yourtable___productelement_raw}';
//convert comma separated options to array
$selected_options_array = explode(',', $selected_options);
//loop through selected options array
$items_weight = 0;
foreach ($selected_options_array as $selected_option) {
//get weigh of the item
$mydb->setQuery("SELECT item_weight FROM items_table WHERE id = ".$mydb->Quote($selected_option));
$myresult = $mydb->loadResult();
//add up the weight for all selected items
$items_weight += $myresult;
}
if ($items_weight <= 0.5) {
return "4.60";
} elseif ($items_weight > 0.5) {
return "4.90";
} elseif ($items_weight > 1) {
return "5.40";
}