Author Topic: Defult radiolist & image Custumfiled  (Read 294 times)

mahootshop

  • Beginner
  • *
  • Posts: 30
  • Store with 15,000 product
    • MAHOOT Store
  • VirtueMart Version: 3.2.2
Defult radiolist & image Custumfiled
« 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

bstearns

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Defult radiolist & image Custumfiled
« Reply #1 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.

mahootshop

  • Beginner
  • *
  • Posts: 30
  • Store with 15,000 product
    • MAHOOT Store
  • VirtueMart Version: 3.2.2
Re: Defult radiolist & image Custumfiled
« Reply #2 on: August 12, 2017, 07:25:18 am »
paste this code:

Code: [Select]
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.