Overriding Price in Cart: Not Working After Update
-
WC Fields Factory: Version 2.0.5
I have been successfully overriding the product price in the cart using a value of a hidden wccpf custom field. This has stopped working when I have run an update to the plugin. Please see function below:
function add_custom_price( $cart_object ) { global $woocommerce; $items = $woocommerce->cart->get_cart(); foreach($items as $item => $value) { $title = $value['wccpf_product_name']; $value['data']->set_name($title); $price = $value['wccpf_product_price']; $value['data']->set_price($price); } }
When adding the product to the cart it is no longer picking up the value of the field and instead is processing it as an array. Any ideas on where I am going wrong or what has changed in the code? This does seem to be a major bug as it not working with any fields as it should. Your prompt response will be appreciated. Love the plugin and hard work done. If I can help in anyway please advise
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Overriding Price in Cart: Not Working After Update’ is closed to new replies.