Author Topic: Custom fields are generated by default Virtuemart script  (Read 3900 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #15 on: December 18, 2016, 09:56:46 am »
Try to add after
Code: [Select]
if($type == 'M'){
Code: [Select]
$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 :
Code: [Select]
$tmp = array('value' => $val, 'text' => VirtueMartModelCustomfields::displayCustomMedia ($val,'product',$customfield->width,$customfield->height));

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #16 on: December 18, 2016, 12:31:49 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #17 on: December 18, 2016, 12:59:53 pm »
$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

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #18 on: December 19, 2016, 12:13:09 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #19 on: December 19, 2016, 18:23:11 pm »
Change
Code: [Select]
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height));with
Code: [Select]
$tmp = array('value' => $val, 'text' => $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height,true));

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #20 on: December 19, 2016, 21:59:35 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Custom fields are generated by default Virtuemart script
« Reply #21 on: December 19, 2016, 23:01:44 pm »

$ Tmp =

must be $Tmp.... there is no space allowed between $ and the variable name.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #22 on: December 20, 2016, 12:54:31 pm »
Hello, in fact the space there is, the code written it with Notepad ++

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #23 on: December 20, 2016, 13:23:38 pm »
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

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #24 on: December 20, 2016, 13:29:55 pm »
Hi, where file_description? What should I change? I'm sorry

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #25 on: December 20, 2016, 16:16:03 pm »
Hello I am attaching image

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #26 on: December 20, 2016, 22:57:17 pm »
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

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #27 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:

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #29 on: December 21, 2016, 10:45:38 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.