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

giriga

I miss the selection, When the customer chooses the image, how can you do? see image example

My website
sample site

Regards

Studio 42

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


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

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

Only simple solution i know in css :
fist css rule is for unselected radio, second for selected radio input
.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

Thank you very much !! I solved the problem  ;D ;D

best regards

giriga

Hello, I'd also like to see the name of the image (I include photos)

Studio 42


giriga


Studio 42

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
if($type == 'M'){
$tmp = array('value' => $val, 'text' => VirtueMartModelCustomfields::displayCustomMedia ($val,'product',$customfield->width,$customfield->height));


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

hello, I'm sorry I tried to change the code, but it gives me error:

giriga

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

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

Hello, thanks for the reply, unfortunately I am not a programmer, there is a tutorial where you can watch?

giriga