VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: mahootshop on April 03, 2017, 00:29:34 AM

Title: Defult radiolist & image Custumfiled
Post by: mahootshop on April 03, 2017, 00:29:34 AM
in a situation that we have number of images to choose as customfiled (for example: sell a watch in 3 unique texture).

i looking one of these custom images, selected by default. this will prevent buying product without choosing any color or texture.
we have this future in list type in other customfields. but im looking to have it in image customfiled...

it will be nice if someone share an information about how to do it...

using virtuemart 3.2 & joomla 3.6.5
using template named FLEX
Title: Re: Defult radiolist & image Custumfiled
Post by: bstearns on August 11, 2017, 20:08:20 PM
Has there been any update to this? I have no problem changing the code so that the first radio input is checked, but finding the code where this would happen is a real bugger. Anyone have any ideas?

I tried just using jQuery and that works fine when you click on the product from the shop, but if you navigate using the Next and Previous product buttons the JS code does not get triggered.
Title: Re: Defult radiolist & image Custumfiled
Post by: mahootshop on August 12, 2017, 07:25:18 AM
paste this code:

jQuery(document).ready(function(){
jQuery('.product-field-type-M .product-field-display label:first-child').children('input').attr({"checked" : "checked"});


in your custom.js file of template (read your template documentation).

i think its better to put some menu in virtuemart costumfields configuration.