<?php
/**
 * PW Rewards Join
 *
 * Shows the form to invite customers to join the rewards program.
 *
 * This template can be overridden by copying it to yourtheme/pw-rewards/join.php.
 *
 * HOWEVER, on occasion Pimwick 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/
 */

defined( 'ABSPATH' ) || exit;

do_action( 'pwlpar_before_join' );

?>
<div class="pwlpar-join-container">
    <?php if ( $is_rewards_member ) : ?>
        <div class="pwlpar-join-already-joined">
            <?php
                /* translators: %s is the rewards program name */
                printf( esc_html__( 'You are already enrolled in %s!', 'pw-loyalty-points-and-rewards-for-woocommerce' ), esc_html( pwlpar_program_name() ) );
            ?>
            <div>
                <a href="<?php echo esc_attr( pwlpar_get_home_url() ); ?>" class="pwlpar-button"><?php esc_html_e( 'View your account', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></a>
            </div>
        </div>
    <?php else : ?>
        <div class="pwlpar-join-container">
            <div>
                <a href="<?php echo esc_attr( pwlpar_get_home_url() ); ?>" id="pwlpar-join-button" class="pwlpar-button"><?php echo esc_html( $join_button_title ); ?></a>
            </div>
        </div>
    <?php endif; ?>
</div>
<?php

do_action( 'pwlpar_after_join' );
