Plugin Directory

Changeset 2328520


Ignore:
Timestamp:
06/22/2020 09:45:05 AM (6 years ago)
Author:
eberwp
Message:

update new widget

Location:
eber/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • eber/trunk/index.php

    r2298134 r2328520  
    55Description: Eber is a smart member system comes with comprehensive loyalty & rewards system, marketing and analytic tool.
    66Author: Eber
    7 Version: 2.4
     7Version: 2.5
    88Author URI: https://eber.co
    99License: GPLv2 or later
  • eber/trunk/init/activate.php

    r2206954 r2328520  
    3232            delete_option('adjust_point_when');
    3333            delete_option('eber_welcome_email');
     34
    3435            delete_option('exclude_tax');
    3536            delete_option('exclude_shipping');
    3637            delete_option('exclude_coupon');
     38            delete_option('widget_new');
    3739        }
    3840    }
  • eber/trunk/init/frontend.php

    r2049693 r2328520  
    55        public function get_js(){
    66            $slug = get_option('eber_business_slug','');
     7            $id = get_option('eber_business_id','');
    78            $status = get_option('eber_status',false);
     9            $widget_new = get_option('widget_new',false);
    810            $eber_custom_link = get_option('eber_custom_link',false);
    911            if($eber_custom_link)
    1012            {
    1113                $login = '&login='.urlencode(get_option('eber_custom_login_url',''));
     14                $login_url = '&login_url='.urlencode(get_option('eber_custom_login_url',''));
    1215                $signup = '&signup='.urlencode(get_option('eber_custom_signup_url',''));
    1316            }
     
    1518            {
    1619                $login = '';
     20                $login_url = '';
    1721                $signup = '';
    1822            }
    1923            if($slug != '')
    2024            {
    21                 wp_enqueue_script('my-js', '//eber-widget-' . $slug . '.eber.co/widget/get-js?type=wordpress&hid='.((!$status)?'1':'0').'&shop=' . get_bloginfo('siteurl') .$login.$signup. '&init=' . get_bloginfo('siteurl').'/wp-admin/admin-ajax.php?action=eber_init', array('jquery'));
     25//                wp_enqueue_script('my-js', '//eber-widget-' . $slug . '.eber.co/widget/get-js?type=wordpress&hid='.((!$status)?'1':'0').'&shop=' . get_bloginfo('siteurl') .$login.$signup. '&init=' . get_bloginfo('siteurl').'/wp-admin/admin-ajax.php?action=eber_init', array('jquery'));
     26                if(!$widget_new)
     27                    wp_enqueue_script('my-js', '//widget.eber.co/widget/'. $slug .'?type=wordpress&hid='.((!$status)?'1':'0').'&shop=' . get_bloginfo('siteurl') .$login.$signup. '&init=' . get_bloginfo('siteurl').'/wp-admin/admin-ajax.php?action=eber_init', array('jquery'));
     28                else
     29                    wp_enqueue_script('my-js', '//widget.eber.co/new-widget/initialize/'. $id .'?type=wordpress&hid='.((!$status)?'1':'0').'&shop=' . get_bloginfo('siteurl') .$login_url.$signup. '&init=' . get_bloginfo('siteurl').'/wp-admin/admin-ajax.php?action=eber_init', array('jquery'),null,true);
    2230            }
    2331
  • eber/trunk/init/menu.php

    r2206957 r2328520  
    2929            $exclude_shipping = get_option('exclude_shipping',true);
    3030            $exclude_coupon = get_option('exclude_coupon',true);
     31            $widget_new = get_option('widget_new',false);
    3132            $sync = get_option('eber_sync',false);
    3233            if($api_key != ''){
     
    4041                $eber_custom_link = (isset($_POST['eber_custom_link']));
    4142                $eber_welcome_email = (isset($_POST['eber_welcome_email']));
     43
    4244                $exclude_tax = (isset($_POST['exclude_tax']));
    4345                $exclude_shipping = (isset($_POST['exclude_shipping']));
    4446                $exclude_coupon = (isset($_POST['exclude_coupon']));
    45 
     47                $widget_new = (isset($_POST['widget_new']));
    4648                if(isset($_POST['eber_custom_login_url']))
    4749                {
     
    8688                                    update_option('eber_status',false);
    8789                                }
     90                                if(isset($_POST['widget_new']))
     91                                {
     92                                    update_option('widget_new',sanitize_text_field($_POST['widget_new']));
     93                                }
     94                                else
     95                                {
     96                                    update_option('widget_new',false);
     97                                }
    8898                                if(isset($_POST['eber_sync'])){
    8999                                    update_option('eber_sync',sanitize_text_field($_POST['eber_sync']));
     
    137147                                    update_option('eber_welcome_email',false);
    138148                                }
     149
     150
    139151                                if(isset($_POST['exclude_tax']))
    140152                                {
     
    163175                                    update_option('exclude_shipping',false);
    164176                                }
     177
     178
    165179                                $success = true;
    166180                            }
     
    194208                update_option('eber_business_name',$business['name']);
    195209                update_option('eber_business_slug',$business['slug']);
     210                update_option('eber_business_id',$business['id']);
    196211                return array(
    197212                    'success'=>true,
  • eber/trunk/layout/index.php

    r2298134 r2328520  
    88</p>
    99<form id="eber_connect_form" method="post" action="">
    10 <?php if(isset($error) && count($error) > 0){
     10<?php if(!empty($error)){
    1111foreach($error as $err):?>
    1212<div class="notice error my-acf-notice is-dismissible">
     
    3737        </td>
    3838    </tr>
    39     <tr>
    40             <th scope="row">&nbsp;</th>
    41             <td>
    42                 <fieldset>
    43                     <legend class="screen-reader-text"><span>Exclude Tax?</span></legend><label for="exclude_tax">
    44                         <input name="exclude_tax" type="checkbox" id="exclude_tax" value="1" <?php echo ($exclude_tax)?'checked':'';?>>
    45                         Exclude Tax?</label>
    46                 </fieldset>
    47             </td>
    48         </tr>
    49 
    50         <tr>
    51             <th scope="row">&nbsp;</th>
    52             <td>
    53                 <fieldset>
    54                     <legend class="screen-reader-text"><span>Exclude Shipping?</span></legend><label for="exclude_shipping">
    55                         <input name="exclude_shipping" type="checkbox" id="exclude_shipping" value="1" <?php echo ($exclude_shipping)?'checked':'';?>>
    56                         Exclude Shipping?</label>
    57                 </fieldset>
    58             </td>
    59         </tr>
    60 
    61         <tr>
    62             <th scope="row">&nbsp;</th>
    63             <td>
    64                 <fieldset>
    65                     <legend class="screen-reader-text"><span>Exclude Coupon?</span></legend><label for="exclude_coupon">
    66                         <input name="exclude_coupon" type="checkbox" id="exclude_coupon" value="1" <?php echo ($exclude_coupon)?'checked':'';?>>
    67                         Exclude Coupon?</label>
    68                 </fieldset>
    69             </td>
    70         </tr>
    7139<?php }
    7240?>
     
    8452Display Widget ?</label>
    8553</fieldset></td>
     54</tr>
     55<tr>
     56    <th scope="row">&nbsp;</th>
     57    <td> <fieldset><legend class="screen-reader-text"><span>New Widget ?</span></legend><label for="users_can_register">
     58                <input name="widget_new" type="checkbox" id="widget_new" value="1" <?php echo ($widget_new)?'checked':'';?>>
     59                New Widget ?</label>
     60        </fieldset></td>
    8661</tr>
    8762
     
    138113            </td>
    139114        </tr>
     115<?php
     116if ( class_exists( 'WooCommerce' ) )
     117{ ?>
     118        <tr>
     119            <th scope="row">&nbsp;</th>
     120            <td>
     121                <fieldset>
     122                    <legend class="screen-reader-text"><span>Exclude Tax?</span></legend><label for="exclude_tax">
     123                        <input name="exclude_tax" type="checkbox" id="exclude_tax" value="1" <?php echo ($exclude_tax)?'checked':'';?>>
     124                        Exclude Tax?</label>
     125                </fieldset>
     126            </td>
     127        </tr>
    140128
     129        <tr>
     130            <th scope="row">&nbsp;</th>
     131            <td>
     132                <fieldset>
     133                    <legend class="screen-reader-text"><span>Exclude Shipping?</span></legend><label for="exclude_shipping">
     134                        <input name="exclude_shipping" type="checkbox" id="exclude_shipping" value="1" <?php echo ($exclude_shipping)?'checked':'';?>>
     135                        Exclude Shipping?</label>
     136                </fieldset>
     137            </td>
     138        </tr>
     139
     140        <tr>
     141            <th scope="row">&nbsp;</th>
     142            <td>
     143                <fieldset>
     144                    <legend class="screen-reader-text"><span>Exclude Coupon?</span></legend><label for="exclude_coupon">
     145                        <input name="exclude_coupon" type="checkbox" id="exclude_coupon" value="1" <?php echo ($exclude_coupon)?'checked':'';?>>
     146                        Exclude Coupon?</label>
     147                </fieldset>
     148            </td>
     149        </tr>
     150<?php }
     151?>
    141152    </tbody>
    142153</table>
  • eber/trunk/readme.txt

    r2310543 r2328520  
    7373= 2.4 =
    7474update Fix syntax error on Window Server
     75= 2.5 =
     76update new Widget UI
    7577== Upgrade Notice ==
    7678= 0.1 =
     
    107109= 2.4 =
    108110update Fix syntax error on Window Server
     111= 2.5 =
     112update new Widget UI
    109113
    110114
     
    114118
    115119
    116 
Note: See TracChangeset for help on using the changeset viewer.