Skip to content

Commit

Permalink
Update promo notice
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Nov 23, 2017
1 parent fde43fc commit ff79065
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
8 changes: 7 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
v2.7.0 -> Nov 23, 2017
---------------------
- [fix] Remove duplicate help menu and unwanted text
- [fix] Fixed price suggestion when flat rate commission set from admin fixed
- [fix] Fixed xss and csrf issues for some security

v2.6.10 -> Nov 13, 2017
---------------------
- [new] Added dokan CRUD classes
- [new] Added help menu on Dokan Admin Dashboard
- [tweak] Dokan Admin settings page redesigned
- [tweak] Dokan Admin settings page redesigned
- [tweak] Price suggestion made compatible with Flat commission
- [tweak] Admin setup wizard styles updated
- [fix] Fixed casting issue in updater class
Expand Down
41 changes: 30 additions & 11 deletions includes/admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function __construct() {

add_action( 'admin_notices', array($this, 'update_notice' ) );

// add_action( 'admin_notices', array($this, 'promotional_offer' ) );
add_action( 'admin_notices', array($this, 'promotional_offer' ) );

add_action( 'wp_before_admin_bar_render', array( $this, 'dokan_admin_toolbar' ) );
}
Expand All @@ -52,22 +52,23 @@ public function promotional_offer() {
}

// check if it has already been dismissed
$offer_key = 'dokan_4th_yr_aniv_44_perc_discount';
$offer_key = 'dokan_package_offer';
$hide_notice = get_option( $offer_key . '_tracking_notice', 'no' );

if ( 'hide' == $hide_notice ) {
return;
}

$product_text = ( ! WeDevs_Dokan::init()->is_pro_exists() ) ? __( 'Pro upgrade and all extensions', 'dokan-lite' ) : __( 'all extensions', 'dokan-lite' );

$offer_msg = sprintf( __( '<h2><span class="dashicons dashicons-awards"></span> weDevs 4th Year Anniversary Offer</h2>', 'dokan-lite' ) );
$offer_msg .= sprintf( __( '<p>Get <strong class="highlight-text">44&#37; discount</strong> on %2$s also <a target="_blank" href="%1$s"><strong>WIN any product</strong></a> from our 4th year anniversary giveaway. Offer ending soon!</p>', 'dokan-lite' ), 'https://wedevs.com/in/4years', $product_text );
$offer_msg = sprintf( __( '<h2>
Dokan is Getting More Affordable: Price Reduction & Changes in Packages
</h2>', 'dokan-lite' ) );
$offer_msg .= sprintf( __( '<p>Marketplaces are changing, so is Dokan Multivendor. We are reducing Dokan Pro entry package price and bringing entirely new pricing where you get addons pre-activated for free depending on your package.</p>', 'dokan-lite' ) );
?>
<div class="notice is-dismissible" id="dokan-promotional-offer-notice">
<img src="https://ps.w.org/dokan-lite/assets/icon-256x256.png?rev=1595714" alt="">
<?php echo $offer_msg; ?>
<span class="dashicons dashicons-megaphone"></span>
<a href="https://wedevs.com/in/dokan-new-package-blog-via-lite" class="button button-primary promo-btn" target="_blank"><?php _e( 'View Package', 'dokan-lite' ); ?></a>
</div>

<style>
Expand All @@ -77,9 +78,26 @@ public function promotional_offer() {
padding-left: 83px;
}

#dokan-promotional-offer-notice a.promo-btn{
background: #fff;
border-color: #fafafa #fafafa #fafafa;
box-shadow: 0 1px 0 #fafafa;
color: #F35E33;
text-decoration: none;
text-shadow: none;
position: absolute;
top: 30px;
right: 26px;
height: 40px;
line-height: 40px;
width: 130px;
text-align: center;
}

#dokan-promotional-offer-notice h2{
font-size: 19px;
color: rgba(250, 250, 250, 0.77);
font-size: 18px;
width: 85%;
color: rgba(250, 250, 250, 1);
margin-bottom: 8px;
font-weight: normal;
margin-top: 15px;
Expand All @@ -92,7 +110,7 @@ public function promotional_offer() {
#dokan-promotional-offer-notice img{
position: absolute;
width: 80px;
top: 0px;
top: 10px;
left: 0px;
}

Expand All @@ -102,6 +120,7 @@ public function promotional_offer() {
}

#dokan-promotional-offer-notice p{
width: 85%;
color: rgba(250, 250, 250, 0.77);
font-size: 14px;
margin-bottom: 10px;
Expand All @@ -126,7 +145,7 @@ public function promotional_offer() {
#dokan-promotional-offer-notice span.dashicons-megaphone {
position: absolute;
top: 16px;
right: 119px;
right: 248px;
color: rgba(253, 253, 253, 0.29);
font-size: 96px;
transform: rotate(-21deg);
Expand Down Expand Up @@ -195,7 +214,7 @@ function admin_menu() {

add_submenu_page( 'dokan', __( 'Help', 'dokan' ), __( '<span style="color:#f18500">Help</span>', 'dokan' ), $capability, 'dokan-help', array( $this, 'help_page' ) );
$settings = add_submenu_page( 'dokan', __( 'Settings', 'dokan-lite' ), __( 'Settings', 'dokan-lite' ), $capability, 'dokan-settings', array( $this, 'settings_page' ) );
add_submenu_page( 'dokan', __( 'Add Ons', 'dokan-lite' ), __( 'Add-ons', 'dokan-lite' ), $capability, 'dokan-addons', array($this, 'addon_page' ) );
// add_submenu_page( 'dokan', __( 'Add Ons', 'dokan-lite' ), __( 'Add-ons', 'dokan-lite' ), $capability, 'dokan-addons', array($this, 'addon_page' ) );

/**
* Welcome page
Expand Down
3 changes: 1 addition & 2 deletions includes/admin/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ function handle_withdraw_action() {
* @return void
*/
public function dismiss_promotional_offer() {

if ( ! empty( $_POST['dokan_promotion_dismissed'] ) ) {
$offer_key = 'dokan_4th_yr_aniv_44_perc_discount';
$offer_key = 'dokan_package_offer';
update_option( $offer_key . '_tracking_notice', 'hide' );
}
}
Expand Down
6 changes: 3 additions & 3 deletions templates/products/products-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
$post_statuses = array( 'publish', 'draft', 'pending' );
$args = array(
'posts_per_page' => 10,
'paged' => $pagenum,
'author' => get_current_user_id(),
'tax_query' => array(
'paged' => $pagenum,
'author' => get_current_user_id(),
'tax_query' => array(
array(
'taxonomy' => 'product_type',
'field' => 'slug',
Expand Down

0 comments on commit ff79065

Please sign in to comment.