Plugin Directory

Changeset 3310654


Ignore:
Timestamp:
06/12/2025 05:13:49 PM (10 months ago)
Author:
digihold
Message:

Update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • digicommerce/trunk/templates/checkout/form-checkout.php

    r3309447 r3310654  
    474474                                                            $subtotal += $item['price'];
    475475                                                        }
     476
     477                                                        // Check if this is a bundle product
     478                                                        $bundle_products_meta = get_post_meta( $item['product_id'], 'digi_bundle_products', true );
     479                                                        $is_bundle = ! empty( $bundle_products_meta ) && is_array( $bundle_products_meta ) && count( array_filter( $bundle_products_meta ) ) > 0;
     480
    476481                                                        ?>
    477482                                                        <div class="cart-item flex items-center justify-between gap-2 py-2 first:pt-0 last:pb-0" data-item-index="<?php echo esc_attr( $index ); ?>">
     
    479484                                                                <div class="cart-item-name<?php echo esc_attr( $class ); ?> flex justify-between flex-col md:flex-row gap-1 text-medium font-bold text-dark-blue">
    480485                                                                    <div class="flex-1 flex flex-col gap-2">
    481                                                                         <?php echo esc_html( $item['name'] ); ?>
    482                                                                         <?php if ( $subscription_enabled ) : ?>
     486                                                                        <?php
     487                                                                        echo esc_html( $item['name'] );
     488
     489                                                                        if ( $is_bundle ) :
     490                                                                            $valid_bundles = array();
     491                                                                           
     492                                                                            foreach ( $bundle_products_meta as $bundle_product_id ) {
     493                                                                                if ( empty( $bundle_product_id ) ) continue;
     494                                                                               
     495                                                                                $bundle_product_id = intval( $bundle_product_id );
     496                                                                                $bundle_product = get_post( $bundle_product_id );
     497                                                                                if ( $bundle_product && 'publish' === $bundle_product->post_status ) {
     498                                                                                    $valid_bundles[] = $bundle_product->post_title;
     499                                                                                }
     500                                                                            }
     501                                                                           
     502                                                                            if ( ! empty( $valid_bundles ) ) :
     503                                                                                $bundle_title = apply_filters(
     504                                                                                    'digicommerce_bundle_includes_title',
     505                                                                                    esc_html__( 'This bundle includes:', 'digicommerce' ),
     506                                                                                    $item
     507                                                                                );
     508                                                                                ?>
     509                                                                                <div class="flex flex-col gap-1 text-sm font-normal text-gray-600">
     510                                                                                    <div class="font-medium text-dark-blue">
     511                                                                                        <?php echo esc_html( $bundle_title ); ?>
     512                                                                                    </div>
     513                                                                                    <ul class="list-none ml-0 pl-0 space-y-1">
     514                                                                                        <?php foreach ( $valid_bundles as $bundle_name ) : ?>
     515                                                                                            <li class="flex items-center gap-2">
     516                                                                                                <span class="text-gold">•</span>
     517                                                                                                <strong><?php echo esc_html( $bundle_name ); ?></strong>
     518                                                                                            </li>
     519                                                                                        <?php endforeach; ?>
     520                                                                                    </ul>
     521                                                                                </div>
     522                                                                                <?php
     523                                                                            endif;
     524                                                                        endif;
     525                                                                       
     526                                                                        if ( $subscription_enabled ) : ?>
    483527                                                                            <div class="flex flex-col gap-1 text-sm font-normal text-gray-600">
    484528                                                                                <div class="flex items-center gap-2">
Note: See TracChangeset for help on using the changeset viewer.