I got a plugin that generates extra options for products (woocommerce).
I create selectbox with few options like: blackky, whiteey, greyyy
Then I create radio buttons with images: blackk, whitee, greyy
How can I 'connect it' so if someone clicks on 'blackk' it also select 'blackyy' option in selectbox.
Links how it looks:
Something like this. Your values are not easy to parse
$("[name=tmcp_radio_1]").on("click",function() {
var val = this.value
if (val) $("#tmcp_select_1").val(val.split("_")[0]+"ey_1")
})
$("#tmcp_select_1").on("change",function() {
var val = this.value
if (val) $("[name=tmcp_radio_1][value="+val.split("y_")[0]+"_1]").click()
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.