<?php
/**
 * PW Rewards Cart Rewards
 *
 * Shows the rewards details on the Cart page.
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-rewards.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;

do_action( 'pwlpar_before_cart_rewards' );

?>
<div class="pwlpar-cart-rewards-container">
    <h2 class="pwlpar-cart-rewards-program-name"><?php echo esc_html( $program_name ); ?></h2>
    <?php if ( $is_rewards_member ) : ?>
        <p><?php esc_html_e( 'Points earned with this order', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?>: <strong><?php echo esc_html( pwlpar_format_points( $points_earned ) ); ?></strong></p>
    <?php else : ?>
        <?php
            /* translators: %s is the points earned for the product */
            printf( esc_html__( 'You could be earning %s points with this purchase!', 'pw-loyalty-points-and-rewards-for-woocommerce' ), '<strong>' . esc_html( pwlpar_format_points( $points_earned ) ) . '</strong>' );
        ?>
        <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>
<?php

do_action( 'pwlpar_after_cart_rewards' );
