<?php
/**
 * PW Rewards Reward
 *
 * Shows an individual reward item for the rewards program.
 *
 * This template can be overridden by copying it to yourtheme/pw-rewards/reward.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_reward' );

?>
<div class="pwlpar-reward">
    <div class="pwlpar-reward-details">
        <div>
            <img src="<?php echo esc_attr( $offer_image_url ); ?>" class="pwlpar-reward-image" alt="<?php echo esc_attr( $offer_title ); ?>">
        </div>
        <div class="pwlpar-reward-name">
            <div class="pwlpar-reward-title"><?php echo wp_kses_post( $offer_title ); ?></div>
            <div class="pwlpar-reward-description pwlpar-nl2br"><?php echo wp_kses_post( $offer_description ); ?></div>
        </div>
    </div>
    <?php if ( !$is_reward_in_cart ) : ?>
        <a href="<?php echo esc_attr( $apply_url ); ?>" class="pwlpar-reward-apply-button pwlpar-button"><?php esc_html_e( 'Apply discount to cart', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></a>
    <?php else : ?>
        <a href="<?php echo esc_attr( $remove_url ); ?>" class="pwlpar-reward-remove-button pwlpar-button pwlpar-button-remove"><?php esc_html_e( 'Remove from Cart', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></a>
    <?php endif; ?>
</div>
<?php

do_action( 'pwlpar_after_reward' );
