Plugin Directory

Changeset 2139504


Ignore:
Timestamp:
08/14/2019 01:22:41 PM (7 years ago)
Author:
artdevstudios1
Message:

updates code base

Location:
woo-email-subscribe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woo-email-subscribe/trunk/readme.text

    r2130589 r2139504  
    22Contributors: navnit mishra,
    33Donate link: https://thehtmlcoder.net/donate/
    4 Tags: woocommerce, woocommerce email Subscribe, product price, discount
     4Tags: woocommerce, woocommerce Email Subscribe, product price, product discount
    55Requires at least: 4.4
    66Tested up to: 5.2
    7 Stable tag: 1.1.0
     7Stable tag: 1.1
    88Requires PHP: 5.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    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 
    1512== Description ==
    1613* 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
    1715== Installation ==
    1816
    1917= Minimum Requirements =
    20 
    2118* PHP version 5.2.4 or greater (PHP 5.6 or greater is recommended)
    2219* MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended)
     
    4138For more information,please readfull description
    4239
    43 = 1.1.0 =
     40= 1.1 =
    4441* Adding the functionality for non Login user and with Browser based storage.
    4542
    46 = 1.0.0 =
     43= 1.0=
    4744* initial  upload.
  • woo-email-subscribe/trunk/woocommerce-subscribe.php

    r2130589 r2139504  
    6969     
    7070    $table_name = $wpdb->prefix . 'wc_email_subcribe';
    71  
    72      if( count( $_COOKIE['user_email'] ) > 0 ){
     71    $resultCheck = '';
     72     if( !empty( $post_email )  ){
     73       
    7374   
    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' ");
    7976     }
    8077   
     
    8986function wpwes_email_subscribe_html() {
    9087   
    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 ) ) ){
    9391         ?>
    9492            <div class="form-group">           
     
    113111
    114112      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 ) ) ){
    120117       
    121         $cookie_name = "user_email";
    122         $cookie_value = $post_email;
    123         setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/");
     118       
    124119                       
    125120          $result= $wpdb->insert(
     
    132127        if($result){
    133128              esc_html_e('Thanks For subscribe','woo-email-subscribe');
     129
    134130        }else{
     131
    135132              esc_html_e('Somthing Went wrong. Please as with','woo-email-subscribe');
    136133        } 
     
    145142}
    146143 
    147  if( empty( get_email_status( $_COOKIE['user_email']  ) ) ){
     144
     145add_action('init','link_url');
     146function link_url(){
     147$current_user = wp_get_current_user();
     148
     149 if( !empty( wpwes_get_email_status( $current_user->user_email  ) ) ){
    148150    require_once WPWES_PLUGIN_WOO_DIR . '/price-discount-class.php';
    149151
    150152 }
     153
     154}
    151155 
Note: See TracChangeset for help on using the changeset viewer.