Skip to content

Commit

Permalink
Content and style changes ads
Browse files Browse the repository at this point in the history
  • Loading branch information
Terminator-Barbapapa committed Nov 27, 2023
1 parent de29d27 commit 852177c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 15 deletions.
54 changes: 50 additions & 4 deletions assets/css/settings-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ span.wpo-warning {
.wcpdf-promo-ad {
position: relative;
min-height: 90px;
border: 1px solid #3D5C99;
background-color: #EBF5FF;
border: 1px solid #6e1edc;
background-color: #f1e9fc;
padding: 15px;
padding-left: 100px;
margin-top: 15px;
margin-top: 30px;
}

img.wpo-helper {
Expand All @@ -25,12 +25,58 @@ img.wpo-helper {
.wcpdf-extensions-ad h3,
.wcpdf-promo-ad h3 {
margin: 0;
padding: 20px;
font-weight: normal;
font-family: serif;
letter-spacing: -1px;
font-size: 2.25em;
}

.wcpdf-promo-ad p {
margin: 0;
padding: 0 20px;
font-size: 1.15em;
}

.wcpdf-promo-ad p.upgrade-tab {
margin-top: 30px;
font-style: italic;
font-size: 1em;
}

.wcpdf-promo-ad p.expiration {
font-size: 0.8em;
padding-top: 8px;
}

.wcpdf-extensions-ad a,
.wcpdf-promo-ad a {
color: #6e1edc;
}

.wcpdf-extensions-ad a.dismiss,
.wcpdf-promo-ad a.dismiss {
padding: 10px 20px;
}

.wcpdf-promo-ad p strong.code {
font-size: 1.3em;
font-family: serif;
padding: 0.1em 0.4em;
background: #6e1edc;
color: white;
border-radius: 5px;
font-weight: normal;
}

.wcpdf-extensions-ad i {
padding-left: 20px;
}

.wcpdf-extensions-ad ul,
.wcpdf-promo-ad ul {
margin: 0;
margin-left: 1.5em;
margin-left: 40px;
}

.wcpdf-extensions li {
Expand Down
2 changes: 1 addition & 1 deletion includes/views/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<?php
// link to hide message when one of the premium extensions is installed
if ( class_exists( 'WooCommerce_PDF_IPS_Pro' ) || class_exists( 'WPO_WCPDF_Templates' ) || class_exists( 'WooCommerce_PDF_IPS_Templates' ) || class_exists( 'WooCommerce_Ext_PrintOrders' ) || class_exists( 'WPO_WC_Smart_Reminder_Emails' ) ) {
printf('<a href="%s" style="display:inline-block; margin-top: 10px;">%s</a>', esc_url( wp_nonce_url( add_query_arg( 'wpo_wcpdf_hide_extensions_ad', 'true' ), 'hide_extensions_ad_nonce' ) ), esc_html__( 'Hide this message', 'woocommerce-pdf-invoices-packing-slips' ) );
printf('<a href="%s" class="dismiss" style="display:inline-block; margin-top: 10px;">%s</a>', esc_url( wp_nonce_url( add_query_arg( 'wpo_wcpdf_hide_extensions_ad', 'true' ), 'hide_extensions_ad_nonce' ) ), esc_html__( 'Hide this message', 'woocommerce-pdf-invoices-packing-slips' ) );
}
?>
</div>
19 changes: 9 additions & 10 deletions includes/views/promo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

$now = new \DateTime();
$end = new \DateTime( '2023-11-29' ); // Black Friday 2023!
$end = new \DateTime( '2023-11-29 23:59:59' ); // Black Friday 2023!
$bundle_installed = class_exists( 'WooCommerce_PDF_IPS_Pro' ) && class_exists( 'WPO_WCPDF_Templates' );
$hide_ad = false;

Expand All @@ -19,19 +19,18 @@
} else {
$hide_ad = get_option( 'wpo_wcpdf_hide_promo_ad' );
}

if ( $now->getTimestamp() < $end->getTimestamp() && ! $bundle_installed && ! $hide_ad ) :
?>


<div class="wcpdf-promo-ad">
<img src="<?php echo esc_url( WPO_WCPDF()->plugin_url() . '/assets/images/wpo-helper.png' ); ?>" class="wpo-helper">
<h3><?php esc_html_e( 'Black Friday!', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<ul class="wcpdf-extensions">
<li>
<?php //TODO ?>
</li>
</ul>
<?php printf( '<a href="%s" style="display:inline-block; margin-top: 10px;">%s</a>', esc_url( wp_nonce_url( add_query_arg( 'wpo_wcpdf_hide_promo_ad', 'true' ), 'hide_promo_ad_nonce' ) ), esc_html__( 'Hide this message', 'woocommerce-pdf-invoices-packing-slips' ) ); ?>
<h3><?php esc_html_e( 'Last chance to use your Black Friday discount!', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<p>Elevate your customer experience and streamline your operations with one of our powerful extensions.</p>
<p>Use promocode <strong class="code">blackfriday30</strong> to get a <strong>30% discount</strong> on your upgrade!</p>
<?php if ( isset( $_GET['tab'] ) && $_GET['tab'] !== 'upgrade' ) : ?>
<p class="upgrade-tab">Check out the <a href="<?php echo esc_url( admin_url( 'admin.php?page=wpo_wcpdf_options_page&tab=upgrade' ) ) ?>">Upgrade tab</a> for a feature overview of our PDF Invoices & Packing Slips extensions.</p>
<?php endif; ?>
<p class="expiration">Offer ends on November 29.</p>
<?php printf( '<a href="%s" class="dismiss" style="display:inline-block; margin-top: 10px;">%s</a>', esc_url( wp_nonce_url( add_query_arg( 'wpo_wcpdf_hide_promo_ad', 'true' ), 'hide_promo_ad_nonce' ) ), esc_html__( 'Hide this message', 'woocommerce-pdf-invoices-packing-slips' ) ); ?>
</div>
<?php endif; ?>

0 comments on commit 852177c

Please sign in to comment.