compare.php
7 years ago
discount.php
7 years ago
general_settings.php
7 years ago
javascript_settings.php
7 years ago
mail.png
7 years ago
selected_products.php
7 years ago
settings.php
7 years ago
settings_footer.php
7 years ago
settings_head.php
7 years ago
style_settings.php
7 years ago
text_settings.php
7 years ago
discount.php
153 lines
| 1 | <?php |
| 2 | $start_time = 1490705082; |
| 3 | $end_time = 0; |
| 4 | $promo_price = '$7.00'; |
| 5 | $discount = '70%'; |
| 6 | $save_amount = '$15.00'; |
| 7 | $promo_plugin_name = 'WooCommerce Min/Max Quantity'; |
| 8 | $promo_plugin_link = 'http://berocket.com/product/woocommerce-minmax-quantity'; |
| 9 | |
| 10 | if ( time() > $start_time && time() < $end_time ) { ?> |
| 11 | <div class="discount-block-check"></div> |
| 12 | <div class="wrap discount-block"> |
| 13 | <img src="<?php echo plugin_dir_url( __FILE__ ) ?>../images/70p_sale.jpg" /> |
| 14 | <div> |
| 15 | <?php |
| 16 | $text = 'Only <strong>%price%</strong> for <strong>Premium</strong> %name% plugin!<br> |
| 17 | <span>Get your <strong class="red">%disc% discount</strong> and save <strong>%amount%</strong> today</span> |
| 18 | <a class="buy_button" href="%link%" target="_blank">Buy Now</a>'; |
| 19 | $text = str_replace('%name%', $promo_plugin_name, $text); |
| 20 | $text = str_replace('%link%', $promo_plugin_link, $text); |
| 21 | $text = str_replace('%price%', $promo_price, $text); |
| 22 | $text = str_replace('%disc%', $discount, $text); |
| 23 | $text = str_replace('%amount%', $save_amount, $text); |
| 24 | echo $text; |
| 25 | ?> |
| 26 | </div> |
| 27 | </div> |
| 28 | <script> |
| 29 | jQuery(window).scroll(function() { |
| 30 | var top = jQuery('.discount-block-check').offset().top - 32; |
| 31 | |
| 32 | if( jQuery(window).width() <= 782 ) { |
| 33 | jQuery('.discount-block').removeClass('fixed'); |
| 34 | jQuery('.discount-block-check').height(0); |
| 35 | } else { |
| 36 | if( jQuery(window).scrollTop() > top ) { |
| 37 | if( ! jQuery('.discount-block').is('.fixed') ) { |
| 38 | jQuery('.discount-block-check').height(jQuery('.discount-block').outerHeight(true)); |
| 39 | jQuery('.discount-block').addClass('fixed'); |
| 40 | } |
| 41 | } else { |
| 42 | if( jQuery('.discount-block').is('.fixed') ) { |
| 43 | jQuery('.discount-block-check').height(0); |
| 44 | jQuery('.discount-block').removeClass('fixed'); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | }); |
| 49 | </script> |
| 50 | <style> |
| 51 | .discount-block-check { |
| 52 | margin: 0!important; |
| 53 | padding: 0!important; |
| 54 | } |
| 55 | .discount-block{ |
| 56 | text-align: center; |
| 57 | background: #ffffff; |
| 58 | padding: 0; |
| 59 | font-size: 24px; |
| 60 | border: 2px solid #ef3542; |
| 61 | line-height: 1.8em; |
| 62 | z-index: 1000; |
| 63 | } |
| 64 | .discount-block > img{ |
| 65 | float: left; |
| 66 | max-height: 130px; |
| 67 | } |
| 68 | .discount-block > div{ |
| 69 | padding: 20px; |
| 70 | height: 90px; |
| 71 | } |
| 72 | .discount-block.fixed{ |
| 73 | position: fixed; |
| 74 | top: 32px; |
| 75 | left: 180px; |
| 76 | right: 0px; |
| 77 | } |
| 78 | .discount-block .buy_button { |
| 79 | font-size: 20px; |
| 80 | padding: 8px 30px; |
| 81 | color: #fff; |
| 82 | line-height: 28px; |
| 83 | font-weight: 600; |
| 84 | text-transform: uppercase; |
| 85 | display: inline-block; |
| 86 | text-align: center; |
| 87 | text-decoration: none; |
| 88 | background-color: #ef3542; |
| 89 | cursor: pointer; |
| 90 | } |
| 91 | .discount-block .buy_button:hover { |
| 92 | background-color: #F54C57; |
| 93 | } |
| 94 | .red { |
| 95 | color: #ef3542; |
| 96 | } |
| 97 | @media screen and (max-width: 1200px) { |
| 98 | .discount-block{ |
| 99 | font-size: 20px; |
| 100 | } |
| 101 | } |
| 102 | @media screen and (max-width: 1100px) { |
| 103 | .discount-block{ |
| 104 | font-size: 18px; |
| 105 | line-height: 1.5em; |
| 106 | } |
| 107 | } |
| 108 | @media screen and (max-width: 960px) { |
| 109 | .discount-block.fixed{ |
| 110 | left: 56px; |
| 111 | } |
| 112 | } |
| 113 | @media screen and (max-width: 782px) { |
| 114 | .discount-block.fixed{ |
| 115 | left: 10px; |
| 116 | } |
| 117 | } |
| 118 | @media screen and (max-width: 767px) { |
| 119 | .discount-block{ |
| 120 | font-size: 16px; |
| 121 | line-height: 1.6em; |
| 122 | } |
| 123 | .discount-block > img{ |
| 124 | max-height: 110px; |
| 125 | } |
| 126 | .discount-block > div{ |
| 127 | padding: 10px; |
| 128 | height: 90px; |
| 129 | } |
| 130 | .discount-block .buy_button{ |
| 131 | padding: 4px 15px; |
| 132 | margin-top: 2px; |
| 133 | } |
| 134 | } |
| 135 | @media screen and (max-width: 610px) { |
| 136 | .discount-block{ |
| 137 | font-size: 14px; |
| 138 | line-height: 1.6em; |
| 139 | } |
| 140 | } |
| 141 | @media screen and (max-width: 570px) { |
| 142 | .discount-block > div > span{ |
| 143 | display: none; |
| 144 | } |
| 145 | } |
| 146 | @media screen and (max-width: 400px) { |
| 147 | .discount-block .buy_button{ |
| 148 | font-size: 16px; |
| 149 | padding: 2px 15px; |
| 150 | } |
| 151 | } |
| 152 | </style> |
| 153 | <?php } ?> |