I’m trying to insert my own custom value in the $values array, but I don’t know how?
I think I need to edit class-wc-cart.php, but how?
$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,
'dealer-name' => 'bindiya', //ex. dealer name
'data' => $product_data
) ), $cart_item_key );
I want to add dealer name of product associate with this particular product in array while user press add to cart button.
And later on i have to display this all products dealer name associated with it in admin side order listing.
Can someone help me?
Thank in advance.