Author Topic: Get content from custom fields [SOLVED]  (Read 255 times)

fabioweb

  • Jr. Member
  • **
  • Posts: 141
Get content from custom fields [SOLVED]
« on: June 16, 2020, 22:27:15 pm »
Hello with V.M. 3.8.2 i have this code in product details
Code: [Select]
$linkVideo = shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'videobreve'));and the output of echo $linkVideo custom field is

Code: [Select]
<div class="product-fields">
   <div class="product-field product-field-type-S">
   <div class="product-field-display">[b]https://www.ilgarofanorosa.com/video/ita.mp4[/b]</div>
    </div>
<div class="clear"></div>
</div>

My question is how can i have only the content of custom field ino order that
<a href="<?php echo $linkVideo"></a> will be only the link?

Thanks for help





pinochico

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 498
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Get content from custom fields
« Reply #1 on: June 16, 2020, 22:34:29 pm »
change sublayouts customfields by override in template or create new sublayout and change/call in $linkVideo
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

fabioweb

  • Jr. Member
  • **
  • Posts: 141
Re: Get content from custom fields
« Reply #2 on: June 17, 2020, 14:38:58 pm »
Wow perfect thanks! i want to share the final code for this
Code: [Select]
echo shopFunctionsF::renderVmSubLayout('customfields_link',array('product'=>$this->product,'position'=>'imparare'));then i created customfields_link.php into sublayouts folder.

Best regards

pinochico

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 498
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Get content from custom fields [SOLVED]
« Reply #3 on: June 17, 2020, 18:12:41 pm »
Wonderfull, that is exactly what i mean :)

Super
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10412
  • VirtueMart Version: 3+
Re: Get content from custom fields [SOLVED]
« Reply #4 on: June 17, 2020, 18:33:43 pm »
You dont need a separate file. You can have them separate in the customfields layout, by class , position etc.

http://forum.virtuemart.net/index.php?topic=128936.0
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)