News:

Support the VirtueMart project and become a member

Main Menu

Custom fields are generated by default Virtuemart script

Started by giriga, December 09, 2016, 13:23:07 PM

Previous topic - Next topic

Studio 42

Try to add after
if($type == 'M'){

$width = $customfield->width;
$height = $customfield->height;
$table = 'product';
$absUrl = false;
if (!class_exists ('TableMedias'))
require(VMPATH_ADMIN . DS . 'tables' . DS . 'medias.php');

$db = JFactory::getDBO ();
$data = new TableMedias($db);
$data->load ((int)$val);
if(!empty($data->file_type)){
$table = $data->file_type;
}

if (!class_exists ('VmMediaHandler'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php');
$media = VmMediaHandler::createMedia ($data, $table);

if(!$width) $width = VmConfig::get('img_width',90);
if(!$height) $height = VmConfig::get('img_height',90);
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height);


and comment original line :
$tmp = array('value' => $val, 'text' => VirtueMartModelCustomfields::displayCustomMedia ($val,'product',$customfield->width,$customfield->height));

giriga

I have done as you say, keeps giving error: 0 - There was an error.

syntax error, unexpected ';', expecting ')'

JGLOBAL_TPL_CPANEL_LINK_TEXT, enclose the complete code:


Studio 42

$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height);
replace with
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height));
I worte it directly.
But best is to activate php error display in Joomla config or in your server

giriga

hello, with the modification to the code
$ Tmp = array ('value' => $ val, 'text' => $ media-> displayMediaThumb ('', false, '', TRUE, TRUE, $ absUrl, $ width, $ height)); now works ! But it does not appear the image name if I click it


Studio 42

Change
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height));
with
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height,true));

giriga

It's sorry, still does not work ...

http://prova.giriga.com/negozio-online/tavoli-sedie/sgabello-tom-detail.html

this is the code

if (! $ width) $ width = VmConfig :: get ('img_width', 90);
if (! $ height) height = $ VmConfig :: get ('img_height', 90);
$ Tmp = array ('value' => $ val, 'text' => $ media-> displayMediaThumb ('', false, '', TRUE, TRUE, $ absUrl, $ width, $ height, true));

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

giriga

Hello, in fact the space there is, the code written it with Notepad ++

Studio 42

Hum, i think you do need to add the new parameter.
but to display escription you need to fill "file_description" for the images.

giriga

Hi, where file_description? What should I change? I'm sorry

giriga


Studio 42

Fill all the empty fields.
You can copy / paste same value.
If you have many, you can buy my tool here : http://shop.st42.fr/en/products/vm-be-pro-batch-product-edit.htm and edit directly the image informations in the images list. I added this feature in the last releases.

giriga

Hello, I have filled all the blanks, but if you step over the image with your mouse nothing appears:


Studio 42

Quote from: giriga on December 21, 2016, 10:41:54 AM
Hello, I have filled all the blanks, but if you step over the image with your mouse nothing appears:
You need to add a javascript eg. bootstrap tooltip.