How do I add a value to the $values array?
-
I’m trying to get my own custo`m value in the $values array, but I’m having some trouble to find out where the array is actually build.
I think I need to edit class-wc-cart.php, but if I just add my variable to
$this->cart_contents[$cart_item_key] = apply_filters( ‘woocommerce_add_cart_item’, array_merge( $cart_item_data, array(
‘product_id’ => $product_id,
‘variation_id’ => $variation_id,
‘variation’ => $variation,
‘quantity’ => $quantity,
‘data’ => $product_data
) ), $cart_item_key );`I get an error. So I was wondering where the $values array is actually build, and how to add a custom value.
The topic ‘How do I add a value to the $values array?’ is closed to new replies.