plugin updates

This commit is contained in:
Tony Volpe
2024-06-17 15:33:26 -04:00
parent 3751a5a1a6
commit e4e274a9a7
2674 changed files with 0 additions and 507851 deletions

View File

@@ -1,81 +0,0 @@
<?php
/**
* Acknowledgement Email Content
*
* @author StoreApps
* @version 1.3.0
* @package woocommerce-smart-coupons/templates/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label;
if ( ! isset( $email ) ) {
$email = null;
}
if ( has_action( 'woocommerce_email_header' ) ) {
do_action( 'woocommerce_email_header', $email_heading, $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
} else {
woocommerce_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
}
}
$receivers_email = array_unique( $receivers_detail );
if ( empty( $email_scheduled_details ) ) {
/* translators: 1. Receiver's count 2. Singular/Plural label for store credit(s) 3. Receiver name 4. Receiver details */
$message = __( 'You have successfully sent %1$d %2$s %3$s %4$s', 'woocommerce-smart-coupons' );
} else {
/* translators: 1. Receiver's count 2. Gift Card/s 3. Receiver name 4. Receiver details */
$message = __( 'You have scheduled to send %1$d %2$s %3$s %4$s', 'woocommerce-smart-coupons' );
$receivers_email = array_map(
function( $email ) use ( $email_scheduled_details ) {
// Filter for time format of acknowledgement email.
$time_format = apply_filters( 'wc_sc_acknowledgement_email_time_format', get_option( 'date_format', 'Y-m-d' ) . ' ' . get_option( 'time_format', 'H:i' ) );
// Check if the scheduled timestamps are available.
if ( isset( $email_scheduled_details[ $email ] ) && is_array( $email_scheduled_details[ $email ] ) ) {
$scheduled_times = array_map(
function( $time ) use ( $time_format ) {
// Convert to date format.
$time = get_date_from_gmt( gmdate( 'c', $time ), $time_format );
return date_i18n( $time_format, strtotime( $time ) );
},
$email_scheduled_details[ $email ]
);
// Concat scheduled times to comma separated times.
return $email . ' ' . __( 'on', 'woocommerce-smart-coupons' ) . ' ' . implode( ', ', $scheduled_times );
}
return $email;
},
$receivers_email
);
}
$singular = ( ! empty( $store_credit_label['singular'] ) ) ? ucwords( $store_credit_label['singular'] ) : __( 'Gift card', 'woocommerce-smart-coupons' );
$plural = ( ! empty( $store_credit_label['plural'] ) ) ? ucwords( $store_credit_label['plural'] ) : __( 'Gift cards', 'woocommerce-smart-coupons' );
$coupon_type = ( $receiver_count > 1 ) ? $plural : $singular;
if ( 'yes' === $contains_core_coupons ) {
$coupon_type = _n( 'Coupon', 'Coupons', $receiver_count, 'woocommerce-smart-coupons' );
}
$is_receiver_name = ! empty( $gift_certificate_receiver_name );
echo esc_html( sprintf( $message, $receiver_count, strtolower( $coupon_type ), ( ( ! empty( $gift_certificate_receiver_name ) || ! empty( $receivers_email ) ) ? __( 'to', 'woocommerce-smart-coupons' ) . ' ' . $gift_certificate_receiver_name : '' ), ( true === $is_receiver_name ? '(' : '' ) . implode( ', ', $receivers_email ) . ( true === $is_receiver_name ? ')' : '' ) ) );
if ( has_action( 'woocommerce_email_footer' ) ) {
do_action( 'woocommerce_email_footer', $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-footer.php' );
} else {
woocommerce_get_template( 'emails/email-footer.php' );
}
}

View File

