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

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Custom fields are generated by default Virtuemart script
« on: December 09, 2016, 13:23:07 pm »
I miss the selection, When the customer chooses the image, how can you do? see image example

My website
sample site

Regards

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #1 on: December 09, 2016, 17:09:55 pm »
Hi,
If you need to get in in the cart, i think it's not possible.
If you need advanced option, you need to find a plugin that can use images in cart.
But your explain are to short to help you.
Perhaps in the website directly we can find the problem if you provide a link ?

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #2 on: December 09, 2016, 19:16:42 pm »

hi,
I would need that when you click and choose the finish that you like in the cart, turning on the picture I am attaching link my site and link the sample site:

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

http://shop.bertoliarredamenti.it/shop/complementi-bontempi/scrittoio-zac-bontempi/  (sample site)

Best regards

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #3 on: December 09, 2016, 19:25:00 pm »
hi,

If you report me a plugin that does this thanks

http://shop.bertoliarredamenti.it/shop/tavoli/tavolo-echo-in-bontempi/

woocommerce I know there has, I hope that virtuemart

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #4 on: December 09, 2016, 21:12:30 pm »
Only simple solution i know in css :
fist css rule is for unselected radio, second for selected radio input
Code: [Select]
.product-field-display input[type="radio"]+img {
    border: 2px solid #fff;
}
.product-field-display input[type="radio"]:checked+img {
    border: 2px solid #0aa64c;
}
Note you have to set same border width else you have some rendering problems

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #5 on: December 09, 2016, 22:09:41 pm »
Thank you very much !! I solved the problem  ;D ;D

best regards

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #6 on: December 12, 2016, 22:36:22 pm »
Hello, I'd also like to see the name of the image (I include photos)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #7 on: December 13, 2016, 01:04:23 am »
In the product details or in the cart ?

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #8 on: December 14, 2016, 11:09:54 am »
Hello is the custom field virtuiemart picture I am attaching the link?

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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #9 on: December 14, 2016, 11:46:11 am »
To display info after image, you need to modify the code and add original VM code

HERE is the original code to integgrate in \components\com_virtuemart\sublayouts\customfield.php line 472
search for
Code: [Select]
if($type == 'M'){
$tmp = array('value' => $val, 'text' => VirtueMartModelCustomfields::displayCustomMedia ($val,'product',$customfield->width,$customfield->height));

Code: [Select]
static function displayCustomMedia ($media_id, $table = 'product', $width = false, $height = false, $absUrl = false) {

if (!class_exists ('TableMedias'))
require(VMPATH_ADMIN . DS . 'tables' . DS . 'medias.php');

$db = JFactory::getDBO ();
$data = new TableMedias($db);
$data->load ((int)$media_id);
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);

return $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height);
}

and try to add this and modify
return $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height);
with
return $media->displayMediaThumb ('', FALSE, '', TRUE, TRUE, $absUrl, $width, $height, true);
of course you need to change some codes.

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #10 on: December 14, 2016, 13:28:22 pm »
hello, I'm sorry I tried to change the code, but it gives me error:

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #11 on: December 15, 2016, 18:17:59 pm »
This is the error that appears after changing the code :

 0 - There was an error.

syntax error, unexpected 'displayCustomMedia' (T_STRING), expecting '('

JGLOBAL_TPL_CPANEL_LINK_TEXT

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4243
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Custom fields are generated by default Virtuemart script
« Reply #12 on: December 15, 2016, 23:46:09 pm »
You need to implement the code , not use is exactly.
I only grouped you the 2 codes, so you have all info to do it yourself.

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #13 on: December 16, 2016, 16:43:56 pm »
Hello, thanks for the reply, unfortunately I am not a programmer, there is a tutorial where you can watch?

giriga

  • Jr. Member
  • **
  • Posts: 113
  • A beginner
Re: Custom fields are generated by default Virtuemart script
« Reply #14 on: December 17, 2016, 16:05:00 pm »
there maybe a module or plugin that does all this?