/* 
Theme Name: Graphic House child theme
Theme URI: https://graphichouse.dk
Description: Graphic House child theme er et WordPress-tema for kreative, der kombinerer "Hello" temaets enkelhed med avanceret grafisk design, optimal til visuel fremvisning og fuld tilpasning.
Author: Elementor Team // Graphic House
Author URI: https://elementor.com/
Template: hello-elementor
Version: 1.0.1
Text Domain: graphic-house-child-theme
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/*
    Add your custom styles here
*/

// Display the product SKU in the cart and checkout pages
function aovup_display_product_sku_in_cart_and_checkout($item_data, $cart_item) {
    // Get the product ID from the cart item
    $product_id = $cart_item['product_id'];

    // Get the SKU of the product
    $product = wc_get_product($product_id);
    $product_sku = $product->get_sku();

    // Add the SKU to the cart item data
    if (!empty($product_sku)) {
        $item_data[] = array(
            'key' => 'SKU',
            'value' => $product_sku,
        );
    }

    return $item_data;
}
add_filter('woocommerce_get_item_data', 'aovup_display_product_sku_in_cart_and_checkout', 10, 2);