php adding to cart with fields filled out
-
I am able to add my product to the cart just fine, but I want to set the fields at the same time. I would think this is the solution: (assumed is one item in the cart, I am trying to set the “Name” field with the id 69f650596a3b4)
//now add product fields
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
$woocommerce->cart->cart_contents[ $cart_item_key ][’69f650596a3b4′] = “testing”;
}
I have also tried the normal names of the fields (“Name”, “Address”, etc) instead of the ID
thanks
You must be logged in to reply to this topic.