Changeset 2139504
- Timestamp:
- 08/14/2019 01:22:41 PM (7 years ago)
- Location:
- woo-email-subscribe
- Files:
-
- 3 edited
-
assets/banner-772x250.png (modified) (previous)
-
trunk/readme.text (modified) (2 diffs)
-
trunk/woocommerce-subscribe.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-email-subscribe/trunk/readme.text
r2130589 r2139504 2 2 Contributors: navnit mishra, 3 3 Donate link: https://thehtmlcoder.net/donate/ 4 Tags: woocommerce, woocommerce email Subscribe, product price,discount4 Tags: woocommerce, woocommerce Email Subscribe, product price, product discount 5 5 Requires at least: 4.4 6 6 Tested up to: 5.2 7 Stable tag: 1.1 .07 Stable tag: 1.1 8 8 Requires PHP: 5.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 This plugin is used for woocommerce for providing instant discount after subscribe with email.13 when user input their email then it will auto apply.14 15 12 == Description == 16 13 * This plugin is used in WooCommerce as an instant solution to provide a discount on subscribing to your website's email. The window and amount of the discount can be easily modified in the back-end. This plugin can be used to add that extra edge to your user-experience by giving them a prompt discount benefit. Add this to your website and get ahead! 14 17 15 == Installation == 18 16 19 17 = Minimum Requirements = 20 21 18 * PHP version 5.2.4 or greater (PHP 5.6 or greater is recommended) 22 19 * MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended) … … 41 38 For more information,please readfull description 42 39 43 = 1.1 .0=40 = 1.1 = 44 41 * Adding the functionality for non Login user and with Browser based storage. 45 42 46 = 1.0 .0=43 = 1.0= 47 44 * initial upload. -
woo-email-subscribe/trunk/woocommerce-subscribe.php
r2130589 r2139504 69 69 70 70 $table_name = $wpdb->prefix . 'wc_email_subcribe'; 71 72 if( count( $_COOKIE['user_email'] ) > 0 ){ 71 $resultCheck = ''; 72 if( !empty( $post_email ) ){ 73 73 74 74 $resultCheck = $_COOKIE['user_email']; 75 76 }else{ 77 $coo_value = $_COOKIE['user_email']; 78 $resultCheck = $wpdb->get_results( "SELECT * FROM $table_name WHERE `wc_email` = '$post_email' OR `wc_email` = '$coo_value' "); 75 $resultCheck = $wpdb->get_results( "SELECT * FROM $table_name WHERE `wc_email` = '$post_email' "); 79 76 } 80 77 … … 89 86 function wpwes_email_subscribe_html() { 90 87 91 92 if( empty( wpwes_get_email_status( $_COOKIE['user_email'] ) ) ){ 88 $current_user = wp_get_current_user(); 89 90 if( empty( wpwes_get_email_status( $current_user->user_email ) ) ){ 93 91 ?> 94 92 <div class="form-group"> … … 113 111 114 112 global $wpdb; 115 $table_name = $wpdb->prefix . 'wc_email_subcribe'; 116 117 print_r( $post_email ); 118 119 if( empty( get_email_status( $post_email ) ) ){ 113 114 $table_name = $wpdb->prefix . 'wc_email_subcribe'; 115 116 if( empty( wpwes_get_email_status( $post_email ) ) ){ 120 117 121 $cookie_name = "user_email"; 122 $cookie_value = $post_email; 123 setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); 118 124 119 125 120 $result= $wpdb->insert( … … 132 127 if($result){ 133 128 esc_html_e('Thanks For subscribe','woo-email-subscribe'); 129 134 130 }else{ 131 135 132 esc_html_e('Somthing Went wrong. Please as with','woo-email-subscribe'); 136 133 } … … 145 142 } 146 143 147 if( empty( get_email_status( $_COOKIE['user_email'] ) ) ){ 144 145 add_action('init','link_url'); 146 function link_url(){ 147 $current_user = wp_get_current_user(); 148 149 if( !empty( wpwes_get_email_status( $current_user->user_email ) ) ){ 148 150 require_once WPWES_PLUGIN_WOO_DIR . '/price-discount-class.php'; 149 151 150 152 } 153 154 } 151 155
Note: See TracChangeset
for help on using the changeset viewer.