-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.1.15
-- Browser(s) name and version -- : Chrome
Hi
I would like how to get the product price based on product ID.
Currently I have an API working to get on the product name based on product ID and need to include the product price too.
public function get_product_name() {
//$this->check_request_token();
$data = new stdClass();
$config =& hikashop_config();
$id = JFactory::getApplication()->input->post->getArray();
$productClass = hikashop_get('class.product');
$dt = [];
$datas = [];
foreach($id[dataArrayPost] as $key => $value){
if(!@include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){
return false;
}
$dt['prodID'][] = $value[productID];
$datas['quota'][] = $value[remainingQuota];
}
foreach($dt['prodID'] as $key => $value){
$datas['productName'][] = $productClass->get($value)->product_name;
}
echo json_encode( ($datas));
JFactory::getApplication()->close();
}
This code will return the product name and required quantity. Any ways that i can include product price by using the same code?