-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.4
Hi, sorry to bother you guys... again.
I try to implement an audio player in the view of product page (Display > View > show_block_custom_main).
This is my code:
<audio controls>
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
If i paste in the source this link (witch is the download link of the file uploaded in this custom field), it works:
/component/hikashop/order/download/field_table-product/field_namekey-YXVkaW9kZW1v/name-ZnVsbG1ldGFsLWFsY2hlbWlzdC1icm90aGVyaG9vZC1pbnRyby1zb3VuZC10cmFjay5tcDM=
But i want this to happen dinamicaly. How can i get this link in my code?
Frome what i see, i can get the name (witch is displayed in front end to) the price and others, but i don't see the link if i use
print_r($this) or any variable..
I can't use the variable
$value cuz it return to me the entire <a href > tag with link and the value to click on.
UPDATE
I've found a solution, i don't know if it's the best but for the moment those the trick for me.
Please let me know if there is a better solution.
My code:
<span>
<?php $audioSrc = new SimpleXMLElement($this->fieldsClass->show($oneExtraField, $value)); ?>
<audio controls>
<source src="<?php echo $audioSrc['href'] ?>" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</span>