我正在开发一家Woocommerce商店,该商店使用捆绑到产品的订阅版本 . 我正在使用WooCommerce 3.4.3 / WooCommerce Product Bundles 5.7.11和WooCommerce Subscriptions 2.3.2 . 两个订阅产品对其变体使用相同的属性 . 捆绑产品显示两种产品,并且可以选择这些变化 . 我现在正在尝试使用JQuery更新第二个元素 .

// Change Bundled-Products Selection for "Abrechnung":
var $updateSelect = true;

jQuery(document).ready(function($) {

$("select[name=bundle_attribute_pa_abrechnung_9]").change(function() {
    if ($updateSelect)
    {
        var $va = $(this).val();
        $("select[name=bundle_attribute_pa_abrechnung_10]").attr('value', $va);
        $updateSelect = false;            
        $("select#pa_abrechnung").trigger('change');
        $updateSelect = true;
    }
  }); 
});

这会更新第二个元素,并可以将其添加到购物车 . 唯一的问题是它不会更新价格 . 我试图触发几个不同的事件,但没有运气 .