@@ -1,37 +0,0 @@
<?php
/**
* Call For Credit Form
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<br /><br />
<div id="call_for_credit" class="wc-sc-call-for-credit-container <?php echo esc_attr( $custom_classes['container'] ); ?>">
<div class="wc-sc-row <?php echo esc_attr( $custom_classes['row'] ); ?>">
<div class="wc-sc-label <?php echo esc_attr( $custom_classes['label'] ); ?>">
<label for="credit_called">
<?php
if ( ! empty( $currency_symbol ) ) {
echo wp_kses_post( stripslashes( $smart_coupon_store_gift_page_text ) . ' (' . $currency_symbol . ')' ); // phpcs:ignore
} else {
echo wp_kses_post( stripslashes( $smart_coupon_store_gift_page_text ) ); // phpcs:ignore
}
?>
</label>
</div>
<div class="wc-sc-input <?php echo esc_attr( $custom_classes['input'] ); ?>">
<?php echo wp_kses( $input_element, $allowed_html ); // This code block is required in this template. ?>
</div>
</div>
<div class="wc-sc-row <?php echo esc_attr( $custom_classes['row'] ); ?>">
<p id="error_message" class="wc-sc-error <?php echo esc_attr( $custom_classes['error'] ); ?>" style="color: red;"></p>
</div>
</div><br />

View File

@@ -1,253 +0,0 @@
<?php
/**
* Coupon Email Content
*
* @author StoreApps
* @version 1.8.0
* @package woocommerce-smart-coupons/templates/plain/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label, $woocommerce_smart_coupon;
if ( ! isset( $email ) ) {
$email = null;
}
if ( has_action( 'woocommerce_email_header' ) ) {
do_action( 'woocommerce_email_header', $email_heading, $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
} else {
woocommerce_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
}
}
?>
<style type="text/css">
.coupon-container {
margin: .2em;
box-shadow: 0 0 5px #e0e0e0;
display: inline-table;
text-align: center;
cursor: pointer;
padding: .55em;
line-height: 1.4em;
}
.coupon-content {
padding: 0.2em 1.2em;
}
.coupon-content .code {
font-family: monospace;
font-size: 1.2em;
font-weight:700;
}
.coupon-content .coupon-expire,
.coupon-content .discount-info {
font-family: Helvetica, Arial, sans-serif;
font-size: 1em;
}
.coupon-content .discount-description {
font: .7em/1 Helvetica, Arial, sans-serif;
width: 250px;
margin: 10px inherit;
display: inline-block;
}
</style>
<style type="text/css"><?php echo ( isset( $coupon_styles ) && ! empty( $coupon_styles ) ) ? esc_html( wp_strip_all_tags( $coupon_styles, true ) ) : ''; // phpcs:ignore ?></style>
<?php
if ( 'custom-design' !== $design ) {
?>
<style type="text/css">
:root {
--sc-color1: <?php echo esc_html( $background_color ); ?>;
--sc-color2: <?php echo esc_html( $foreground_color ); ?>;
--sc-color3: <?php echo esc_html( $third_color ); ?>;
}
</style>
<?php
}
?>
<p>
<?php
echo esc_html__( 'To redeem your discount click on the following coupon(s):', 'woocommerce-smart-coupons' );
?>
</p>
<?php
if ( ! empty( $receiver_details ) ) {
echo '<div id="sc-cc"><div class="sc-coupons-list">';
$order = ( ! empty( $order_id ) ) ? wc_get_order( $order_id ) : null; // phpcs:ignore
foreach ( $receiver_details as $receiver_data ) {
$coupon_code = $receiver_data['code'];
$sender_message = isset( $receiver_data['message'] ) ? $receiver_data['message'] : '';
$coupon = new WC_Coupon( $coupon_code );
if ( $woocommerce_smart_coupon->is_wc_gte_30() ) {
if ( ! is_object( $coupon ) || ! is_callable( array( $coupon, 'get_id' ) ) ) {
continue;
}
$coupon_id = $coupon->get_id();
if ( empty( $coupon_id ) ) {
continue;
}
$is_free_shipping = ( $coupon->get_free_shipping() ) ? 'yes' : 'no';
$expiry_date = $coupon->get_date_expires();
$coupon_code = $coupon->get_code();
} else {
$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;
$is_free_shipping = ( ! empty( $coupon->free_shipping ) ) ? $coupon->free_shipping : '';
$expiry_date = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : '';
$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';
}
$coupon_amount = $woocommerce_smart_coupon->get_amount( $coupon, true, $order );
$coupon_post = get_post( $coupon_id );
$coupon_data = $woocommerce_smart_coupon->get_coupon_meta_data( $coupon );
$coupon_type = ( ! empty( $coupon_data['coupon_type'] ) ) ? $coupon_data['coupon_type'] : '';
if ( 'yes' === $is_free_shipping ) {
if ( ! empty( $coupon_type ) ) {
$coupon_type .= __( ' & ', 'woocommerce-smart-coupons' );
}
$coupon_type .= __( 'Free Shipping', 'woocommerce-smart-coupons' );
}
if ( ! empty( $expiry_date ) ) {
if ( $woocommerce_smart_coupon->is_wc_gte_30() && $expiry_date instanceof WC_DateTime ) {
$expiry_date = ( is_callable( array( $expiry_date, 'getTimestamp' ) ) ) ? $expiry_date->getTimestamp() : null;
} elseif ( ! is_int( $expiry_date ) ) {
$expiry_date = strtotime( $expiry_date );
}
if ( ! empty( $expiry_date ) && is_int( $expiry_date ) ) {
$expiry_time = (int) $woocommerce_smart_coupon->get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );
if ( ! empty( $expiry_time ) ) {
$expiry_date += $expiry_time; // Adding expiry time to expiry date.
}
}
}
$coupon_description = '';
if ( ! empty( $coupon_post->post_excerpt ) && 'yes' === $show_coupon_description ) {
$coupon_description = $coupon_post->post_excerpt;
}
$is_percent = $woocommerce_smart_coupon->is_percent_coupon( array( 'coupon_object' => $coupon ) );
$args = array(
'coupon_object' => $coupon,
'coupon_amount' => $coupon_amount,
'amount_symbol' => ( true === $is_percent ) ? '%' : get_woocommerce_currency_symbol(),
'discount_type' => wp_strip_all_tags( $coupon_type ),
'coupon_description' => ( ! empty( $coupon_description ) ) ? $coupon_description : wp_strip_all_tags( $woocommerce_smart_coupon->generate_coupon_description( array( 'coupon_object' => $coupon ) ) ),
'coupon_code' => $coupon_code,
'coupon_expiry' => ( ! empty( $expiry_date ) ) ? $woocommerce_smart_coupon->get_expiration_format( $expiry_date ) : __( 'Never expires', 'woocommerce-smart-coupons' ),
'thumbnail_src' => $woocommerce_smart_coupon->get_coupon_design_thumbnail_src(
array(
'design' => $design,
'coupon_object' => $coupon,
)
),
'classes' => '',
'template_id' => $design,
'is_percent' => $is_percent,
);
$coupon_target = '';
$wc_url_coupons_active_urls = get_option( 'wc_url_coupons_active_urls' ); // From plugin WooCommerce URL coupons.
if ( ! empty( $wc_url_coupons_active_urls ) ) {
$coupon_target = ( ! empty( $wc_url_coupons_active_urls[ $coupon_id ]['url'] ) ) ? $wc_url_coupons_active_urls[ $coupon_id ]['url'] : '';
}
if ( ! empty( $coupon_target ) ) {
$coupon_target = home_url( '/' . $coupon_target );
} else {
$coupon_target = home_url( '/?sc-page=shop&coupon-code=' . $coupon_code );
}
$coupon_target = apply_filters( 'sc_coupon_url_in_email', $coupon_target, $coupon );
?>
<div>
<?php
if ( ! empty( $sender_message ) ) {
?>
<div>
<?php
echo wp_unslash( $sender_message ); // phpcs:ignore
?>
</div>
<?php
}
?>
<div style="margin: 10px 0;" title="<?php echo esc_html__( 'Click to visit store. This coupon will be applied automatically.', 'woocommerce-smart-coupons' ); ?>">
<a href="<?php echo esc_url( $coupon_target ); ?>" style="color: #444;">
<?php wc_get_template( 'coupon-design/' . $design . '.php', $args, '', plugin_dir_path( WC_SC_PLUGIN_FILE ) . 'templates/' ); ?>
</a>
</div>
</div>
<?php
}
echo '</div></div>';
}
$site_url = ! empty( $url ) ? $url : home_url();
?>
<center>
<a href="<?php echo esc_url( $site_url ); ?>"><?php echo esc_html__( 'Visit store', 'woocommerce-smart-coupons' ); ?></a>
<?php
$is_print = get_option( 'smart_coupons_is_print_coupon', 'yes' );
$is_print = apply_filters( 'wc_sc_email_show_print_link', wc_string_to_bool( $is_print ), array( 'source' => $woocommerce_smart_coupon ) );
$coupons_to_print = ( ! empty( $receiver_details ) ) ? wp_list_pluck( $receiver_details, 'code' ) : array();
if ( true === $is_print && ! empty( $coupons_to_print ) ) {
$print_coupon_url = add_query_arg(
array(
'print-coupons' => 'yes',
'source' => 'wc-smart-coupons',
'coupon-codes' => implode(
',',
$coupons_to_print
),
),
home_url()
);
?>
|
<a href="<?php echo esc_url( $print_coupon_url ); ?>" target="_blank"><?php echo esc_html( _n( 'Print coupon', 'Print all coupons', count( $coupons_to_print ), 'woocommerce-smart-coupons' ) ); ?></a>
<?php
}
?>
</center>
<?php if ( ! empty( $from ) ) { ?>
<p>
<?php
echo esc_html__( 'You got these coupons ', 'woocommerce-smart-coupons' ) . ' ' . esc_html( $from ) . esc_html( $sender );
?>
</p>
<?php } ?>
<div style="clear:both;"></div>
<?php
if ( has_action( 'woocommerce_email_footer' ) ) {
do_action( 'woocommerce_email_footer', $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-footer.php' );
} else {
woocommerce_get_template( 'emails/email-footer.php' );
}
}

View File

@@ -1,48 +0,0 @@
<?php
/**
* Smart Coupons design - Basic
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="relative p-2 overflow-hidden transition duration-100 ease-in-out transform border rounded-md hover:scale-105 sc-coupon <?php echo esc_attr( $classes ); ?>"
style="
color: var(--sc-color1);
background-color: var(--sc-color2);
border-color: var(--sc-color3);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div>
<div class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" style="color: var(--sc-color1)" fill="none" viewBox="0 0 24 24"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z">
</path>
</svg>
<div class="mx-2 space-y-1 leading-tight">
<div class="inline-flex items-center space-x-1 text-sm font-bold leading-none uppercase"
style="color: var(--sc-color3)">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span class="discount-label"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
<div class="space-y-1 text-xs leading-none" style="filter: saturate(0.5)">
<div class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></div>
<div><?php echo esc_html( $coupon_expiry ); ?></div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,47 +0,0 @@
<?php
/**
* Smart Coupons design - Clipper
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="relative p-1 overflow-hidden transition duration-100 ease-in-out transform border-b border-transparent border-dashed hover:border-b hover:border-gray-700 sc-coupon <?php echo esc_attr( $classes ); ?>"
style="color: var(--sc-color1)" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div>
<div class="flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" style="color: var(--sc-color3)" class="w-5 h-5 -mt-0.5"
fill="currentColor" stroke="none" viewBox="0 0 24 24">
<path
d="M23.4 12.2c-.3 0-.6.3-.6.6v3.5c0 .3.3.6.6.6s.6-.3.6-.6v-3.5c0-.3-.3-.6-.6-.6zm-5.8-6.1h-3.8c-.3 0-.6.3-.6.6s.3.6.6.6h3.8c.3 0 .6-.3.6-.6s-.3-.6-.6-.6zm0 15.5h-3.8c-.3 0-.6.3-.6.6s.3.6.6.6h3.8c.3 0 .6-.3.6-.6 0-.4-.3-.6-.6-.6zm-6.3 0H7.5c-.3 0-.6.3-.6.6s.3.6.6.6h3.8c.3 0 .6-.3.6-.6-.1-.4-.3-.6-.6-.6zM23.4 6.1h-3c-.3 0-.6.3-.6.6s.3.6.6.6h2.5V10c0 .3.3.6.6.6s.6-.3.6-.6V6.7c-.1-.3-.4-.6-.7-.6zm0 12.5c-.3 0-.6.3-.6.6v2.5h-2.7c-.3 0-.6.3-.6.6s.3.6.6.6h3.2c.3 0 .6-.3.6-.6v-3c.1-.5-.2-.7-.5-.7zm-18.5 3H2.2v-2.5c0-.3-.3-.6-.6-.6s-.6.3-.6.6v3c0 .3.3.6.6.6h3.2c.3 0 .6-.3.6-.6.1-.3-.2-.5-.5-.5zM4 10.1c0-.7-.4-1.3-.9-1.6l2.1-1.2 4.3 2.3c.1.1.2.1.3.1.2 0 .4-.1.5-.3.2-.3.1-.6-.2-.8l-3.7-2 3.7-2c.3-.2.4-.5.2-.8-.2-.3-.5-.4-.8-.2L5.2 6 3.1 4.9c.6-.4.9-1 .9-1.7 0-1.1-.9-2-2-2s-2 .9-2 2C0 4 .5 4.6 1.1 5l.1.1 2.9 1.6-3 1.6-.1.1c-.6.4-1 1-1 1.7 0 1.1.9 2 2 2s2-.9 2-2zM2 2.4c.5 0 .9.4.9.9s-.4.8-.9.8-.9-.4-.9-.9.4-.8.9-.8zm-.9 7.7c0-.5.4-.9.9-.9s.9.4.9.9-.4.9-.9.9-.9-.4-.9-.9z">
</path>
<path
d="M11.5 6.1H9.6v1.1h1.9c.3 0 .5-.2.5-.5s-.2-.6-.5-.6zM1.7 16.8c.3 0 .6-.3.6-.6v-2.9H1.1v2.9c0 .3.3.6.6.6z">
</path>
</svg>
<div class="flex-1 space-y-1 leading-tight">
<div class="inline-flex items-center gap-1 text-sm font-bold leading-none uppercase"
style="color: var(--sc-color3)">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span class="discount-label"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
<div class="inline-flex items-center gap-2 text-xs leading-none text-gray-600">
<span
class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span><span><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,61 +0,0 @@
<?php
/**
* Smart Coupons design - Custom
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
if ( empty( $coupon_object ) || ! is_object( $coupon_object ) ) {
$coupon_object = new WC_Coupon( $coupon_code );
}
?>
<div class="coupon-container <?php echo esc_attr( $woocommerce_smart_coupon->get_coupon_container_classes() ); ?> <?php echo esc_attr( $classes ); ?>" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<?php
echo '<div class="coupon-content">
<div class="discount-info">';
$discount_title = '';
if ( ! empty( $coupon_amount ) ) {
$discount_title = ( true === $is_percent ) ? $coupon_amount . '%' : wc_price( $coupon_amount );
}
if ( ! empty( $discount_type ) ) {
$discount_title .= ' ' . $discount_type;
}
$discount_title = apply_filters( 'wc_smart_coupons_display_discount_title', $discount_title, $coupon_object );
if ( $discount_title ) {
// Not escaping because 3rd party developer can have HTML code in discount title.
echo $discount_title; // phpcs:ignore
}
echo '</div>';
echo '<div class="code">' . esc_html( $coupon_code ) . '</div>';
$show_coupon_description = get_option( 'smart_coupons_show_coupon_description', 'no' );
if ( ! empty( $coupon_description ) && 'yes' === $show_coupon_description ) {
echo '<div class="discount-description">' . esc_html( $coupon_description ) . '</div>';
}
if ( ! empty( $coupon_expiry ) ) {
echo '<div class="coupon-expire">' . esc_html( $coupon_expiry ) . '</div>';
}
echo '</div>';
?>
</div>

View File

@@ -1,67 +0,0 @@
<?php
/**
* Smart Coupons design - Cutout
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="transition duration-100 ease-in-out transform sc-coupon hover:-translate-y-1 <?php echo esc_attr( $classes ); ?>"
style="color: var(--sc-color1)" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor"
class="absolute right-0 z-10 w-6 h-6 transform -rotate-90 top-2 rounded-full p-0.5"
style="color: var(--sc-color3); background-color: var(--sc-color2)">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M14.121 14.121L19 19m-7-7l7-7m-7 7l-2.879 2.879M12 12L9.121 9.121m0 5.758a3 3 0 10-4.243 4.243 3 3 0 004.243-4.243zm0-5.758a3 3 0 10-4.243-4.243 3 3 0 004.243 4.243z">
</path>
</svg>
<div class="relative p-2 mr-3 overflow-hidden border-2 border-dashed hover:border-solid" style="
background-color: var(--sc-color2);
border-color: var(--sc-color1);
">
<div class="space-y-1">
<div class="flex items-center justify-between mr-2 text-xs" style="opacity: 0.85">
<div class="flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z">
</path>
</svg>
<span class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span>
</div>
<div class="flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 ml-3 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="validity"><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
</div>
<div class="text-lg font-bold" style="color: var(--sc-color3)">
<div class="flex items-center leading-none">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center mr-1">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
</div>
<div class="flex items-start gap-2">
<div class="flex-1 text-xs leading-tight">
<span><?php echo esc_html( $coupon_description ); ?>
</span>
</div>
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="mt-0.5 object-cover rounded-sm w-6 h-6" />
</div>
</div>
</div>
</div>

View File

@@ -1,44 +0,0 @@
<?php
/**
* Smart Coupons design - Deal
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="max-w-sm relative p-2 pl-2.5 overflow-hidden transition duration-100 ease-in-out transform rounded-md hover:-translate-y-1 hover:shadow sc-coupon <?php echo esc_attr( $classes ); ?>"
style="color: var(--sc-color1); background-color: var(--sc-color2)"
data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div class="space-y-1 leading-tight">
<div class="float-right w-8 h-8 mt-1 mb-2 ml-2 overflow-hidden rounded-md">
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="object-cover w-full h-full" />
</div>
<div class="flex items-center gap-1 text-sm font-bold leading-none uppercase" style="color: var(--sc-color3)">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span class="discount-label"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
<div class="flex items-center gap-2 text-xs leading-none"
style="filter: saturate(0.5); color: var(--sc-color3)">
<span
class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span><span><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
<div class="flex items-start gap-2">
<div class="flex-1 space-y-1">
<div class="text-sm leading-tight">
<?php echo esc_html( $coupon_description ); ?>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,44 +0,0 @@
<?php
/**
* Smart Coupons design - Deliver
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="p-2 overflow-hidden transition duration-100 ease-in-out transform border border-transparent rounded-md hover:border-gray-600 hover:border-dashed sc-coupon <?php echo esc_attr( $classes ); ?>"
style="color: var(--sc-color1); background-color: var(--sc-color2)"
data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div class="-mt-1">
<div class="flex items-center gap-2">
<div class="flex-shrink-0 mt-1 overflow-hidden rounded-md w-9 h-9">
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="object-cover w-full h-full"
style="filter: saturate(0)" />
</div>
<div class="flex-1 space-y-1">
<div class="inline-flex items-center gap-1 text-sm font-bold leading-4 uppercase"
style="color: var(--sc-color3)">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span class="discount-label"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
<div class="text-xs leading-none">
<div class="inline-flex items-center whitespace-no-wrap">
<span class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,67 +0,0 @@
<?php
/**
* Smart Coupons design - Custom
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
if ( empty( $coupon_object ) || ! is_object( $coupon_object ) ) {
$coupon_object = new WC_Coupon( $coupon_code );
}
$background_color = get_option( 'wc_sc_setting_coupon_background_color', '#39cccc' );
$foreground_color = get_option( 'wc_sc_setting_coupon_foreground_color', '#30050b' );
$third_color = get_option( 'wc_sc_setting_coupon_third_color', '#c7638d' );
$style_colors = 'background-color: ' . $background_color . '; color: ' . $foreground_color . '; border-color: ' . $third_color . ';';
?>
<div class="coupon-container <?php echo esc_attr( $woocommerce_smart_coupon->get_coupon_container_classes() ); ?> <?php echo esc_attr( $classes ); ?> <?php echo esc_attr( $template_id ); ?>" style="<?php echo esc_attr( $woocommerce_smart_coupon->get_coupon_style_attributes() ); ?> <?php echo esc_attr( $style_colors ); ?>" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<?php
echo '<div class="coupon-content ' . esc_attr( $woocommerce_smart_coupon->get_coupon_content_classes() ) . '">
<div class="discount-info">';
$discount_title = '';
if ( ! empty( $coupon_amount ) ) {
$discount_title = ( true === $is_percent ) ? $coupon_amount . '%' : wc_price( $coupon_amount );
}
if ( ! empty( $discount_type ) ) {
$discount_title .= ' ' . $discount_type;
}
$discount_title = apply_filters( 'wc_smart_coupons_display_discount_title', $discount_title, $coupon_object );
if ( $discount_title ) {
// Not escaping because 3rd party developer can have HTML code in discount title.
echo $discount_title; // phpcs:ignore
}
echo '</div>';
echo '<div class="code">' . esc_html( $coupon_code ) . '</div>';
$show_coupon_description = get_option( 'smart_coupons_show_coupon_description', 'no' );
if ( ! empty( $coupon_description ) && 'yes' === $show_coupon_description ) {
echo '<div class="discount-description">' . esc_html( $coupon_description ) . '</div>';
}
if ( ! empty( $coupon_expiry ) ) {
echo '<div class="coupon-expire">' . esc_html( $coupon_expiry ) . '</div>';
}
echo '</div>';
?>
</div>

View File

@@ -1,88 +0,0 @@
<?php
/**
* Smart Coupons design - Festive
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
?>
<div class="transition duration-100 ease-in-out transform rounded-md sc-coupon hover:-translate-y-1 hover:scale-105 <?php echo esc_attr( $classes ); ?>"
style="
min-height: 6rem;
color: var(--sc-color1);
border-color: var(--sc-color1);
background: var(--sc-color2);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div class="absolute h-full" style="width: 90px; background-color: var(--sc-color1)"></div>
<svg class="absolute w-full h-full" viewBox="0 0 230 100" preserveAspectRatio="none"
xmlns="http://www.w3.org/2000/svg">
<path d="m230 78.63c-12.15 1.83-19.3 9.74-37.59 14.73a41.13 41.13 0 0 0 -13.77 6.64h51.36z" fill="#4896d1">
</path>
<path d="m80.22 7.26c1.83 1.33 4.38.64 6 .2 11.75-3 16.35-2.54
18.16-6.35a5.6 5.6 0 0 0 .42-1.11h-24.8a3.14 3.14 0 0 0 -1.42 1.16 4.3
4.3 0 0 0 0 3.77 5.1 5.1 0 0 0 1.64 2.33z" fill="#ec1c58"></path>
<path d="m226.76 10a21 21 0 0 0 3.24-2v-8h-36.46c8.46 8.77 22.54 15.44 33.22 10z" fill="#fcbf12"></path>
<path d="m0 26.52c4.69-6.22 8.58-16.52 5.2-21.38-1.47-2.08-3.2-2.44-5.2-2.54z" fill="#1abab3"></path>
</svg>
<div class="absolute bottom-0 -mb-1.5 transform h-8 w-8 left-14 rounded-sm overflow-hidden"
style="--transform-rotate: -15deg">
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="object-cover w-full h-full" />
<svg class="hidden w-full h-full" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" fill="none"
stroke="currentColor" style="color: var(--sc-color3)">
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path d="m37.36 22h7.64v25h-42v-25h7.64"></path>
<path d="m29.76 22h-11.52"></path>
<path d="m21 22h6v25h-6z"></path>
<path d="m10.66 22h-.02-7.64-2v-8h12.02"></path>
<path
d="m20.13 15h-1.19a15.36 15.36 0 0 1 -1.94 0 9.41 9.41 0 0 1 -7.16-3.54 3.91 3.91 0 0 1 -.79-2.74c.23-2.49 1.14-7.72 4.95-7.72 4.6 0 9.2 5.07 9.9 9">
</path>
<path
d="m14.48 14.56a21.28 21.28 0 0 0 -3.82 7.44 43.07 43.07 0 0 0 -1.66 8l4-3 3 5a30.77 30.77 0 0 1 5.05-15.3">
</path>
<path d="m34.98 14h12.02v8h-2-7.64-.02"></path>
<path
d="m24.1 10c.7-3.93 5.3-9 9.9-9 3.81 0 4.72 5.23 4.93 7.72a3.91 3.91 0 0 1 -.79 2.74 9.41 9.41 0 0 1 -7.14 3.54 15.36 15.36 0 0 1 -1.92 0h-1.21">
</path>
<path
d="m27 16.7a30.77 30.77 0 0 1 5 15.3l3-5 4 3a43.07 43.07 0 0 0 -1.66-8 21.28 21.28 0 0 0 -3.82-7.44">
</path>
<circle cx="24" cy="14" r="4"></circle>
<path d="m13 7c2.38-3.18 6.66 1.85 8.31 4.05"></path>
<path d="m26.69 11.05c1.65-2.2 5.93-7.23 8.31-4.05"></path>
</g>
</svg>
</div>
<div class="relative w-full h-full">
<div class="flex items-start h-full pt-4">
<div class="h-full leading-none" style="width: 90px; color: var(--sc-color2)">
<div class="pt-1 pl-2">
<div class="inline-flex items-center">
<span class="text-4xl font-semibold"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : $woocommerce_smart_coupon->get_emoji() ); ?></span>
<sup class="text-lg"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></sup>
</div>
<div class="text-xs uppercase"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : '' ); ?></div>
</div>
</div>
<div class="flex flex-col justify-between flex-1 px-2 text-xs leading-tight">
<div class="description mb-1.5">
<?php echo esc_html( $coupon_description ); ?>
</div>
<div class="text-xs leading-tight" style="filter: opacity(0.8)">
<div class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></div>
<div class="validity"><?php echo esc_html( $coupon_expiry ); ?></div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,64 +0,0 @@
<?php
/**
* Smart Coupons design - Flat
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
?>
<div class="transition duration-100 ease-in-out transform border-2 rounded-md hover:-translate-y-1 hover:shadow sc-coupon <?php echo esc_attr( $classes ); ?>"
style="
min-height: 6rem;
background-color: var(--sc-color2);
color: var(--sc-color1);
border-color: var(--sc-color2);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div>
<div class="flex items-center gap-3 p-2">
<div class="leading-none">
<div class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center"
style="color: var(--sc-color3)">
<span class="text-4xl font-semibold"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : $woocommerce_smart_coupon->get_emoji() ); ?></span>
<sup class="text-lg"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></sup>
</div>
<div class="text-xs uppercase"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : '' ); ?></div>
</div>
<div class="text-sm leading-tight">
<?php echo esc_html( $coupon_description ); ?>
</div>
</div>
<div class="gap-2 border-t border-dotted flex items-center justify-between w-full pb-0.5 pt-1 px-1 text-xs"
style="
color: var(--sc-color1);
filter: saturate(0.75);
border-color: var(--sc-color3);
">
<div class="inline-flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1"
style="color: var(--sc-color3)">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z">
</path>
</svg>
<span class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span>
</div>
<div class="inline-flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1"
style="color: var(--sc-color3)">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="validity"><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
</div>
</div>
</div>

View File

@@ -1,76 +0,0 @@
<?php
/**
* Smart Coupons design - Promotion
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
?>
<div class="transition duration-100 ease-in-out transform border-2 rounded-md hover:scale-105 sc-coupon <?php echo esc_attr( $classes ); ?>"
style="
min-height: 6rem;
background-color: var(--sc-color3);
color: var(--sc-color1);
border-color: var(--sc-color1);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div class="relative flex flex-col">
<svg class="absolute w-24 ml-1 -mt-1" style="
color: var(--sc-color1);
filter: drop-shadow(0 0.1rem 0 rgb(80 80 80 / 0.4));
" fill="currentColor" stroke="none" viewBox="0 0 92.7 88.81" xmlns="http://www.w3.org/2000/svg">
<path
d="m92.7 44.4c0 4.76-5.21 8.63-6.61 12.92s.45 10.68-2.24 14.33-9.21 3.84-12.94 6.56-5.79 8.84-10.24 10.29c-4.28 1.39-9.57-2.32-14.32-2.32s-10.04 3.71-14.35 2.32c-4.44-1.45-6.53-7.6-10.23-10.29s-10.2-2.82-12.92-6.56-.8-9.89-2.25-14.33-6.6-8.16-6.6-12.92 5.21-8.62 6.6-12.91c1.45-4.49-.44-10.63 2.25-14.33s9.2-3.84 12.94-6.56 5.79-8.84 10.21-10.29c4.29-1.39 9.58 2.32 14.33 2.32s10-3.71 14.32-2.32c4.45 1.45 6.54 7.6 10.24 10.29s10.22 2.82 12.94 6.56.8 9.88 2.24 14.33c1.42 4.29 6.63 8.16 6.63 12.91z">
</path>
</svg>
<svg class="absolute w-full h-7" style="color: var(--sc-color2)" fill="currentColor" stroke="none"
viewBox="0 0 230 28" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">
<path
d="m230 0v25.72a10.26 10.26 0 0 0 -2.27.87 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 13.64 13.64 0 0 1 -12.08 0 8.61 8.61 0 0 0 -8.24 0 12.17 12.17 0 0 1 -6 1.41 12.21 12.21 0 0 1 -6-1.41 8.61 8.61 0 0 0 -8.24 0 12.13 12.13 0 0 1 -6 1.41 12.25 12.25 0 0 1 -6-1.41 8.59 8.59 0 0 0 -8.23 0 12.21 12.21 0 0 1 -6 1.41 12.17 12.17 0 0 1 -6-1.41 8.06 8.06 0 0 0 -4.12-1.05 8.06 8.06 0 0 0 -4.12 1.05 12.08 12.08 0 0 1 -4.46 1.31v-27.9z">
</path>
</svg>
<div class="z-10 relative flex items-center justify-between w-full pb-0.5 px-1 text-xs h-7"
style="color: var(--sc-color1); filter: brightness(1.5)">
<div class="inline-flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z">
</path>
</svg>
<span class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span>
</div>
<div class="inline-flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="validity"><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
</div>
<div class="z-10 flex items-start p-1 mt-0.5 gap-2">
<div class="leading-none mt-0.5" style="
color: var(--sc-color2);
filter: drop-shadow(0 0.1rem 0 rgb(80 80 80 / 0.4));
">
<div class="w-24 text-center">
<div class="inline-flex items-center">
<span class="text-4xl font-semibold"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : $woocommerce_smart_coupon->get_emoji() ); ?></span>
<sup class="text-lg"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></sup>
</div>
</div>
</div>
<div class="text-sm leading-tight" style="color: var(--sc-color2)">
<?php echo esc_html( $coupon_description ); ?>
</div>
</div>
</div>
</div>

View File

@@ -1,66 +0,0 @@
<?php
/**
* Smart Coupons design - Shipment
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="transition duration-100 ease-in-out transform border-2 rounded-sm sc-coupon hover:scale-105 <?php echo esc_attr( $classes ); ?>"
style="
min-height: 6rem;
background-color: var(--sc-color2);
color: var(--sc-color1);
border-color: var(--sc-color2);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div>
<div class="flex items-center m-1">
<div class="flex-1 mx-1 space-y-1">
<div class="text-lg font-bold">
<div class="flex items-center leading-none" style="color: var(--sc-color3)">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center mr-1">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
</div>
<div class="text-xs leading-tight">
<span><?php echo esc_html( $coupon_description ); ?>
</span>
</div>
</div>
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="object-cover rounded-md w-15 h-15" />
</div>
<div class="absolute bottom-0 flex items-center justify-between w-full py-0.5 px-1 text-xs rounded-sm" style="
color: var(--sc-color2);
background-color: var(--sc-color1);
filter: saturate(0.75);
">
<div class="flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z">
</path>
</svg>
<span class="font-mono uppercase"><?php echo esc_html( $coupon_code ); ?></span>
</div>
<div class="flex items-center">
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="validity"><?php echo esc_html( $coupon_expiry ); ?></span>
</div>
</div>
</div>
</div>

View File

@@ -1,67 +0,0 @@
<?php
/**
* Smart Coupons design - Special
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="h-24 transition duration-100 ease-in-out transform border border-dashed sc-coupon hover:border-solid <?php echo esc_attr( $classes ); ?>"
style="
color: var(--sc-color1);
border-color: var(--sc-color1);
background: var(--sc-color2);
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<div>
<div class="flex items-start h-24">
<div class="w-16 h-full overflow-hidden" style="background-color: var(--sc-color1)">
<img src="<?php echo esc_url( $thumbnail_src ); ?>" class="object-cover w-full h-full" />
</div>
<div class="flex-1 h-full p-2 space-y-0.5 border-l border-dashed hover:border-solid"
style="border-color: var(--sc-color1)">
<svg class="inline-block h-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 61.23 19.23">
<defs>
<style>
.a {
fill: var(--sc-color3);
}
.b {
fill: none;
stroke: var(--sc-color3);
stroke-miterlimit: 10;
stroke-width: 1.23px;
}
</style>
</defs>
<path class="a"
d="M4.77 12.55l1.47-.88a2.63 2.63 0 0 0 2.4 1.52c.9 0 1.55-.34 1.55-1s-.64-1-1.8-1.29c-1.59-.46-3.24-.9-3.24-2.73 0-1.65 1.29-2.65 3.2-2.65a4 4 0 0 1 3.53 1.83l-1.36 1a2.64 2.64 0 0 0-2.18-1.23c-.83 0-1.28.36-1.28.89 0 .7.66 1 1.82 1.28 1.56.42 3.21.91 3.21 2.75 0 1.42-1.08 2.69-3.55 2.69a4 4 0 0 1-3.77-2.18zm8.78-6.86h3.23c1.89 0 3.62.5 3.62 2.84s-1.87 2.88-3.65 2.88h-1.26v3.16h-1.94zm3.27 4.21c1.21 0 1.67-.47 1.67-1.32s-.44-1.29-1.67-1.29h-1.33V9.9zm4.84-4.21h6.05v1.63h-4.09v1.91h3v1.55h-3V13h4.3v1.59h-6.26zm6.88 4.43c0-3.09 1.78-4.6 4-4.6a3.33 3.33 0 0 1 3.6 2.8l-1.85.54c-.29-1-.72-1.72-1.76-1.72-1.35 0-2.07 1.14-2.07 3s.75 3 2.09 3c1 0 1.56-.66 1.87-1.87l1.84.41a3.52 3.52 0 0 1-3.72 3c-2.29.05-4-1.43-4-4.56zm9.26-4.43h1.94v8.88H37.8zm6.3-.04H46l3.14 8.92h-2l-.66-2h-3l-.68 2H41zm1.9 5.52l-1-3-1 3zm4.22-5.48h2V13h3.91v1.59h-5.91z">
</path>
<path class="b" d="M0.61 0.61H60.61V18.61H0.61z"></path>
</svg>
<div class="text-base font-bold pt-0.5">
<div class="flex items-center leading-none">
<div
class="inline-flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center mr-1">
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : '' ); ?></span>
<span><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></span>
</div>
<span><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></span>
</div>
</div>
<div class="text-xs leading-tight">
<?php echo esc_html( $coupon_description ); ?>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,53 +0,0 @@
<?php
/**
* Smart Coupons design - Ticket
*
* @author StoreApps
* @package WooCommerce Smart Coupons/Templates
*
* @version 1.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
?>
<div class="max-w-xs transition duration-100 ease-in-out transform rounded-md sc-coupon hover:-translate-y-1 hover:shadow <?php echo esc_attr( $classes ); ?>"
style="
background-color: var(--sc-color1);
color: var(--sc-color1);
min-height: 6rem;
" data-coupon_code="<?php echo esc_attr( $coupon_code ); ?>">
<svg class="absolute w-full h-full" style="color: var(--sc-color2)" viewBox="0 0 230 100"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" preserveAspectRatio="none">
<path
d="m221.76 17.82h.31v-2.58h-.31a4.27 4.27 0 0 1 -4.26-4h-205a4.27 4.27 0 0 1 -4.26 4h-.31v2.59h.31a4.28 4.28 0 0 1 4.26 4v.62a4.28 4.28 0 0 1 -4.26 4h-.31v2.59h.31a4.28 4.28 0 0 1 4.26 4v.61a4.28 4.28 0 0 1 -4.26 4h-.31v2.6h.31a4.28 4.28 0 0 1 4.26 4v.61a4.28 4.28 0 0 1 -4.26 4h-.31v2.59h.31a4.28 4.28 0 0 1 4.26 4v.62a4.28 4.28 0 0 1 -4.26 4h-.31v2.59h.31a4.27 4.27 0 0 1 4.26 4v.62a4.28 4.28 0 0 1 -4.26 4h-.31v2.6h.31a4.28 4.28 0 0 1 4.26 4v.61a4.28 4.28 0 0 1 -4.26 4h-.31v2.59h.31a4.27 4.27 0 0 1 4.26 4v.23h205v-.23a4.27 4.27 0 0 1 4.26-4h.31v-3.2h-.31a4.28 4.28 0 0 1 -4.26-4v-.61a4.28 4.28 0 0 1 4.26-4h.31v-2.6h-.31a4.28 4.28 0 0 1 -4.26-4v-.62a4.27 4.27 0 0 1 4.26-4h.31v-2.38h-.31a4.28 4.28 0 0 1 -4.26-4v-.57a4.28 4.28 0 0 1 4.26-4h.31v-2.54h-.31a4.28 4.28 0 0 1 -4.26-4v-.56a4.28 4.28 0 0 1 4.26-4h.31v-2.6h-.31a4.28 4.28 0 0 1 -4.26-4v-.61a4.28 4.28 0 0 1 4.26-4h.31v-2.44h-.31a4.28 4.28 0 0 1 -4.26-4v-.62a4.28 4.28 0 0 1 4.26-3.91z">
</path>
</svg>
<svg class="absolute w-full h-full" style="color: var(--sc-color1)" viewBox="0 0 230 100"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" preserveAspectRatio="none">
<g stroke-miterlimit="10">
<path
d="m212 77.62a9.68 9.68 0 0 1 1.75-5.55 9.69 9.69 0 0 1 0-11.11 9.68 9.68 0 0 1 0-11.1 9.69 9.69 0 0 1 0-11.11 9.69 9.69 0 0 1 0-11.11 9.69 9.69 0 0 1 -.15-10.89h-197.25a9.72 9.72 0 0 1 -.14 10.89 9.74 9.74 0 0 1 0 11.11 9.74 9.74 0 0 1 0 11.11 9.72 9.72 0 0 1 0 11.1 9.74 9.74 0 0 1 0 11.11 9.71 9.71 0 0 1 0 11.11v.06h197.5v-.06a9.66 9.66 0 0 1 -1.71-5.56z"
stroke-width="1"></path>
</g>
</svg>
<div class="relative flex items-center my-5 mx-1/12 p-0.5 gap-2">
<div class="flex-1 text-xs leading-tight -mt-0.5" style="color: var(--sc-color1)">
<div class="text-sm font-bold uppercase"><?php echo wp_kses_post( ( ! empty( $coupon_amount ) ) ? $discount_type : __( 'Coupon', 'woocommerce-smart-coupons' ) ); ?></div>
<div><?php echo esc_html( $coupon_description ); ?></div>
</div>
<div class="leading-none text-center" style="color: var(--sc-color3)">
<div class="inline-block">
<div
class="flex <?php echo esc_attr( ( true === $is_percent ) ? '' : 'flex-row-reverse' ); ?> items-center">
<span class="text-4xl font-bold"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $coupon_amount : $woocommerce_smart_coupon->get_emoji() ); ?></span>
<sup class="text-lg"><?php echo esc_html( ( ! empty( $coupon_amount ) ) ? $amount_symbol : '' ); ?></sup>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,235 +0,0 @@
<?php
/**
* Coupon Email Content
*
* @author StoreApps
* @version 1.8.0
* @package woocommerce-smart-coupons/templates/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label, $woocommerce_smart_coupon;
if ( ! isset( $email ) ) {
$email = null;
}
if ( has_action( 'woocommerce_email_header' ) ) {
do_action( 'woocommerce_email_header', $email_heading, $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
} else {
woocommerce_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
}
}
?>
<style type="text/css">
.coupon-container {
margin: .2em;
box-shadow: 0 0 5px #e0e0e0;
display: inline-table;
text-align: center;
cursor: pointer;
padding: .55em;
line-height: 1.4em;
}
.coupon-content {
padding: 0.2em 1.2em;
}
.coupon-content .code {
font-family: monospace;
font-size: 1.2em;
font-weight:700;
}
.coupon-content .coupon-expire,
.coupon-content .discount-info {
font-family: Helvetica, Arial, sans-serif;
font-size: 1em;
}
.coupon-content .discount-description {
font: .7em/1 Helvetica, Arial, sans-serif;
width: 250px;
margin: 10px inherit;
display: inline-block;
}
</style>
<style type="text/css"><?php echo ( isset( $coupon_styles ) && ! empty( $coupon_styles ) ) ? esc_html( wp_strip_all_tags( $coupon_styles, true ) ) : ''; // phpcs:ignore ?></style>
<?php
if ( 'custom-design' !== $design ) {
?>
<style type="text/css">
:root {
--sc-color1: <?php echo esc_html( $background_color ); ?>;
--sc-color2: <?php echo esc_html( $foreground_color ); ?>;
--sc-color3: <?php echo esc_html( $third_color ); ?>;
}
</style>
<?php
}
?>
<?php echo wp_unslash( $message_from_sender ); // phpcs:ignore ?>
<p>
<?php
/* translators: %s: Coupon code */
echo sprintf( esc_html__( 'To redeem your discount use coupon code %s during checkout or click on the following coupon:', 'woocommerce-smart-coupons' ), '<strong><code>' . esc_html( $coupon_code ) . '</code></strong>' );
?>
</p>
<?php
$coupon = new WC_Coupon( $coupon_code );
$order = ( ! empty( $order_id ) ) ? wc_get_order( $order_id ) : null; // phpcs:ignore
if ( $woocommerce_smart_coupon->is_wc_gte_30() ) {
if ( ! is_object( $coupon ) || ! is_callable( array( $coupon, 'get_id' ) ) ) {
return;
}
$coupon_id = $coupon->get_id();
if ( empty( $coupon_id ) ) {
return;
}
$is_free_shipping = ( $coupon->get_free_shipping() ) ? 'yes' : 'no';
$expiry_date = $coupon->get_date_expires();
$coupon_code = $coupon->get_code();
} else {
$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;
$is_free_shipping = ( ! empty( $coupon->free_shipping ) ) ? $coupon->free_shipping : '';
$expiry_date = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : '';
$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';
}
$coupon_amount = $woocommerce_smart_coupon->get_amount( $coupon, true, $order );
$coupon_post = get_post( $coupon_id );
$coupon_data = $woocommerce_smart_coupon->get_coupon_meta_data( $coupon );
$coupon_type = ( ! empty( $coupon_data['coupon_type'] ) ) ? $coupon_data['coupon_type'] : '';
if ( 'yes' === $is_free_shipping ) {
if ( ! empty( $coupon_type ) ) {
$coupon_type .= __( ' & ', 'woocommerce-smart-coupons' );
}
$coupon_type .= __( 'Free Shipping', 'woocommerce-smart-coupons' );
}
if ( ! empty( $expiry_date ) ) {
if ( $woocommerce_smart_coupon->is_wc_gte_30() && $expiry_date instanceof WC_DateTime ) {
$expiry_date = ( is_callable( array( $expiry_date, 'getTimestamp' ) ) ) ? $expiry_date->getTimestamp() : null;
} elseif ( ! is_int( $expiry_date ) ) {
$expiry_date = strtotime( $expiry_date );
}
if ( ! empty( $expiry_date ) && is_int( $expiry_date ) ) {
$expiry_time = (int) $woocommerce_smart_coupon->get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );
if ( ! empty( $expiry_time ) ) {
$expiry_date += $expiry_time; // Adding expiry time to expiry date.
}
}
}
$coupon_description = '';
if ( ! empty( $coupon_post->post_excerpt ) && 'yes' === $show_coupon_description ) {
$coupon_description = $coupon_post->post_excerpt;
}
$is_percent = $woocommerce_smart_coupon->is_percent_coupon( array( 'coupon_object' => $coupon ) );
$args = array(
'coupon_object' => $coupon,
'coupon_amount' => $coupon_amount,
'amount_symbol' => ( true === $is_percent ) ? '%' : get_woocommerce_currency_symbol(),
'discount_type' => wp_strip_all_tags( $coupon_type ),
'coupon_description' => ( ! empty( $coupon_description ) ) ? $coupon_description : wp_strip_all_tags( $woocommerce_smart_coupon->generate_coupon_description( array( 'coupon_object' => $coupon ) ) ),
'coupon_code' => $coupon_code,
'coupon_expiry' => ( ! empty( $expiry_date ) ) ? $woocommerce_smart_coupon->get_expiration_format( $expiry_date ) : __( 'Never expires', 'woocommerce-smart-coupons' ),
'thumbnail_src' => $woocommerce_smart_coupon->get_coupon_design_thumbnail_src(
array(
'design' => $design,
'coupon_object' => $coupon,
)
),
'classes' => '',
'template_id' => $design,
'is_percent' => $is_percent,
);
$coupon_target = '';
$wc_url_coupons_active_urls = get_option( 'wc_url_coupons_active_urls' ); // From plugin WooCommerce URL coupons.
if ( ! empty( $wc_url_coupons_active_urls ) ) {
$coupon_target = ( ! empty( $wc_url_coupons_active_urls[ $coupon_id ]['url'] ) ) ? $wc_url_coupons_active_urls[ $coupon_id ]['url'] : '';
}
if ( ! empty( $coupon_target ) ) {
$coupon_target = home_url( '/' . $coupon_target );
} else {
$coupon_target = home_url( '/?sc-page=shop&coupon-code=' . $coupon_code );
}
$coupon_target = apply_filters( 'sc_coupon_url_in_email', $coupon_target, $coupon );
?>
<div style="margin: 10px 0;" title="<?php echo esc_html__( 'Click to visit store. This coupon will be applied automatically.', 'woocommerce-smart-coupons' ); ?>">
<a href="<?php echo esc_url( $coupon_target ); ?>" style="color: #444;">
<div id="sc-cc">
<div class="sc-coupons-list">
<?php wc_get_template( 'coupon-design/' . $design . '.php', $args, '', plugin_dir_path( WC_SC_PLUGIN_FILE ) . 'templates/' ); ?>
</div>
</div>
</a>
</div>
<?php $site_url = ! empty( $url ) ? $url : home_url(); ?>
<center>
<a href="<?php echo esc_url( $site_url ); ?>"><?php echo esc_html__( 'Visit store', 'woocommerce-smart-coupons' ); ?></a>
<?php
$is_print = get_option( 'smart_coupons_is_print_coupon', 'yes' );
$is_print = apply_filters( 'wc_sc_email_show_print_link', wc_string_to_bool( $is_print ), array( 'source' => $woocommerce_smart_coupon ) );
if ( true === $is_print ) {
$print_coupon_url = add_query_arg(
array(
'print-coupons' => 'yes',
'source' => 'wc-smart-coupons',
'coupon-codes' => $coupon_code,
),
home_url()
);
?>
|
<a href="<?php echo esc_url( $print_coupon_url ); ?>" target="_blank"><?php echo esc_html__( 'Print coupon', 'woocommerce-smart-coupons' ); ?></a>
<?php
}
?>
</center>
<?php if ( ! empty( $from ) ) { ?>
<p>
<?php
/* translators: %s: singular name for store credit */
echo ( ! empty( $store_credit_label['singular'] ) ? sprintf( esc_html__( 'You got this %s', 'woocommerce-smart-coupons' ), esc_html( strtolower( $store_credit_label['singular'] ) ) ) : esc_html__( 'You got this gift card', 'woocommerce-smart-coupons' ) ) . ' ' . esc_html( $from ) . esc_html( $sender );
?>
</p>
<?php } ?>
<div style="clear:both;"></div>
<?php
if ( has_action( 'woocommerce_email_footer' ) ) {
do_action( 'woocommerce_email_footer', $email );
} else {
if ( function_exists( 'wc_get_template' ) ) {
wc_get_template( 'emails/email-footer.php' );
} else {
woocommerce_get_template( 'emails/email-footer.php' );
}
}

