HEX
Server: Apache
System: Linux webd001.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: mciraet (192513)
PHP: 8.2.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/mciraet/www/wp-content/themes/movedo-child/woocommerce/myaccount/dashboard.php
<?php
/**
 * My Account Dashboard
 *
 * Shows the first intro screen on the account dashboard.
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/dashboard.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://woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates
 * @version 4.4.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

$allowed_html = array(
    'a' => array(
        'href' => array(),
    ),
);


function get_user_products() {
    $user_id = get_current_user_id();
    if ($user_id == 0) {
        return array(
            'standard' => false,
            'special'  => false,
            'extra'    => false,
        );
    }

    // Produits standards
    $standard_product_ids = array(4829, 288, 681, 5502, 5483, 4828);

    // Produits spéciaux
    $special_product_ids = array(289, 680);

    // Produits extra (2026)
    $extra_product_ids = array(
        11446, 11445, 11444, 11443, 11442, 11441,
        11436, 1143, 11513, 11512, 11509, 11508,
        11506, 11501, 11435
    );

    $has_standard = false;
    $has_special  = false;
    $has_extra    = false;

    $orders = wc_get_orders(array(
        'customer' => $user_id,
        'status'   => 'completed',
    ));

    foreach ($orders as $order) {
        foreach ($order->get_items() as $item) {
            $product_id = $item->get_product_id();

            if (in_array($product_id, $special_product_ids)) {
                $has_special = true;
            }

            if (in_array($product_id, $standard_product_ids)) {
                $has_standard = true;
            }

            if (in_array($product_id, $extra_product_ids)) {
                $has_extra = true;
            }
        }
    }

    return array(
        'standard' => $has_standard,
        'special'  => $has_special,
        'extra'    => $has_extra,
    );
}

$user_products = get_user_products();
?>

<?php if ($user_products['extra']) : ?>
    <h3 class="title-dasboard">
        Vous avez un abonnement actif jusqu'au /</br> U hebt een abonnement dat geldig is tot : 31/12/26
    </h3>
<?php endif; ?>

<?php if ($user_products['special']) : ?>
    <h3 class="title-dasboard">
        Vous êtes membre à vie ! / Je bent lid voor het leven !
    </h3>
<?php endif; ?>

<?php if (
    !$user_products['standard'] &&
    !$user_products['special'] &&
    !$user_products['extra']
) : ?>
    <h3 class="title-dasboard">
        Vous n'avez pas encore d'abonnement. / Je hebt nog geen abonnement.
    </h3>
<?php endif; ?>





<p>
    <?php
    printf(

        wp_kses( __( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ), $allowed_html ),
        '<strong>' . esc_html( $current_user->display_name ) . '</strong>',
        esc_url( wc_logout_url() )
    );
    ?>
</p>

<p>
    <?php

    $dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">billing address</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
    if ( wc_shipping_enabled() ) {
 
        $dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">shipping and billing addresses</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
    }
    printf(
        wp_kses( $dashboard_desc, $allowed_html ),
        esc_url( wc_get_endpoint_url( 'orders' ) ),
        esc_url( wc_get_endpoint_url( 'edit-address' ) ),
        esc_url( wc_get_endpoint_url( 'edit-account' ) )
    );
    ?>
</p>

<?php
    /**
     * My Account dashboard.
     *
     * @since 2.6.0
     */
    do_action( 'woocommerce_account_dashboard' );

    /**
     * Deprecated woocommerce_before_my_account action.
     *
     * @deprecated 2.6.0
     */
    do_action( 'woocommerce_before_my_account' );

    /**
     * Deprecated woocommerce_after_my_account action.
     *
     * @deprecated 2.6.0
     */
    do_action( 'woocommerce_after_my_account' );