Getting configuration option in cart
-
Hi. I am trying to conditionally run some code but need to be able to check what configuration option the customer has selected. Is there a direct way to access this data from the cart object?
foreach( WC()->cart->get_cart() as $cart_item ) {
? ? ? ? $product_id = $cart_item['product_id'];
? ? ? ? if ( is_configurable_product( $product_id ) ) {
? ? ? ? ? ? // Get configuration option here
? ? ? ? }
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.