/*
Theme Name: Divi Child
Theme URI: http://www.elegantthemes.com/gallery/divi/
Template: Divi
Author: Elegant Themes
Author URI: http://www.elegantthemes.com
Description: Smart. Flexible. Beautiful. Divi is the most powerful theme in our collection.
Version: 5.6.0.1779827771
Updated: 2026-05-26 20:36:11

*/
@import url('../Divi/style.css');

/* add_filter( 'wc_stripe_intent_metadata', 'add_my_custom_stripe_metadata', 10, 2 );
function add_my_custom_stripe_metadata( $metadata, $order, $prepared_source = null ) {
    $count = 1;
    foreach ( $order->get_items() as $item_id => $line_item ) {
        $product = $line_item->get_product();
        $metadata[ 'Item ' . $count ] = $product->get_title() . ' (Qty: ' . $line_item->get_quantity() . ')';
        $count++;
    }
    return $metadata;
}*/

add_filter( 'wc_stripe_payment_description', 'my_stripe_payment_description', 10, 2 );

function my_stripe_payment_description( $description, $order ) {

    $product_names = array();

    foreach ( $order->get_items() as $item ) {
        $product_names[] = $item->get_name();
    }

    return sprintf(
        'Order #%s - %s',
        $order->get_order_number(),
        implode(', ', $product_names)
    );
}