-- url of the page with the problem -- : localhost
-- HikaShop version -- : 2.2.3
-- Joomla version -- : 2.5.17
-- PHP version -- : 5.4.6
Hi there,
After my HikaShop customer pays for a product, he will need to log in and fill in for me a small web form in which, as he fills it in, I will need one of his fields to be calculated based on the quantity of the HikaShop product he just purchased.
I am using RSForms Pro to construct the form and one of their tutorials deals with similar task: it inserts into the form field a Cummunity Builder user first name with this code:
//<code>
$user = JFactory::getUser();
$db = JFactory::getDbo();
$userId = $user->get('id');
// Is the user logged in?
if ($userId) {
// Grab the value from the database.
$db->setQuery("SELECT `firstname` FROM `#__comprofiler` WHERE `user_id`='".$userId."'");
return $db->loadResult();
}
//</code>
Could you advise what SELECT would help me to retrieve the quantity of the product from the last order of a logged in Joomla 2.5 user/HikaShop customer?
Cheers,
Alex