dtsps2098 2015-02-26 03:06
浏览 13
已采纳

Woocommerce挂钩产品变化以更新价格[关闭]

I'm using the product variations to display numerous dropdowns. I need to hook into the dropdowns to extract the selected values from each dropdown when they change so I can then feed them to a calculator function that will return the price. Does anyone know how to accomplish this task?

Here is a screen shot:

Print on Demand product

I've added a screen shot to show a sample product. Please note there are approximately 40 widths, 120 lengths, 50 substrates and multiple margins, uv coatings and canvas stretchings. This is way too many combinations for WC to handle, not to mention the price updates required. All these values need to update 4 different quantity group prices when changed. I found some simple price update code but now I need to feed the 6 parameters to my own pricing calculator to create the 4 prices.

  • 写回答

1条回答 默认 最新

  • dongnue2071 2015-02-26 03:26
    关注

    When a variation is found it triggers the custom JS event "found_variation". You can run scripts on that event like so:

    $( '.variations_form' ).on( 'found_variation', function( event, variation ) {
        console.log( variation );
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动