Bundle Product Name missing from wc_add_to_cart_message
-
The product name was not being returned when adding a bundle product to the cart, when the wc_add_to_cart_message() function was called.
I modified this file:
classes/product-form.php… and updated the wcpb_add_to_cart() method to pass the product ID as the key and product QTY as the value of the $added_to_cart array.
…
if ( $passed_validation ) {
$added_to_cart = array();
if ( WC()->cart->add_to_cart( $product_id, $quantity ) ) {
$was_added_to_cart = true;
$added_to_cart[$product_id] = $quantity;
}
}
….This solved the problem.
- The topic ‘Bundle Product Name missing from wc_add_to_cart_message’ is closed to new replies.