SOLVED
Other thread which has the correct answer: https://forum.virtuemart.net/index.php?topic=138437.0
Hello.
Is there any way to have a Query display a result based on the value of the $product_id and a specific $customfield_id?
Example code, which is definitely wrong I assume:
$db = JFactory::getDBO();
$db->setQuery("SELECT customfield_value FROM jos_virtuemart_product_customfields WHERE virtuemart_customfields_id="5" AND WHERE virtuemart_product_id=".$product->virtuemart_product_id.";");
$db->query();
$result = $db->loadResult();
echo ($result)
So this query needs to display the result where "virtuemart_customfield_id" = 5 AND where the "product_id" = the associated product.
Thanks for reading.
There is a full function for that. check the view.html.php of the productdetails view.
Thank you Milbo I will have a look :)
Just a heads up: This same issue has been solved on another thread which I created :)
https://forum.virtuemart.net/index.php?topic=138437.0
Solved