<?php
/**
 * Cart item data (when outputting non-flat)
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-item-data.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see         https://docs.woocommerce.com/document/template-structure/
 * @package     WooCommerce\Templates
 * @version     2.4.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

?>
<dl class="variation">
	<?php foreach ( $item_data as $epofw_data ) : ?>
		<?php
		// Use 'name' if available (our plugin), otherwise fall back to 'key' (WooCommerce core/other plugins).
		$epofw_label   = isset( $epofw_data['name'] ) ? $epofw_data['name'] : ( isset( $epofw_data['key'] ) ? $epofw_data['key'] : '' );
		$epofw_key     = isset( $epofw_data['key'] ) ? $epofw_data['key'] : '';
		$epofw_display = isset( $epofw_data['display'] ) ? $epofw_data['display'] : ( isset( $epofw_data['value'] ) ? $epofw_data['value'] : '' );
		?>
		<?php if ( ! empty( $epofw_label ) && ! empty( $epofw_display ) ) : ?>
			<dt class="<?php echo sanitize_html_class( 'variation-' . $epofw_key ); ?>"><?php echo wp_kses_post( $epofw_label ); ?>:</dt>
			<dd class="<?php echo sanitize_html_class( 'variation-' . $epofw_key ); ?>"><?php echo wp_kses_post( wpautop( $epofw_display ) ); ?></dd>
		<?php endif; ?>
	<?php endforeach; ?>
</dl>
