<?php
/**
 * PW Rewards Product Reward Points
 *
 * Shows the potential points earned on the product page.
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/single-product/reward-points.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' ) or exit;

?>
<div class="pwlpar-product-rewards-container">
    <div class="pwlpar-product-rewards-program-name">
        <?php echo esc_html( $program_name ); ?>
    </div>
    <div class="pwlpar-product-rewards-contents">
        <?php if ( $is_rewards_member ) : ?>
            <?php
                printf(
                    /* translators: %s is the points earned for the product */
                    esc_html__( 'Earn up to %s when you purchase this product.', 'pw-loyalty-points-and-rewards-for-woocommerce' ),
                    '<span class="pwlpar-product-rewards-potential-points-earned" style="font-weight: bold;">' . esc_html( pwlpar_format_points( $potential_points ) ) . '</span> ' . esc_html( _n( 'point', 'points', $potential_points, 'pw-loyalty-points-and-rewards-for-woocommerce' ) )
                );
            ?>
        <?php else : ?>
            <?php
                printf(
                    /* translators: %s is the points earned for the product */
                    esc_html__( 'You could earn up to %s when you purchase this product.', 'pw-loyalty-points-and-rewards-for-woocommerce' ),
                    '<span class="pwlpar-product-rewards-potential-points-earned" style="font-weight: bold;">' . esc_html( pwlpar_format_points( $potential_points ) ) . '</span> ' . esc_html( _n( 'point', 'points', $potential_points, 'pw-loyalty-points-and-rewards-for-woocommerce' ) )
                );
            ?>
            <a href="<?php echo esc_attr( pwlpar_get_join_url() ); ?>" class="pwlpar-button pwlpar-button-small"><?php esc_html_e( 'Find out more', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></a>
        <?php endif; ?>
    </div>
</div>
<?php