View File

@@ -1,61 +0,0 @@
<?php
/**
* Acknowledgement Email Content
*
* @author StoreApps
* @version 1.2.0
* @package woocommerce-smart-coupons/templates/plain/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
$receivers_email = array_unique( $receivers_detail );
if ( empty( $email_scheduled_details ) ) {
/* translators: 1. Receiver's count 2. Singular/Plural label for store credit(s) 3. Receiver name 4. Receiver details */
$message = __( 'You have successfully sent %1$d %2$s to %3$s (%4$s)', 'woocommerce-smart-coupons' );
} else {
/* translators: 1. Receiver's count 2. Gift Card/s 3. Receiver name 4. Receiver details */
$message = __( 'You have scheduled to send %1$d %2$s to %3$s (%4$s)', 'woocommerce-smart-coupons' );
$receivers_email = array_map(
function( $email ) use ( $email_scheduled_details ) {
// Filter for time format of acknowledgement email.
$time_format = apply_filters( 'wc_sc_acknowledgement_email_time_format', get_option( 'date_format', 'Y-m-d' ) . ' ' . get_option( 'time_format', 'H:i' ) );
// Check if the scheduled timestamps are available.
if ( isset( $email_scheduled_details[ $email ] ) && is_array( $email_scheduled_details[ $email ] ) ) {
$scheduled_times = array_map(
function( $time ) use ( $time_format ) {
// Convert to date format.
$time = get_date_from_gmt( gmdate( 'c', $time ), $time_format );
return date_i18n( $time_format, strtotime( $time ) );
},
$email_scheduled_details[ $email ]
);
// Concat scheduled times to comma separated times.
return $email . ' on ' . implode( ', ', $scheduled_times );
}
return $email;
},
$receivers_email
);
}
$singular = ( ! empty( $store_credit_label['singular'] ) ) ? ucwords( $store_credit_label['singular'] ) : __( 'Gift card', 'woocommerce-smart-coupons' );
$plural = ( ! empty( $store_credit_label['plural'] ) ) ? ucwords( $store_credit_label['plural'] ) : __( 'Gift cards', 'woocommerce-smart-coupons' );
$coupon_type = ( $receiver_count > 1 ) ? $plural : $singular;
if ( 'yes' === $contains_core_coupons ) {
$coupon_type = _n( 'Coupon', 'Coupons', $receiver_count, 'woocommerce-smart-coupons' );
}
echo esc_html( sprintf( $message, $receiver_count, strtolower( $coupon_type ), $gift_certificate_receiver_name, implode( ', ', $receivers_email ) ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

View File

@@ -1,139 +0,0 @@
<?php
/**
* Coupon Email Content
*
* @author StoreApps
* @version 1.5.0
* @package woocommerce-smart-coupons/templates/plain/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label, $woocommerce_smart_coupon;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
?>
<?php
echo esc_html__( 'To redeem your discount use below coupon codes during checkout or copy and paste the below URLs and hit enter in your browser', 'woocommerce-smart-coupons' );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
?>
<?php
$order = ( ! empty( $order_id ) ) ? wc_get_order( $order_id ) : null; // phpcs:ignore
foreach ( $receiver_details as $receiver_data ) {
$coupon_code = $receiver_data['code'];
$sender_message = isset( $receiver_data['message'] ) ? $receiver_data['message'] : '';
$coupon = new WC_Coupon( $coupon_code );
if ( $woocommerce_smart_coupon->is_wc_gte_30() ) {
if ( ! is_object( $coupon ) || ! is_callable( array( $coupon, 'get_id' ) ) ) {
return;
}
$coupon_id = $coupon->get_id();
if ( empty( $coupon_id ) ) {
return;
}
$is_free_shipping = ( $coupon->get_free_shipping() ) ? 'yes' : 'no';
$expiry_date = $coupon->get_date_expires();
$coupon_code = $coupon->get_code();
} else {
$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;
$is_free_shipping = ( ! empty( $coupon->free_shipping ) ) ? $coupon->free_shipping : '';
$expiry_date = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : '';
$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';
}
$coupon_amount = $woocommerce_smart_coupon->get_amount( $coupon, true, $order );
$coupon_post = get_post( $coupon_id );
$coupon_data = $woocommerce_smart_coupon->get_coupon_meta_data( $coupon );
$coupon_target = '';
$wc_url_coupons_active_urls = get_option( 'wc_url_coupons_active_urls' ); // From plugin WooCommerce URL coupons.
if ( ! empty( $wc_url_coupons_active_urls ) ) {
$coupon_target = ( ! empty( $wc_url_coupons_active_urls[ $coupon_id ]['url'] ) ) ? $wc_url_coupons_active_urls[ $coupon_id ]['url'] : '';
}
if ( ! empty( $coupon_target ) ) {
$coupon_target = home_url( '/' . $coupon_target );
} else {
$coupon_target = home_url( '/?sc-page=shop&coupon-code=' . $coupon_code );
}
$coupon_target = apply_filters( 'sc_coupon_url_in_email', $coupon_target, $coupon );
if ( ! empty( $sender_message ) ) {
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Message:', 'woocommerce-smart-coupons' );
echo esc_html( $sender_message );
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_url( $coupon_target );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Discount:', 'woocommerce-smart-coupons' );
if ( ! empty( $coupon_data['coupon_amount'] ) && 0 !== $coupon_amount ) {
echo $coupon_data['coupon_amount']; // phpcs:ignore
echo ' ' . $coupon_data['coupon_type']; // phpcs:ignore
if ( 'yes' === $is_free_shipping ) {
echo esc_html__( ' &amp; ', 'woocommerce-smart-coupons' );
}
}
if ( 'yes' === $is_free_shipping ) {
echo esc_html__( 'Free Shipping', 'woocommerce-smart-coupons' );
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Coupon Code:', 'woocommerce-smart-coupons' );
echo esc_html( $coupon_code );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
$show_coupon_description = get_option( 'smart_coupons_show_coupon_description', 'no' );
if ( ! empty( $coupon_post->post_excerpt ) && 'yes' === $show_coupon_description ) {
echo esc_html__( 'Description:', 'woocommerce-smart-coupons' );
echo $coupon_post->post_excerpt; // phpcs:ignore
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
}
echo esc_html__( 'Expires on:', 'woocommerce-smart-coupons' );
if ( ! empty( $expiry_date ) ) {
if ( $woocommerce_smart_coupon->is_wc_gte_30() && $expiry_date instanceof WC_DateTime ) {
$expiry_date = ( is_callable( array( $expiry_date, 'getTimestamp' ) ) ) ? $expiry_date->getTimestamp() : null;
} elseif ( ! is_int( $expiry_date ) ) {
$expiry_date = strtotime( $expiry_date );
}
if ( ! empty( $expiry_date ) && is_int( $expiry_date ) ) {
$expiry_time = (int) $woocommerce_smart_coupon->get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );
if ( ! empty( $expiry_time ) ) {
$expiry_date += $expiry_time; // Adding expiry time to expiry date.
}
}
$expiry_date = $woocommerce_smart_coupon->get_expiration_format( $expiry_date );
echo esc_html( $expiry_date );
} else {
echo esc_html__( 'Never expires', 'woocommerce-smart-coupons' );
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Visit store', 'woocommerce-smart-coupons' );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
$site_url = ! empty( $url ) ? $url : home_url();
echo esc_url( $site_url );
if ( ! empty( $from ) ) {
/* translators: %s: singular name for store credit */
echo ( ! empty( $store_credit_label['singular'] ) ? sprintf( esc_html__( 'You got this %s', 'woocommerce-smart-coupons' ), esc_html( strtolower( $store_credit_label['singular'] ) ) ) : esc_html__( 'You got this gift card', 'woocommerce-smart-coupons' ) ) . ' ' . esc_html( $from ) . esc_html( $sender );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
}

View File

@@ -1,132 +0,0 @@
<?php
/**
* Coupon Email Content
*
* @author StoreApps
* @version 1.5.0
* @package woocommerce-smart-coupons/templates/plain/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $store_credit_label, $woocommerce_smart_coupon;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
?>
<?php
/* translators: %s: Coupon code */
echo sprintf( esc_html__( 'To redeem your discount use coupon code %s during checkout or copy and paste the below URL and hit enter in your browser:', 'woocommerce-smart-coupons' ), esc_html( $coupon_code ) );
if ( ! empty( $message_from_sender ) ) {
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Message:', 'woocommerce-smart-coupons' );
echo $message_from_sender; // phpcs:ignore
}
?>
<?php
$coupon = new WC_Coupon( $coupon_code );
$order = ( ! empty( $order_id ) ) ? wc_get_order( $order_id ) : null; // phpcs:ignore
if ( $woocommerce_smart_coupon->is_wc_gte_30() ) {
if ( ! is_object( $coupon ) || ! is_callable( array( $coupon, 'get_id' ) ) ) {
return;
}
$coupon_id = $coupon->get_id();
if ( empty( $coupon_id ) ) {
return;
}
$is_free_shipping = ( $coupon->get_free_shipping() ) ? 'yes' : 'no';
$expiry_date = $coupon->get_date_expires();
$coupon_code = $coupon->get_code();
} else {
$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;
$is_free_shipping = ( ! empty( $coupon->free_shipping ) ) ? $coupon->free_shipping : '';
$expiry_date = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : '';
$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';
}
$coupon_amount = $woocommerce_smart_coupon->get_amount( $coupon, true, $order );
$coupon_post = get_post( $coupon_id );
$coupon_data = $woocommerce_smart_coupon->get_coupon_meta_data( $coupon );
$coupon_target = '';
$wc_url_coupons_active_urls = get_option( 'wc_url_coupons_active_urls' ); // From plugin WooCommerce URL coupons.
if ( ! empty( $wc_url_coupons_active_urls ) ) {
$coupon_target = ( ! empty( $wc_url_coupons_active_urls[ $coupon_id ]['url'] ) ) ? $wc_url_coupons_active_urls[ $coupon_id ]['url'] : '';
}
if ( ! empty( $coupon_target ) ) {
$coupon_target = home_url( '/' . $coupon_target );
} else {
$coupon_target = home_url( '/?sc-page=shop&coupon-code=' . $coupon_code );
}
$coupon_target = apply_filters( 'sc_coupon_url_in_email', $coupon_target, $coupon );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_url( $coupon_target );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Discount:', 'woocommerce-smart-coupons' );
if ( ! empty( $coupon_data['coupon_amount'] ) && 0 !== $coupon_amount ) {
echo $coupon_data['coupon_amount']; // phpcs:ignore
echo ' ' . $coupon_data['coupon_type']; // phpcs:ignore
if ( 'yes' === $is_free_shipping ) {
echo esc_html__( ' &amp; ', 'woocommerce-smart-coupons' );
}
}
if ( 'yes' === $is_free_shipping ) {
echo esc_html__( 'Free Shipping', 'woocommerce-smart-coupons' );
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Coupon Code:', 'woocommerce-smart-coupons' );
echo esc_html( $coupon_code );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
$show_coupon_description = get_option( 'smart_coupons_show_coupon_description', 'no' );
if ( ! empty( $coupon_post->post_excerpt ) && 'yes' === $show_coupon_description ) {
echo esc_html__( 'Description:', 'woocommerce-smart-coupons' );
echo $coupon_post->post_excerpt; // phpcs:ignore
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
}
echo esc_html__( 'Expires on:', 'woocommerce-smart-coupons' );
if ( ! empty( $expiry_date ) ) {
if ( $woocommerce_smart_coupon->is_wc_gte_30() && $expiry_date instanceof WC_DateTime ) {
$expiry_date = ( is_callable( array( $expiry_date, 'getTimestamp' ) ) ) ? $expiry_date->getTimestamp() : null;
} elseif ( ! is_int( $expiry_date ) ) {
$expiry_date = strtotime( $expiry_date );
}
if ( ! empty( $expiry_date ) && is_int( $expiry_date ) ) {
$expiry_time = (int) $woocommerce_smart_coupon->get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );
if ( ! empty( $expiry_time ) ) {
$expiry_date += $expiry_time; // Adding expiry time to expiry date.
}
}
$expiry_date = $woocommerce_smart_coupon->get_expiration_format( $expiry_date );
echo esc_html( $expiry_date );
} else {
echo esc_html__( 'Never expires', 'woocommerce-smart-coupons' );
}
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Visit store', 'woocommerce-smart-coupons' );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
$site_url = ! empty( $url ) ? $url : home_url();
echo esc_url( $site_url );
if ( ! empty( $from ) ) {
/* translators: %s: singular name for store credit */
echo ( ! empty( $store_credit_label['singular'] ) ? sprintf( esc_html__( 'You got this %s', 'woocommerce-smart-coupons' ), esc_html( strtolower( $store_credit_label['singular'] ) ) ) : esc_html__( 'You got this gift card', 'woocommerce-smart-coupons' ) ) . ' ' . esc_html( $from ) . esc_html( $sender );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
}

View File

@@ -1,209 +0,0 @@
<?php
/**
* Print coupons html content
*
* @author StoreApps
* @since 4.7.0
* @version 1.6.0
* @package woocommerce-smart-coupons/templates/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $woocommerce_smart_coupon;
$bloginfo = get_bloginfo( 'name', 'display' );
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
<title><?php echo $bloginfo; // phpcs:ignore ?></title>
<?php wp_head(); ?>
<?php
if ( ! wp_script_is( 'jquery' ) ) {
wp_enqueue_script( 'jquery' );
}
?>
<style type="text/css">
body.custom-background {
background-color: unset;
}
.wc-sc-print-coupons-wrapper {
padding: 4em 0;
}
.coupon-container {
margin: .2em;
box-shadow: 0 0 5px #e0e0e0;
display: inline-table;
text-align: center;
cursor: pointer;
padding: .55em;
line-height: 1.4em;
}
.coupon-content {
padding: 0.2em 1.2em;
}
.coupon-content .code {
font-family: monospace;
font-size: 1.2em;
font-weight:700;
}
.coupon-content .coupon-expire,
.coupon-content .discount-info {
font-family: Helvetica, Arial, sans-serif;
font-size: 1em;
}
.coupon-content .discount-description {
font: .7em/1 Helvetica, Arial, sans-serif;
width: 250px;
margin: 10px inherit;
display: inline-block;
}
.wc-sc-terms-page-title h2 {
font-weight: 600;
padding-left: 1em;
}
#sc-cc .wc-sc-print-coupons-wrapper {
display: table;
}
#sc-cc .coupon-container {
display: inline-block;
page-break-inside: avoid;
margin: .8rem 1rem;
border: 1px solid #ccc !important;
}
</style>
<style type="text/css"><?php echo ( isset( $coupon_styles ) && ! empty( $coupon_styles ) ) ? esc_html( wp_strip_all_tags( $coupon_styles, true ) ) : ''; // phpcs:ignore ?></style>
<?php
if ( 'custom-design' !== $design ) {
?>
<style type="text/css">
:root {
--sc-color1: <?php echo esc_html( $background_color ); ?>;
--sc-color2: <?php echo esc_html( $foreground_color ); ?>;
--sc-color3: <?php echo esc_html( $third_color ); ?>;
}
</style>
<?php
}
?>
</head>
<body <?php body_class(); ?>>
<div id="sc-cc" class="woocommerce wc-sc-print-coupons-container">
<div class="wc-sc-print-coupons-wrapper sc-coupons-list">
<?php
foreach ( $coupon_codes as $coupon_data ) {
$coupon = new WC_Coupon( $coupon_data['code'] );
if ( $woocommerce_smart_coupon->is_wc_gte_30() ) {
if ( ! is_object( $coupon ) || ! is_callable( array( $coupon, 'get_id' ) ) ) {
continue;
}
$coupon_id = $coupon->get_id();
if ( empty( $coupon_id ) ) {
continue;
}
$is_free_shipping = ( $coupon->get_free_shipping() ) ? 'yes' : 'no';
$discount_type = $coupon->get_discount_type();
$expiry_date = $coupon->get_date_expires();
$coupon_code = $coupon->get_code();
} else {
$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;
$is_free_shipping = ( ! empty( $coupon->free_shipping ) ) ? $coupon->free_shipping : '';
$discount_type = ( ! empty( $coupon->discount_type ) ) ? $coupon->discount_type : '';
$expiry_date = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : '';
$coupon_code = ( ! empty( $coupon->code ) ) ? $coupon->code : '';
}
$coupon_amount = $woocommerce_smart_coupon->get_amount( $coupon, true );
if ( empty( $coupon_id ) || empty( $discount_type ) ) {
continue;
}
$coupon_post = get_post( $coupon_id );
$coupon_meta = $woocommerce_smart_coupon->get_coupon_meta_data( $coupon );
$coupon_type = ( ! empty( $coupon_meta['coupon_type'] ) ) ? $coupon_meta['coupon_type'] : '';
if ( 'yes' === $is_free_shipping ) {
if ( ! empty( $coupon_type ) ) {
$coupon_type .= __( ' & ', 'woocommerce-smart-coupons' );
}
$coupon_type .= __( 'Free Shipping', 'woocommerce-smart-coupons' );
}
if ( ! empty( $expiry_date ) ) {
if ( $woocommerce_smart_coupon->is_wc_gte_30() && $expiry_date instanceof WC_DateTime ) {
$expiry_date = ( is_callable( array( $expiry_date, 'getTimestamp' ) ) ) ? $expiry_date->getTimestamp() : null;
} elseif ( ! is_int( $expiry_date ) ) {
$expiry_date = strtotime( $expiry_date );
}
if ( ! empty( $expiry_date ) && is_int( $expiry_date ) ) {
$expiry_time = (int) $woocommerce_smart_coupon->get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );
if ( ! empty( $expiry_time ) ) {
$expiry_date += $expiry_time; // Adding expiry time to expiry date.
}
}
}
$coupon_description = '';
if ( ! empty( $coupon_post->post_excerpt ) && 'yes' === $show_coupon_description ) {
$coupon_description = $coupon_post->post_excerpt;
}
$is_percent = $woocommerce_smart_coupon->is_percent_coupon( array( 'coupon_object' => $coupon ) );
$args = array(
'coupon_object' => $coupon,
'coupon_amount' => $coupon_amount,
'amount_symbol' => ( true === $is_percent ) ? '%' : get_woocommerce_currency_symbol(),
'discount_type' => wp_strip_all_tags( $coupon_type ),
'coupon_description' => ( ! empty( $coupon_description ) ) ? $coupon_description : wp_strip_all_tags( $woocommerce_smart_coupon->generate_coupon_description( array( 'coupon_object' => $coupon ) ) ),
'coupon_code' => $coupon_code,
'coupon_expiry' => ( ! empty( $expiry_date ) ) ? $woocommerce_smart_coupon->get_expiration_format( $expiry_date ) : __( 'Never expires', 'woocommerce-smart-coupons' ),
'thumbnail_src' => $woocommerce_smart_coupon->get_coupon_design_thumbnail_src(
array(
'design' => $design,
'coupon_object' => $coupon,
)
),
'classes' => '',
'template_id' => $design,
'is_percent' => $is_percent,
);
wc_get_template( 'coupon-design/' . $design . '.php', $args, '', plugin_dir_path( WC_SC_PLUGIN_FILE ) . 'templates/' );
}
?>
</div>
<div class="wc-sc-terms-page-wrapper">
<?php
if ( ! empty( $terms_page_content ) ) {
?>
<div class="wc-sc-terms-page-content">
<?php
echo wp_kses_post( $terms_page_content ); // phpcs:ignore
?>
</div>
<?php
}
?>
</div>
</div>
<script type="text/javascript">
jQuery(function(){
window.print();
});
</script>
</body>
</html>