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 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解