[SOLVED] show video in product detail from custom field

  • Posts: 185
  • Thank you received: 10
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Standard Hikashop Business
2 months 2 weeks ago #304454

-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.3
-- PHP version -- : 7.3.2

Hi,
I'm trying to display a video where the name is coming from a custom field (named video).
When I just want to display the field with the mp4 tags around it I used this to test :

{mp4}<?php echo $this->row->video; ?>{/mp4}

And that show {mp4}123456{/mp4} ... so that looks OK.

But we use the AllVideo plugin so we need to do something extra to make it render this. I've tried this code but then the name of the custom field is not filled so all I have is 'source: '/images/.mp4', instead of 'source: '/images/123456.mp4'
The code I tried is this :

<?php echo JHtml::_('content.prepare', '{mp4}<?php echo $this->row->video; ?>{/mp4}');?>

Am I trying something that is not going to work or is the code wrong ?

Thanks for any tips.

Last edit: 2 months 2 weeks ago by nico.van.leeuwen. Reason: solved

Please Log in or Create an account to join the conversation.

  • Posts: 65715
  • Thank you received: 9593
  • MODERATOR
2 months 2 weeks ago #304456

Hi,

The code is wrong.
You are already inside PHP tags so you can't/don't need to use PHP tags again.
The code should be:

<?php echo JHtml::_('content.prepare', '{mp4}'.$this->row->video.'{/mp4}');?>

The following user(s) said Thank You: nico.van.leeuwen

Please Log in or Create an account to join the conversation.

  • Posts: 185
  • Thank you received: 10
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Standard Hikashop Business
2 months 2 weeks ago #304489

Thanks you very much, this works :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum