WooCommerce script to add weight of packaging to total cart

30.0 GBP

30.0 GBP peopleperhour 技术与编程 海外
333天前

详细信息

I would like a script for the functions.php file, or a stand alone plugin, that allows me to add the weight of the packaging (530g) to the total weight of the cart.
I have seen this script online but it doesn't seem to work:
// Filter to add packaging weight to total weightadd_filter( 'woocommerce_cart_contents_weight', 'prefix_filter_cart_contents_weight' );function prefix_filter_cart_contents_weight( $weight ) { /* Add 500 units to the total cart weight */ return $weight + 530;}
Another similar script here is but I can't get this to work either:https://stackoverflow.com/questions/64416812/filter-woocommerce-cart-contents-weight-not-applied-for-shipping-weight
Many Thanks
Chris

免责声明

该外包需求信息来源于站外平台,本站仅提供公开信息部分字段展示与订阅服务,更多请查看免责声明

关注公众号,不定期副业成功案例分享
关注公众号

不定期副业成功案例分享

领先一步获取最新的外包任务吗?

立即订阅