This problem only looks complex, it\'s not easy either. 我现在正在研究类似的解决方案。
WooCommerce doesn\'t support hierarchical attributes. 不能将数量属性定义为体积(m3)和重量(XX吨)选项的父项。我不会把他们分开-logically this is one attribute (大小为秒)。Drawback: there will be a lot of variants (5*28)-you have to define prices for all of them!
On front 我们有two select fields 在标准主题中。Modyfying size参数很简单-将select替换为单选按钮(使用jQuery)。Quantity parameter select can be replaced with more elements - 单选按钮用于音量选项,选择用于静止(权重)。Choosing any of these options should update form value of original (now hidden) quantity select.
在此之后,我们有两个属性(都必须选择):大小(粒度)和“数量种类”。我写了“种类数量”,因为在属性选择旁边,我们有原始数量输入。This way we can order f.e. 2 bags (quantity input) x "0,7 m3 minibags, 8-16mm" (variant of 2 attributes).
信息技术can be sufficient (标准)许多情况下的解决方案。。。but this way we have an option to order only one kind of quantity at one time. 这对购物车很好,添加了相同的变体,我们得到了一行更新的数量。
查看您需要的图像something more usable - \'每种“数量”的“数量乘数”(体积复选框+选择权重)。它可以通过前端的更多JS(用于选择数量类型的质量数组)和后端的过滤器(woocommerce\\u add\\u cart\\u item\\u data,woocommerce\\u before\\u calculate\\u totals…)来实现。It could have drawbacks, too! - f、 e.一套推车项目(1x0,5m3+2x0,7m3+12t)-adjusting quantity in cart we\'re changing amount of sets, not individual quantities.
Using filters we have possibility to almost freely adjust all prices and delivering costs. 这边we don\'t have to define all variant\'s prices - 我们可以根据需要的体积和/或重量来计算它们!In practice this is only one price (per 1000kg) for each of granularity variants - 批量价格可根据重量计算。散装数量select (25个选项)can be replaced with single numerical input (最小10[吨])和单位price corelated with ordered quantity (订单越多越便宜)。相同(参数化)calculations can be done for delivering costs (卡车的种类和数量、距离)。
最佳(可用性、用户体验)I would create complex frontend (产品页)允许混合数量的“数量种类”but added to cart as separated items (行)以实现更好的操作(数量调整)和可读性。