zZzzZ.
home2
/
zrzvbdry
/
couponetive.com
/
wp-content
/
themes
/
retail-pro-main
New Folder
Editing: single-coupon.php
Save
Cancel
<?php /** * The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * * @package WP Coupon */ get_header(); /** * Hooks wpcoupon_after_header * * @see wpcoupon_page_header(); */ do_action( 'wpcoupon_after_header' ); $layout = wpcoupon_get_site_layout(); global $post; wpcoupon_setup_coupon( $post ); the_post(); ?> <div id="content-wrap" class="single-coupon-container container <?php echo esc_attr( $layout ); ?>"> <div id="primary" class="content-area single-store-page"> <main id="main" class="site-main" role="main"> <?php $has_thumb = wpcoupon_maybe_show_coupon_thumb(); $has_expired = wpcoupon_coupon()->has_expired(); ?> <div class="single-coupon-box store-signle-det"> <div data-id="<?php echo wpcoupon_coupon()->ID; ?>" class="coupon-item <?php echo $has_thumb ? 'has-thumb' : 'no-thumb'; ?> store-listing-item c-type-<?php echo esc_attr( wpcoupon_coupon()->get_type() ); ?> coupon-listing-item shadow-box <?php echo ( $has_expired ) ? 'coupon-expired' : 'coupon-live'; ?>"> <?php if ( $has_thumb ) { ?> <div class="store-thumb-link"> <?php wpcoupon_thumb( $has_thumb === 'save_value' ? true : false ); ?> </div> <?php } ?> <div class="latest-coupon"> <div class="c-type"> <span class="c-code c-<?php echo esc_attr( wpcoupon_coupon()->get_type() ); ?>"><?php echo wpcoupon_coupon()->get_coupon_type_text(); ?></span> </div> <h1 class="coupon-title"> <?php edit_post_link('<i class="edit icon"></i>', '', '', wpcoupon_coupon()->ID ); ?> <a title="<?php echo esc_attr( get_the_title( wpcoupon_coupon()->ID ) ); ?>" class="coupon-link" data-type="<?php echo wpcoupon_coupon()->get_type(); ?>" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" data-aff-url="<?php echo esc_attr( wpcoupon_coupon()->get_go_out_url() ); ?>" data-code="<?php echo esc_attr( wpcoupon_coupon()->get_code() ); ?>" href="<?php echo esc_attr( wpcoupon_coupon()->get_href() ); ?>"><?php echo get_the_title( wpcoupon_coupon()->ID ); ?></a> </h1> <p><?php printf( esc_html__( '%1$s Used - %2$s Today', 'retail-pro' ), wpcoupon_coupon()->get_total_used(), wpcoupon_coupon()->get_used_today() ); ?></p> </div> <div class="coupon-detail coupon-button-type"> <?php switch ( wpcoupon_coupon()->get_type() ) { case 'sale': ?> <a rel="nofollow" data-type="<?php echo wpcoupon_coupon()->get_type(); ?>" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" data-aff-url="<?php echo esc_attr( wpcoupon_coupon()->get_go_out_url() ); ?>" class="coupon-deal coupon-button single-coupon-btn" href="<?php echo esc_attr( wpcoupon_coupon()->get_href() ); ?>"><?php esc_html_e( 'Get Deal', 'retail-pro' ); ?> <i class="shop icon"></i></a> <?php break; case 'print': ?> <a rel="nofollow" data-type="<?php echo wpcoupon_coupon()->get_type(); ?>" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" data-aff-url="<?php echo esc_attr( wpcoupon_coupon()->get_go_out_url() ); ?>" class="coupon-print coupon-button single-coupon-btn" href="<?php echo esc_attr( wpcoupon_coupon()->get_href() ); ?>"><?php esc_html_e( 'Print Coupon', 'retail-pro' ); ?> <i class="print icon"></i></a> <?php break; default: ?> <a rel="nofollow" data-type="<?php echo wpcoupon_coupon()->get_type(); ?>" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" href="<?php echo esc_attr( wpcoupon_coupon()->get_href() ); ?>" class="coupon-button coupon-code single-coupon-btn" data-tooltip="<?php echo esc_attr_e( 'Click to copy & open site', 'retail-pro' ); ?>" data-position="top center" data-inverted="" data-code="<?php echo esc_attr( wpcoupon_coupon()->get_code() ); ?>" data-aff-url="<?php echo esc_attr( wpcoupon_coupon()->get_go_out_url() ); ?>"> <span class="code-text" rel="nofollow"><?php echo esc_html( wpcoupon_coupon()->get_code( 8 ) ); ?></span> <span class="get-code"><?php echo esc_html( 'Get Code', 'retail-pro' ); ?></span> </a> <?php } ?> <div class="clear"></div> </div> <div class="clear"></div> <?php if ( wpcoupon_coupon()->is_exclusive() ) { if ( wpcoupon_get_option( 'coupon_item_exclusive' ) != '' ) { echo '<div class="coupon-exclusive">' . wpcoupon_get_option( 'coupon_item_exclusive' ) . '</div>'; } } ?> <div class="coupon-footer coupon-listing-footer"> <ul class="fleft"> <li> <a data-reveal="reveal-comments" href="#"> <?php esc_attr_e( 'See Details', 'retail-pro' ); ?> </a> </li> </ul> <ul class="fright user-ratting ui icon basic buttons"> <li class="ui button icon-popup coupon-vote" data-vote-type="up" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" data-position="top center" data-inverted="" data-tooltip="<?php esc_attr_e( 'This worked', 'retail-pro' ); ?>"> <i class="thumbs up outline icon"></i> </li> <li class="ui button icon-popup coupon-vote" data-vote-type="down" data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" data-position="top center" data-inverted="" data-tooltip="<?php esc_attr_e( "It didn't work", 'retail-pro' ); ?>"> <i class="thumbs down outline icon"></i> </li> </ul> <div data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" class="reveal-content reveal-email"> <span class="close"></span> <h4 class="send-mail-heading"><?php esc_html_e( 'Send this coupon to an email', 'retail-pro' ); ?></h4> <div class="ui fluid action left icon input"> <input class="email_send_to" placeholder="<?php esc_attr_e( 'Email address ...', 'retail-pro' ); ?>" type="text"> <i class="mail outline icon"></i> <div class="email_send_btn ui button btn btn_primary"><?php esc_html_e( 'Send', 'retail-pro' ); ?></div> </div><br> <p><?php esc_html_e( 'This is not a email subscription service. Your email (or your friend\'s email) will only be used to send this coupon.', 'retail-pro' ); ?></p> </div> <div data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" class="reveal-content reveal-share"> <span class="close"></span> <h4><?php esc_html_e( 'Share it with your friends', 'retail-pro' ); ?></h4> <div class="ui fluid left icon input"> <input value="<?php echo wpcoupon_coupon()->get_share_url() ?>" type="text"> <i class="linkify icon"></i> </div> <br> <div class="coupon-share"> <?php $args = array( 'title' => get_the_title( wpcoupon_coupon()->ID ), 'summary' => wpcoupon_coupon()->get_excerpt(140), 'url' => wpcoupon_coupon()->get_share_url() ); echo WPCoupon_Socials::facebook_share( $args ); echo WPCoupon_Socials::twitter_share( $args ); do_action('loop_coupon_more_share_buttons'); ?> </div> </div> <div data-coupon-id="<?php echo wpcoupon_coupon()->ID; ?>" class="reveal-content reveal-comments"> <span class="close"></span> <!-- Tab area--> <form class="tabset"> <!-- Tab 1 --> <input type="radio" name="tabset" id="<?php echo wpcoupon_coupon()->ID; ?>-tab1" aria-controls="<?php echo wpcoupon_coupon()->ID; ?>-tab1" checked="checked"> <label for="<?php echo wpcoupon_coupon()->ID; ?>-tab1">Details</label> <!-- Tab 2 --> <input type="radio" name="tabset" id="<?php echo wpcoupon_coupon()->ID; ?>-tab2" aria-controls="<?php echo wpcoupon_coupon()->ID; ?>-tab2"> <label for="<?php echo wpcoupon_coupon()->ID; ?>-tab2">Comment</label> <div class="tab-panels"> <section id="<?php echo wpcoupon_coupon()->ID; ?>-tab1" class="tab-panel"> <div class="c-type"> <?php if ( ! wpcoupon_coupon()->has_expired() ) { ?> <span class="exp"><?php echo wpcoupon_coupon()->get_expires(); ?></span> <?php } else { ?> <span class="exp has-expired"><?php echo wpcoupon_coupon()->get_expires(); ?></span> <?php } ?> </div> <div class="coupon-des"> <?php if ( wpcoupon_get_option( 'coupon_more_desc', true ) ) { ?> <div class="coupon-des-ellip"><?php echo wpcoupon_coupon()->get_excerpt( false, '<span class="c-actions-span">...<a class="more" href="#">'.esc_html__( 'More', 'wp-coupon' ).'</a></span>', $has_thumb ); ?></div> <?php if ( wpcoupon_coupon()->has_more_content ) { ?> <div class="coupon-des-full"><?php echo str_replace( ']]>', ']]>', apply_filters( 'the_content', wpcoupon_coupon()->post_content.' <a class="more less" href="#">'. esc_html__( 'Less', 'wp-coupon') .'</a>' ) ); ?></div> <?php } ?> <?php } else { ?> <?php echo apply_filters( 'the_content', wpcoupon_coupon()->post_content ); ?> <?php } ?> </div> </section> <section id="<?php echo wpcoupon_coupon()->ID; ?>-tab2" class="tab-panel"> <div class="coupon-comment-wrap"> <div class="coupon-comment"> <?php if ( get_comments_number( ) ) { ?> <h4 class="cm-heading"><?php esc_html_e( 'Showing most recent comments', 'retail-pro' ) ?></h4> <?php } ?> <div data-id="<?php echo wpcoupon_coupon()->ID; ?>" class="comments-coupon-<?php echo wpcoupon_coupon()->ID; ?> ui threaded comments"> <h4><?php esc_html_e( 'Loading comments....', 'retail-pro' ) ?></h4> </div> <?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <h4 class="cm-comment-closed"><?php esc_html_e( 'Comments are closed.', 'retail-pro' ); ?></h4> <?php else: ?> <h4><?php esc_html_e( 'Let others know how much you saved', 'retail-pro' ); ?></h4> <form class="coupon-comment-form" data-cf="<?php echo wpcoupon_coupon()->ID; ?>" action="<?php echo site_url('/'); ?>" method="post"> <div style="display: none;" class="ui success message"> <?php esc_html_e( 'Your comment submitted.', 'retail-pro' ); ?> </div> <div style="display: none;" class="ui negative message"> <?php esc_html_e( 'Something wrong! Please try again later.', 'retail-pro' ); ?> </div> <div class="ui form"> <div class="field comment_content"> <textarea class="comment_content" name="c_comment[comment_content]" placeholder="<?php esc_attr_e( 'Add a comment', 'retail-pro' ); ?>"></textarea> </div> <?php if ( ! is_user_logged_in() ) { ?> <div class="two fields"> <div class="field comment_author"> <input type="text" class="comment_author" name="c_comment[comment_author]" placeholder="<?php esc_attr_e( 'Your Name', 'retail-pro' ); ?>"> </div> <div class="field comment_author_email"> <input type="text" class="comment_author_email" name="c_comment[comment_author_email]" placeholder="<?php esc_attr_e( 'Your Email', 'retail-pro' ) ?>"> </div> </div> <?php } ?> <button type="submit" class="ui button btn btn_primary"><?php esc_html_e( 'Submit', 'retail-pro' ); ?></button> </div> <input type="hidden" name="action" value="wpcoupon_coupon_ajax"> <input type="hidden" name="st_doing" value="new_comment"> <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce(); ?>"> <input type="hidden" name="c_comment[comment_parent]" class="comment_parent"> <input type="hidden" name="c_comment[comment_post_ID]" value="<?php echo wpcoupon_coupon()->ID; ?>" class="comment_post_ID"> </form> <?php endif; ?> </div> </div> </section> </div> </form> <!-- Tab Area--> </div> </div> <?php get_template_part( 'loop/coupon-modal' ); ?> </div> </div> <?php if ( wpcoupon_get_option( 'enable_single_popular', true ) ) { // in this stores $number = wpcoupon_get_option( 'single_popular_number', 3 ); $number = absint( $number ); $custom_text = wpcoupon_get_option( '' ); if ( ! $custom_text ) { $custom_text = esc_html__( 'Most popular {store} coupons.', 'retail-pro' ); } $terms = get_the_terms( $post->ID, 'coupon_store' ); if ( $terms ) { $current = current_time( 'timestamp' ); $tag_ids = wp_list_pluck( $terms, 'term_id' ); $first_store = current( $terms ); $custom_text = str_replace( '{store}', $first_store->name, $custom_text ); $args = array( 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'coupon_store', 'field' => 'term_id', 'terms' => $tag_ids, 'operator' => 'IN', ), ), 'post__not_in' => array( $post->ID ), 'posts_per_page' => $number, 'meta_key' => '_wpc_used', 'orderby' => 'meta_value_num', 'order' => 'desc', ); $args = apply_filters( 'wpcoupon_single_popular_coupons_args', $args ); $wp_query = new WP_Query( $args ); $max_pages = $wp_query->max_num_pages; $coupons = $wp_query->get_posts(); if ( $coupons ) { if ( $custom_text ) { ?> <h2 class="section-heading coupon-status-heading"><?php echo wp_kses_post( $custom_text ); ?></h2> <?php } $tpl_name = 'cat'; foreach ( $coupons as $post ) { wpcoupon_setup_coupon( $post ); get_template_part( 'loop/loop-coupon', $tpl_name ); } ?> <?php } } wp_reset_query(); } ?> <?php echo get_the_term_list( $post->ID, 'coupon_tag', '<p class="coupon-tags"><strong>' . esc_html__( 'Tags:', 'retail-pro' ) . ' </strong>', ', ', '</p>' ); ?> <div class="single-coupon-comments shadow-box content-box"> <?php comments_template(); ?> </div> </main><!-- #main --> </div><!-- #primary --> <?php if ( $layout != 'no-sidebar' ) { get_sidebar(); } ?> </div> <!-- /#content-wrap --> <?php $page_breadcrumb = wpcoupon_get_option( 'page_breadcrumb' ); ?> <?php if ($page_breadcrumb==true) {?> <div class="container"> <div class="retail_pro_breadcrumb"> <?php /** * Hooked * * @see wpcoupon_breadcrumb() - 15 * * @since 1.0.0 */ do_action( 'wpcoupon_before_container' ); ?> </div> </div> <?php }?> <div class="container"> <?php if ( is_active_sidebar( 'nl-widget' ) ){ ?> <div class="nl-widget"> <?php dynamic_sidebar( 'nl-widget' );?> </div> <?php } ?> </div> <?php get_footer(); ?>