VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: b-seite on June 22, 2016, 12:08:53 PM

Title: unformatted path to Custom Field Image
Post by: b-seite on June 22, 2016, 12:08:53 PM
Hi hello,

i am searching for a way to get the plain unformatted full path of a custom field image.
I want to set individual backgrounds for products depending on what is stored in an custom image field.
When i use $this->product->customfieldsSorted['position']->display   i get a preformattet HTML output but i just need the plain full path to the image to put it in an HTML Style

Thank you for any help

b-seite

VM: 3.0.16 Joomla:3.5.1 PHP:5.6
Title: Re: unformatted path to Custom Field Image
Post by: Studio 42 on June 22, 2016, 16:38:05 PM
This field is only here to display the image directly.
I think the best is to do a new plugin, or add a CSS by product ID(YOu can do it in your template overide).
And why not using the category id ?
If you really want to use this, then you have to search in your customfields array for field_type = "M" and get the image link manually by SQL.
But the problem is that you can then never use it for another case or you have to add another trick.