-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
Hi,
I have following code for displaying product images in the banner of the each product page. Unfortunately it's displaying the absolute path (/home/florenti/public_html/media/com_hikashop/upload//product_main/main_Prod-Baldrian.jpg) and it needs the realtive path (media/com_hikashop/upload/product_main) to display correctly. How do I change the code below to make this work?
Thanks!
if (!empty ($this->element->images) && count($this->element->images) > 1) {
foreach ($this->element->images as $image) {
if(strpos($image->file_description,"main")) {
$fileClass = hikashop_get('class.file');
$mainPath = $fileClass->getPath('image');
$_POST["banner"]= '<div class="flo_product_mainimage" ><img style="max-width: 100%;" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="' . $mainPath.$image->file_path . '"/></div>';