divi
3 days ago
elementor
3 days ago
class-autoptimize-compatibility.php
3 days ago
class-elasticpress-compatibility.php
3 days ago
class-elementor-compatibility.php
3 days ago
class-foobox-compatibility.php
3 days ago
class-foogallery-breeze-compatibility.php
3 days ago
class-foogallery-compatibility.php
3 days ago
class-foogallery-divi-compatibility.php
3 days ago
class-foovideo-compatibility.php
3 days ago
class-jetpack-compatibility.php
3 days ago
class-polylang-compatibility.php
3 days ago
class-responsive-lightbox-dfactory-compatibility.php
3 days ago
class-speed-optimizer-compatibility.php
3 days ago
class-wpoptimize-compatibility.php
3 days ago
class-wprocket-compatibility.php
3 days ago
view-foovideo-offer.php
3 days ago
view-foovideo-offer.php
155 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | $show_upgrade = apply_filters('foogallery_foovideo_discount_offer_show_upgrade', true ); |
| 8 | $message = apply_filters('foogallery_foovideo_discount_offer_message', '' ); |
| 9 | ?> |
| 10 | <style> |
| 11 | div.about-wrap h2 { |
| 12 | text-align: left; |
| 13 | } |
| 14 | |
| 15 | .foogallery-help { |
| 16 | margin-bottom: 10px; |
| 17 | } |
| 18 | </style> |
| 19 | <script type="text/javascript"> |
| 20 | jQuery(function ($) { |
| 21 | $('.foogallery-video-offer-container').on('click', '.foogallery-video-discount-offer', function (e) { |
| 22 | e.preventDefault(); |
| 23 | |
| 24 | //show the spinner |
| 25 | $('.foogallery-video-discount-offer-spinner').addClass('is-active'); |
| 26 | |
| 27 | var data = { |
| 28 | action: 'foogallery_video_discount_offer', |
| 29 | '_wpnonce' : $('#foogallery_video_discount_offer').val() |
| 30 | }; |
| 31 | |
| 32 | $.ajax({ |
| 33 | type: "POST", |
| 34 | url: ajaxurl, |
| 35 | data: data, |
| 36 | success: function(data) { |
| 37 | $('.foogallery-video-offer-result').html(data); |
| 38 | }, |
| 39 | complete: function() { |
| 40 | $('.foogallery-video-discount-offer-spinner').removeClass('is-active'); |
| 41 | }, |
| 42 | error: function() { |
| 43 | //something went wrong! Alert the user and reload the page |
| 44 | alert('<?php esc_html_e( 'Something went wrong when retrieving the discount code.', 'foogallery' ); ?>'); |
| 45 | } |
| 46 | }); |
| 47 | }).on('click', '.foogallery-video-discount-offer-support', function(e){ |
| 48 | e.preventDefault(); |
| 49 | |
| 50 | $('.foogallery-video-discount-offer-support-container').slideDown(); |
| 51 | }).on('click', '.foogallery-video-discount-offer-support-submit', function(e){ |
| 52 | e.preventDefault(); |
| 53 | |
| 54 | //show the spinner |
| 55 | $('.foogallery-video-discount-offer-support-spinner').addClass('is-active'); |
| 56 | |
| 57 | var data = { |
| 58 | action: 'foogallery_video_discount_offer_support', |
| 59 | '_wpnonce' : $('#foogallery_video_discount_offer_support').val(), |
| 60 | 'message' : $('#foogallery_video_discount_offer_support_message').val() |
| 61 | }; |
| 62 | |
| 63 | $.ajax({ |
| 64 | type: "POST", |
| 65 | url: ajaxurl, |
| 66 | data: data, |
| 67 | success: function(data) { |
| 68 | alert(data); |
| 69 | }, |
| 70 | complete: function() { |
| 71 | $('.foogallery-video-discount-offer-support-spinner').removeClass('is-active'); |
| 72 | }, |
| 73 | error: function() { |
| 74 | //something went wrong! Alert the user and reload the page |
| 75 | alert('<?php esc_html_e( 'Something went wrong when sending the ticket.', 'foogallery' ); ?>'); |
| 76 | } |
| 77 | }); |
| 78 | }).on('click', '.foogallery-video-discount-offer-not-interested', function(e){ |
| 79 | e.preventDefault(); |
| 80 | |
| 81 | if ( confirm('Are you sure? You will not be able to redeem the offer again!') ) { |
| 82 | var data = { |
| 83 | action : 'foogallery_video_discount_offer_hide', |
| 84 | '_wpnonce': $('#foogallery_video_discount_offer_hide').val() |
| 85 | }; |
| 86 | |
| 87 | $.ajax({ |
| 88 | type : "POST", |
| 89 | url : ajaxurl, |
| 90 | data : data, |
| 91 | complete: function () { |
| 92 | location.href = '<?php echo esc_url( foogallery_admin_settings_url() ); ?>'; |
| 93 | } |
| 94 | }); |
| 95 | } |
| 96 | }); |
| 97 | |
| 98 | |
| 99 | }); |
| 100 | </script> |
| 101 | <div class="wrap about-wrap foogallery-video-offer-container"> |
| 102 | <h2><?php esc_html_e( 'FooGallery PRO Discount Offer', 'foogallery' ); ?></h2> |
| 103 | |
| 104 | <div class="foogallery-help"> |
| 105 | <?php esc_html_e('You are eligible for a FooGallery PRO discount, because you own a license for the FooVideo extension.', 'foogallery' ); ?> |
| 106 | </div> |
| 107 | <?php if ( $show_upgrade ) { ?> |
| 108 | <h4><?php esc_html_e( 'Reasons to upgrade to FooGallery PRO:', 'foogallery' ); ?></h4> |
| 109 | <ul class="ul-disc"> |
| 110 | <li><?php esc_html_e('FooGallery PRO now has all the features of FooVideo built-in.', 'foogallery'); ?></li> |
| 111 | <li><?php esc_html_e('FooGallery PRO has support for more video providers.', 'foogallery'); ?></li> |
| 112 | <li><?php esc_html_e('FooGallery PRO has better support for self-hosted videos.', 'foogallery'); ?></li> |
| 113 | <li><?php esc_html_e('FooVideo will no longer be supported and updated!', 'foogallery'); ?></li> |
| 114 | </ul> |
| 115 | <?php } ?> |
| 116 | <?php if ( !empty( $message ) ) { ?> |
| 117 | <p><?php echo wp_kses_post( $message ); ?></p> |
| 118 | <?php } ?> |
| 119 | <p><?php esc_html_e('Click the "Redeem Now" button below to retrieve your discount code based on the FooVideo license you have entered for this site. If you have not entered your FooVideo license, please enter it on the FooGallery Settings page, under the Features tab, and then try again.','foogallery'); ?></p> |
| 120 | |
| 121 | <p> |
| 122 | <?php esc_html_e('You can also log a support ticket through to our help desk if you are having any problems.', 'foogallery'); ?> |
| 123 | <a class="foogallery-video-discount-offer-support" href="#logticket"><?php esc_html_e('Log a support ticket.', 'foogallery' ); ?></a> |
| 124 | </p> |
| 125 | |
| 126 | <input type="submit" class="button button-primary foogallery-video-discount-offer" value="<?php esc_attr_e( 'Redeem Now!', 'foogallery'); ?>"> |
| 127 | |
| 128 | <?php wp_nonce_field( 'foogallery_video_discount_offer', 'foogallery_video_discount_offer' ); ?> |
| 129 | <div style="width:40px; display: inline-block;"><span class="foogallery-video-discount-offer-spinner spinner"></span></div> |
| 130 | |
| 131 | <input type="submit" class="button foogallery-video-discount-offer-not-interested" value="<?php esc_attr_e( 'I am no longer interested!', 'foogallery'); ?>"> |
| 132 | <?php wp_nonce_field( 'foogallery_video_discount_offer_hide', 'foogallery_video_discount_offer_hide' ); ?> |
| 133 | |
| 134 | <p class="foogallery-video-offer-result"></p> |
| 135 | |
| 136 | <div style="display: none" class="foogallery-video-discount-offer-support-container"> |
| 137 | <h4><?php esc_html_e('Log a Support Ticket', 'foogallery'); ?></h4> |
| 138 | <p><?php esc_html_e('The following information will be included in your support ticket:', 'foogallery'); ?></p> |
| 139 | <textarea id="foogallery_video_discount_offer_support_message" style="width: 600px; height: 100px">Site : <?php echo esc_url( home_url() ); ?> |
| 140 | |
| 141 | Email : <?php |
| 142 | $user = wp_get_current_user(); |
| 143 | echo esc_html( $user->get('user_email') ); |
| 144 | ?> |
| 145 | |
| 146 | FooVideo License Key : <?php echo esc_html( get_site_option( 'foo-video_licensekey' ) ); ?> |
| 147 | |
| 148 | Message : I am an existing FooVideo customer - please contact me.</textarea> |
| 149 | <br /> |
| 150 | <input type="submit" class="button foogallery-video-discount-offer-support-submit" value="<?php esc_attr_e( 'Log Support Ticket', 'foogallery'); ?>"> |
| 151 | <?php wp_nonce_field( 'foogallery_video_discount_offer_support', 'foogallery_video_discount_offer_support' ); ?> |
| 152 | <div style="width:40px; display: inline-block;"><span class="foogallery-video-discount-offer-support-spinner spinner"></span></div> |
| 153 | </div> |
| 154 | </div> |
| 155 |