[ad_1]
Hi there,
The configuration is stored in the configurator_data attribute.
You can access it like this:
foreach( WC()->cart->get_cart() as $cart_item ) {$product_id = $cart_item['product_id'];
if ( mkl_pc_is_configurable( $product_id ) && isset( ( $cart_item['configurator_data'] ) ) ) {
foreach( $cart_item['configurator_data'] as $selected_choice ) {
// dump the layer name
var_dump( $selected_choice->get_layer( 'name' ) );
// dump the choice name
var_dump( $selected_choice->get_choice( 'name' ) );
}
// Alternatively, you can use the simpler configurator_data_raw data
var_dump( $cart_item['configurator_data_raw'] );
}
}
Marc
-
This reply was modified 3 hours, 13 minutes ago by
Marc Lacroix. Reason: Fixed code