Plugin Directory

Changeset 3033994


Ignore:
Timestamp:
02/10/2024 04:54:43 PM (22 months ago)
Author:
hemelhasan
Message:

Update codebase of trunk

Location:
cart-notify/trunk
Files:
254 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • cart-notify/trunk/README.txt

    r2972569 r3033994  
    33Tags: cart notify, notifications, wooNotify, wooNotifys, notification, woocommerce, woocommerce-cart, notify, add to cart notification, add to cart notifications, add to cart notify, prominent manager, floating cart, side cart, ajax cart, cart popup, ajax add to cart, fly cart, mini cart, quick buy, sidebar cart, sticky cart, woocommerce ajax
    44Requires at least: 4.0
    5 Tested up to: 6.3.1
    6 WC tested up to: 8.1.1
    7 Stable tag: 1.1
     5Tested up to: 6.4.3
     6WC tested up to: 8.5.2
     7Stable tag: 1.1.1
    88Requires PHP: 7.2
    99License: GPL3
     
    1919== Features ==
    2020* Popup Notification (when products are added to cart)
     21* Popup Purchase Notification (When the product order is completed)
    2122
    2223== Up Coming Features ==
    2324* Popup Notification designs
    2425* Popup Notification location changing option
    25 * After purchase Notification (by Mail and WhatsApp)
     26* Fake purchase Notification (After a certain period of time)
    2627
    2728== Installation ==
     
    3940- Step 3. What is showing after clicking download button.
    4041- Setp 4. Open a support request with Step 3 Information
     42
     43
     44== Privacy Policy ==
     45Cart Notify uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements.
     46Appsero SDK **does not gather any data by default.** The SDK only starts gathering basic telemetry data **when a user allows it via the admin notice**. We collect the data to ensure a great user experience for all our users.
     47Integrating Appsero SDK **DOES NOT IMMEDIATELY** start gathering data, **without confirmation from users in any case.**
     48Learn more about how [Appsero collects and uses this data](https://appsero.com/privacy-policy/).
     49
    4150
    4251== Frequently Asked Questions ==
     
    5968= 1.0 = ( Dec 24, 2022 )
    6069- Initial release
     70
     71= 1.1.1 = ( Jan 10, 2024 )
     72- improvement performance
     73- New design added
     74- A new Admin option added
  • cart-notify/trunk/assets/css/cartnotifyadmin.css

    r2838974 r3033994  
    11
    22/* Commone */
    3 .CartnotifyNotices{
    4     opacity: 0.8;
    5     color: #7f7f7f;
    6     display: block;
    7     font-style: italic;
    8     margin-top: 0.8rem;
    9 }
    103
    11 .tooltip {
    12     position: relative;
    13 }
    14  
    15 .tooltiptext {
    16     visibility: hidden;
    17     width: 120px;
    18     background-color: black;
    19     color: #fff;
    20     text-align: center;
    21     border-radius: 6px;
    22     padding: 5px 5px;
    23  
    24     /* Position the tooltip */
    25     position: absolute;
    26     z-index: 1;
    27     z-index: 5;
    28     left: -50%;
    29    
    30   }
    31  
    32 .tooltip:hover > .tooltiptext {
    33     visibility: visible;
     4:root {
     5    /* --primary-bg: #8a2be2; */
     6    --btn-font-size: 18px;
     7    --btn-color: #1af0f08a;
    348}
    359
    3610
    3711
    38 /* setting page  */
    39 .CartNotifyAdmin_area_wrap {
    40     max-width: 980px;
    41     margin: auto;
    42     margin-top: 120px;
    43     background-color: aliceblue;
    44     padding: 1rem;
    45 }
    4612
    47 .CartNotifyAdmin_area_wrap .CartNotifyAdmin_heading{
    48     background-color: #fff;
    49     margin: 0;
    50     padding: 1rem 0.8rem;
    51     display: flex;
    52     justify-content: space-between;
    53     align-items: center;
    54 }
    55 
    56 .CartNotifySettingSave{
    57     cursor: pointer;
    58     padding: 1rem 1.5rem;
    59     background-color: #00ffff63;
    60     color: #000;
    61     font-size: 15px;
    62     font-weight: bold;
    63 }
    64 
    65 .CartNotifySettingSingleOp{
    66     margin-top: 2.5rem;
    67 }
    68 
    69 .CartNotifySettingSingleOp h4{
    70     font-size: 15px;
    71 }
    72 
  • cart-notify/trunk/assets/css/frontend.css

    r2838974 r3033994  
     1:root {
     2  --CNS-primary-bg: #e3ffed;
     3  --CNS-primary-text: #00080c;
     4  --CNS-primary-anchor-color: #104222;
     5  --CNS-btn-font-size: 18px;
     6  --CNS-btn-color: #1af0f08a;
     7}
    18
    29/* Commone */
    3 .visibility{
    4     visibility: visible;
    5 }
    6 .visibilitynot{
    7     visibility: hidden;
     10.notiny-base {
     11  height: 80px;
     12  width: 400px;
     13  display: flex;
     14  align-items: center;
    815}
    916
     17.notiny-base .notiny-img {
     18  border: 1px solid;
     19  border-radius: 5px;
     20  border-color: #10422229;
     21  width: 70px;
     22  height: 70px;
     23}
    1024
     25.notiny-base .notiny-text {
     26  font-size: 12px;
     27  color: var(--CNS-primary-text);
     28}
     29
     30.notiny-base .notiny-text .cns_close{
     31  position: absolute;
     32  right: 10px;
     33  top: 3px;
     34}
     35
     36.notiny-base .notiny-text .cns_close svg{
     37  fill: var(--CNS-primary-text);
     38}
     39
     40.notiny-base .notiny-text h2 {
     41  color: var(--CNS-primary-text);
     42}
    1143
    1244/* Notify section */
    13 .cartnotify-container{
    14     display: flex;
    15     background-color: #36cbdd57;
    16     padding: 0.5rem;
    17     border-radius: 2px;
    18     position: fixed;
    19     width: 300px;
    20     top: 10%;
    21     right: 0.5rem;
    22     z-index: 99999;
    23     flex-direction: row;
    24     flex-wrap: nowrap;
    25     align-content: center;
    26     justify-content: space-between;
    27     align-items: center;
    28     visibility: hidden;
     45.notify-theme-CNS-dark {
     46  background-color: var(--CNS-primary-bg);
     47  /* color: var(--CNS-primary-text); */
    2948}
    30 
    31 .closewonotify{
    32     background-color: aqua;
    33     padding: 0px 10px;
    34     cursor: pointer;
    35 }
    36 
    37 .cartnotify-productimg {
    38     width: 40px;
    39 }
    40 
    41 
    42 
    43 
    44 
    45 
    46 
    47 /* keyframes & Animation*/
    48 @-webkit-keyframes fadeInRight {
    49     0% {
    50        opacity: 0;
    51        -webkit-transform: translateX(20px);
    52     }
    53     100% {
    54        opacity: 1;
    55        -webkit-transform: translateX(0);
    56     }
    57 }
    58  
    59 @keyframes fadeInRight {
    60     0% {
    61        opacity: 0;
    62        transform: translateX(180px);
    63     }
    64     100% {
    65        opacity: 1;
    66        transform: translateX(0);
    67     }
    68 }
    69 .animated{
    70     -webkit-animation-duration: 1s;
    71     animation-duration: 1s;
    72     -webkit-animation-fill-mode: both;
    73     animation-fill-mode: both;
    74 }
    75  
    76 .fadeInRight {
    77     -webkit-animation-name: fadeInRight;
    78     animation-name: fadeInRight;
    79 }
    80 
  • cart-notify/trunk/assets/js/frontend.js

    r2838974 r3033994  
    11(function ($) {
    2     "use strict";
    3     jQuery(document).ready(function () {
     2  "use strict";
    43
    5         //Show when items remove from cart
    6         $(document).on(
    7             "click",
    8             ".cartnotify-container .closecartnotify",
    9             function () {
    10                 console.log('click');
    11                 $(".cartnotify-container").css({'visibility': 'hidden'});
    12             }
    13         );
     4  var closing  = "<svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='15' height='15' viewBox='0 0 24 24'><path d='M12,2C6.47,2,2,6.47,2,12c0,5.53,4.47,10,10,10s10-4.47,10-10C22,6.47,17.53,2,12,2z M16.707,15.293 c0.391,0.391,0.391,1.023,0,1.414C16.512,16.902,16.256,17,16,17s-0.512-0.098-0.707-0.293L12,13.414l-3.293,3.293 C8.512,16.902,8.256,17,8,17s-0.512-0.098-0.707-0.293c-0.391-0.391-0.391-1.023,0-1.414L10.586,12L7.293,8.707 c-0.391-0.391-0.391-1.023,0-1.414s1.023-0.391,1.414,0L12,10.586l3.293-3.293c0.391-0.391,1.023-0.391,1.414,0 s0.391,1.023,0,1.414L13.414,12L16.707,15.293z'></path></svg>";
    145
    15         // add_to_cart_button function
    16         $(document).on(
    17             "click",
    18             ".add_to_cart_button:not(.product_type_variable)",
    19             function () {
    20                 var wooproimg = $(".cartnotify-container").find(".cartnotify-productimg img");
     6  jQuery(document).ready(function () {
     7    $.notiny.addTheme("CNS_dark", {
     8      notification_class: "notify-theme-CNS-dark notiny-default-vars",
     9    });
    2110
    22                 var productthumnail = $(this).closest(".product")
    23                 .find("img")
    24                 .attr("src");
     11    console.log(CNS_params.notifyposition);
    2512
    26                 var producttitle = $(this).closest(".product").find("h2").text();
    27                 $('.cartnotify-producttitel').text(producttitle);
     13    // add_to_cart_button function
     14    $(document).on(
     15      "click",
     16      ".add_to_cart_button:not(.product_type_variable)",
     17      function () {
     18        var productthumnail = $(this)
     19          .closest(".product")
     20          .find("img")
     21          .attr("src");
    2822
    29                 wooproimg.attr("src", productthumnail);
    30                 $(".cartnotify-container").css({
    31                     'visibility': 'visible',
    32                     '-webkit-animation-name': 'fadeInRight',
    33                     'animation-name': 'fadeInRight'
    34                 });
    35                 setTimeout(function () {
    36                     $(".cartnotify-container").css({
    37                         'visibility': 'hidden',
    38                         '-webkit-animation-name': '',
    39                         'animation-name': ''
    40                     });
    41                 }, 2200);
     23        var productTitle = $(this).closest(".product").find("h2").text();
     24        productTitle = "<h2> " + productTitle + " </h2>";
     25
     26        var successMessage =
     27          "<span>The product has been successfully added to the cart</span>" + "<span class='cns_close'>"+closing+"</span>";
     28
     29        var all = productTitle + " " + successMessage;
     30        console.log(CNS_params.notifyposition);
     31        $.notiny({
     32          theme: "CNS_dark",
     33          width: '400',
     34          // autohide: false,
     35          image: productthumnail,
     36          text: all,
     37          position: CNS_params.notifyposition,
    4238        });
     39      }
     40    );
    4341
    44         // single_add_to_cart_button function
    45         $(document).on(
    46             "click",
    47             ".single_add_to_cart_button:not(.disabled)",
    48             function () {
    49                 var wooproimg = $(".cartnotify-container").find(".cartnotify-productimg img");
     42    // single_add_to_cart_button function
     43    $(document).on(
     44      "click",
     45      ".single_add_to_cart_button:not(.disabled)",
     46      function () {
     47        var productthumnail = $(this)
     48          .closest(".product")
     49          .find("figure")
     50          .find("img")
     51          .attr("src");
    5052
    51                 var productthumnail = $(this).closest(".product")
    52                 .find("figure").find("img").attr("src");
     53        var productthumnail = $(this)
     54          .closest(".product")
     55          .find(".woocommerce-product-gallery__wrapper")
     56          .find("img");
    5357
    54                 var producttitle = $(this).closest(".product").find(".product_title").text();
    55                 $('.cartnotify-producttitel').text(producttitle);
    56                
     58        if (productthumnail.length == 0) {
     59          var productthumnail = $(this)
     60            .closest(".product")
     61            .find("a")
     62            .find("img");
     63        }
     64        if (
     65          typeof productthumnail == "undefined" ||
     66          productthumnail.length == 0
     67        ) {
     68          return false;
     69        }
    5770
    58                 wooproimg.attr("src", productthumnail);
    59                 $(".cartnotify-container").css({
    60                     'visibility': 'visible',
    61                     '-webkit-animation-name': 'fadeInRight',
    62                     'animation-name': 'fadeInRight'
    63                 });
    64                 setTimeout(function () {
    65                     $(".cartnotify-container").css({
    66                         'visibility': 'hidden',
    67                         '-webkit-animation-name': '',
    68                         'animation-name': ''
    69                     });
    70                 }, 2200);
    71         });       
     71        var productThumb_src = productthumnail.attr("src");
    7272
     73        var producttitle = $(this)
     74          .closest(".product")
     75          .find(".product_title")
     76          .text();
    7377
     78        var successMessage =
     79          "<span>The product has been successfully added to the cart</span>" + "<span class='cns_close'>"+closing+"</span>";
    7480
     81        var all = producttitle + " " + successMessage;
    7582
    76 
    77 
    78 
    79 
    80 
    81 
    82 
    83 
    84 
    85 
    86 
    87 
    88     });
     83        $.notiny({
     84          theme: "CNS_dark",
     85          width: '400',
     86          image: productThumb_src,
     87          text: all,
     88          position: CNS_params.notifyposition,
     89          // position: 'right-top',
     90        });
     91      }
     92    );
     93  });
    8994})(jQuery);
  • cart-notify/trunk/cartnotify.php

    r2972569 r3033994  
    66 * Author: M Hemel Hasan
    77 * Author URI: https://mhemelhasan.com
    8  * Version: 1.1
     8 * Version: 1.1.1
    99 * Text Domain: cartnotify
    1010 * License: GPL3 or later
    1111 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1212 * Tags: notifications, wooNotify, cartnotify, cartnotifys, wooNotifys, notification, notificationx, woocommerce, woocommerce-cart, woocommerce-cart notify, notify, add to cart notification, add to cart notifications, add to cart notify, prominent manager, floating cart, side cart, ajax cart, cart popup, ajax add to cart, fly cart, mini cart, quick buy, sidebar cart, sticky cart, woocommerce ajax
    13  * Tested up to: 6.3.1
     13 * Tested up to: 6.4.3
    1414 * Requires PHP: 7.2
    15  * WC tested up to: 8.1.1
     15 * WC tested up to: 8.5.2
    1616 *
    1717 */
     
    2121 */
    2222if ( ! defined( 'ABSPATH' ) ) {
    23     exit;
     23    exit;
    2424}
    2525
     
    4242final class Cart_notify {
    4343
    44     /**
    45     * Plugin version
    46     *
    47     * @var string
    48     */
    49     const version = '1.0';
     44    /**
     45    * Plugin version
     46    *
     47    * @var string
     48    */
     49    const version = '1.1.1';
    5050
    51     /**
    52     * Class construcotr
    53     */
    54     private function __construct() {
    55         $this->define_constants();
     51    /**
     52    * Class construcotr
     53    */
     54    private function __construct() {
     55        $this->define_constants();
    5656
    57         register_activation_hook( __FILE__, [ $this, 'activate' ] );
    58         add_action( 'plugins_loaded', [ $this, 'init_plugin' ] );
    59     }
     57        register_activation_hook( __FILE__, [ $this, 'activate' ] );
     58        add_action( 'plugins_loaded', [ $this, 'init_plugin' ] );
    6059
    61     /**
    62      * Initializes a singleton instance
    63      *
    64      * @return \Cart_notify
    65      */
    66     public static function init() {
    67         static $instance = false;
     60        $this->appsero_init_tracker_cart_notify();
     61    }
    6862
    69         if ( ! $instance ) {
    70             $instance = new self();
    71         }
     63    /**
     64     * Initializes a singleton instance
     65     *
     66     * @return \Cart_notify
     67     */
     68    public static function init() {
     69        static $instance = false;
    7270
    73         return $instance;
    74     }
     71        if ( ! $instance ) {
     72            $instance = new self();
     73        }
    7574
    76     /**
    77      * Define the required plugin constants
    78      *
    79      * @return void
    80      */
    81     public function define_constants() {
    82         define( 'CART_NOTIFY_VERSION', self::version );
    83         define( 'CART_NOTIFY_FILE', __FILE__ );
    84         define( 'CART_NOTIFY_PATH', __DIR__ );
    85         define( 'CART_NOTIFY_URL', plugins_url( '', CART_NOTIFY_FILE ) );
    86         define( 'CART_NOTIFY_ASSETS', CART_NOTIFY_URL . '/assets' );
    87     }
     75        return $instance;
     76    }
    8877
    89     /**
    90      * Initialize the plugin
    91      *
    92      * @return void
    93      */
    94     public function init_plugin() {
     78    /**
     79     * Define the required plugin constants
     80     *
     81     * @return void
     82     */
     83    public function define_constants() {
     84        define( 'CART_NOTIFY_VERSION', self::version );
     85        // URLs
     86        define( 'CART_NOTIFY_FILE', __FILE__ );
     87        define( 'CART_NOTIFY_URL', plugins_url( '', CART_NOTIFY_FILE ) );
     88        define( 'CART_NOTIFY_ASSETS', CART_NOTIFY_URL . '/assets' );
     89        // Paths
     90        define( 'CART_NOTIFY_PATH', __DIR__ );
     91        define( 'CART_NOTIFY_ADMIN_PATH', CART_NOTIFY_PATH . '/admin' );
     92        define( 'CART_NOTIFY_ASSETS_PATH', CART_NOTIFY_PATH . '/assets' );
     93        define( 'CART_NOTIFY_INCLUDES', CART_NOTIFY_PATH . '/includes' );
     94    }
    9595
    96         New Cart\notify\Necessary();
    97        
    98         new Cart\notify\Assets();
     96    /**
     97     * Initialize the plugin
     98     *
     99     * @return void
     100     */
     101    public function init_plugin() {
    99102
    100         if ( is_admin() ) {
    101             new Cart\notify\Admin();
    102         } else {
    103             new Cart\notify\Frontend();
    104            
    105         }
     103        new Cart\notify\Necessary();
    106104
    107     }
     105        new Cart\notify\Assets();
    108106
    109     /**
    110      * Do stuff upon plugin activation
    111      *
    112      * @return void
    113      */
    114     public function activate() {
    115         $installed = get_option( 'cart_notify_installed' );
     107        require_once CART_NOTIFY_INCLUDES . '/functions.php';
    116108
    117         if ( ! $installed ) {
    118             update_option( 'cart_notify_installed', time() );
    119         }
     109        if ( is_admin() ) {
     110            new Cart\notify\Admin();
     111        } else {
     112            new Cart\notify\Frontend();
     113        }
    120114
    121         update_option( 'cart_notify_version', CART_NOTIFY_VERSION );
    122     }
     115    }
     116
     117    /**
     118     * Do stuff upon plugin activation
     119     *
     120     * @return void
     121     */
     122    public function activate() {
     123        $installed = get_option( 'cart_notify_installed' );
     124
     125        if ( ! $installed ) {
     126            update_option( 'cart_notify_installed', time() );
     127        }
     128
     129        update_option( 'cart_notify_version', CART_NOTIFY_VERSION );
     130    }
     131
     132    /**
     133     * Initialize the plugin tracker
     134     *
     135     * @return void
     136     */
     137    public function appsero_init_tracker_cart_notify() {
     138        $client = new Appsero\Client( 'dfb06bac-cdf6-4eac-b2f4-be927ccd0aae', 'Cart Notify', __FILE__ );
     139
     140        // Active insights
     141        $client->insights()->init();
     142
     143    }
    123144}
    124145
     
    129150 */
    130151function Cart_notify() {
    131     return Cart_notify::init();
     152    return Cart_notify::init();
    132153}
    133154
  • cart-notify/trunk/includes/Admin.php

    r2838974 r3033994  
    1313    function __construct() {
    1414
    15         new Admin\CartnotifySettings();
    1615        new Admin\CartnotiSetpage();
    1716    }
  • cart-notify/trunk/includes/Admin/CartnotiSetpage.php

    r2838974 r3033994  
    1010     */
    1111    function __construct() {
    12         add_action( 'CartNotifySetting_options_render', [$this, 'add_form_settings'] );
     12        $this->PluginOption();
     13       
    1314    }
    1415
    15     public function add_form_settings() { ?>
     16    public function PluginOption(){
     17        // Option Framework
     18        if ( file_exists( CART_NOTIFY_ADMIN_PATH .'/framework/framework.php' ) ) {
     19            require_once( CART_NOTIFY_ADMIN_PATH .'/framework/framework.php' );
     20        }
    1621
    17         <div class="CartNotifyAdmin_area_wrap">
    18             <div class="CartNotifyAdmin_heading">
    19                 <h2><?php esc_html_e( 'Cart Notify Settiong Page', 'cartnotify' ); ?></h2>
     22        // Options
     23        if ( file_exists( WP_PLUGIN_DIR .'/cart-notify-pro/admin/config.php' )  && defined( 'INSTANTIO_PRO_CONFIG' ) && defined( 'INSTANTIO_PRO' ) ) {
     24            require_once( WP_PLUGIN_DIR .'/cart-notify-pro/admin/config.php' );
     25        } elseif ( file_exists( CART_NOTIFY_ADMIN_PATH .'/config.php' ) ) {
     26            require_once( CART_NOTIFY_ADMIN_PATH .'/config.php' );
     27        }
     28    }
    2029
    21                 <div class="tooltip">
    22                     <a class="CartNotifySettingSave"><?php esc_html_e( 'Save', 'cartnotify' ); ?></a>
    23                     <span class="tooltiptext"><?php esc_html_e( 'Already Save Thanks', 'cartnotify' ); ?></span>
    24                 </div>
    25            
    26             </div>
    27             <div class="CartNotifySettingOp">
    28                 <div class="CartNotifySettingSingleOp_wrap">
    29                     <div class="CartNotifySettingSingleOp">
    30                         <h4><?php esc_html_e( 'Notification Design Option', 'cartnotify' ); ?></h4>
    31                         <input type="radio" name="cartnotify_layout_1" id="cartnotify_layout_1" class="input-hidden" checked/>
    32                         <label for="cartnotify_layout_1">
    33                             <img src="<?php echo CART_NOTIFY_ASSETS ?>/img/cartnotify_layout_1.png" />
    34                         </label>
    35                         <span class="CartnotifyNotices"><?php esc_html_e( '**At the moment we have only one design. Very soon we will bring new designs', 'cartnotify' ); ?></span>
    36                     </div>
    37 
    38                     <div class="CartNotifySettingSingleOp">
    39                         <h4><?php esc_html_e( 'Notification Position Option', 'cartnotify' ); ?></h4>
    40                         <span class="CartnotifyNotices"><?php esc_html_e( '**Right now we only have one location option in the top right side. Very soon we will bring new Position Option', 'cartnotify' ); ?></span>
    41                     </div>
    42 
    43                 </div>
    44 
    45             </div>
    46         </div>
    47 
    48 
    49 
    50 
    51 
    52 
    53 
    54 
    55 
    56      
    57     <?php }
    5830}
    5931
  • cart-notify/trunk/includes/Assets.php

    r2838974 r3033994  
    1212     */
    1313    function __construct() {
     14       
     15        add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ] );
    1416        add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ] );
    15         add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ] );
     17
     18        // Js Variable
     19        add_action( 'wp_enqueue_scripts', [ $this, 'cartnotify_script_custom_js' ]);
     20        add_action( 'wp_enqueue_scripts', [ $this, 'cns_custom_enqueue_scripts' ] );
    1621    }
    1722
     
    2732                'version' => filemtime( CART_NOTIFY_PATH . '/assets/js/frontend.js' ),
    2833                'deps'    => [ 'jquery' ]
     34            ],
     35
     36            'cartnotify-libs-script' => [
     37                'src'     => CART_NOTIFY_ASSETS . '/libs/notiny.js',
     38                'version' => filemtime( CART_NOTIFY_PATH . '/assets/libs/notiny.js' ),
     39                'deps'    => [ 'jquery' ]
     40            ],
     41       
     42            'cartnotify-admin-script' => [
     43                'src'     => CART_NOTIFY_ASSETS . '/js/CartNAdmin.js',
     44                'version' => filemtime( CART_NOTIFY_PATH . '/assets/js/CartNAdmin.js' ),
     45                'deps'    => [ 'jquery' ]
    2946            ]
    3047        ];
     
    3855    public function get_styles() {
    3956        return [
     57            'cartnotify-libs-style' => [
     58                'src'     => CART_NOTIFY_ASSETS . '/libs/notiny.css',
     59                'version' => filemtime( CART_NOTIFY_PATH . '/assets/libs/notiny.css' )
     60            ],
     61
    4062            'cartnotify-style' => [
    4163                'src'     => CART_NOTIFY_ASSETS . '/css/frontend.css',
    4264                'version' => filemtime( CART_NOTIFY_PATH . '/assets/css/frontend.css' )
    4365            ],
     66
    4467            'cartnotifyadmin-style' => [
    4568                'src'     => CART_NOTIFY_ASSETS . '/css/cartnotifyadmin.css',
     
    7295 
    7396    }
     97
     98    /**
     99     * Extra script var
     100     *
     101     * @return array
     102     */
     103    public function cns_custom_enqueue_scripts(){
     104        // Enqueue the script
     105        $cns_notify_position = !empty(notify_opts( 'cns-notify-position' )) ? notify_opts( 'cns-notify-position' ) : '';
     106
     107        wp_localize_script( 'cartnotify-script', 'CNS_params',
     108            array(
     109                'cns_ajax_nonce'                => wp_create_nonce( 'ins_ajax_nonce' ),
     110                'ajax_url'                      => admin_url( 'admin-ajax.php' ),
     111                'cns_raw_ajax_url'              => WC()->ajax_url(),
     112                'wc_ajax_url'                   => \WC_AJAX::get_endpoint( '%%endpoint%%' ),
     113                'notifyposition'                => $cns_notify_position,
     114            )
     115        );
     116    }
     117
     118    /**
     119     * Register scripts Extra
     120     *
     121     * @return void
     122     */
     123    public function cartnotify_script_custom_js(){
     124        // icons All
     125        include_once( CART_NOTIFY_ASSETS_PATH . '/icons/closing.php');
     126       
     127        // Backend options as variables
     128        $cns_notify_opt = !empty(notify_opts( 'cns-notify-opt' )) ? notify_opts( 'cns-notify-opt' ) : '';
     129        $cns_notify_position = !empty(notify_opts( 'cns-notify-position' )) ? notify_opts( 'cns-notify-position' ) : '';
     130       
     131        // add all options
     132        $output = '';
     133           
     134        $output .= " var clsoing_icon = '$notify_close'; " ;
     135        $output .= " var notifyopt = '$cns_notify_opt'; " ;
     136        $output .= " var notifyposition = '$cns_notify_position'; " ;
     137
     138       
     139        wp_add_inline_script( 'cartnotify-script', $output );
     140    }
     141   
    74142}
  • cart-notify/trunk/includes/Frontend.php

    r2838974 r3033994  
    1212     */
    1313    function __construct() {
    14        
    1514        new Frontend\Notify();
    1615    }
  • cart-notify/trunk/includes/Frontend/Notify.php

    r2838974 r3033994  
    1515     */
    1616    function __construct() {
    17         add_action( 'wp_footer', [$this, 'cartnotify_layout_1']);
    18         wp_enqueue_style('cartnotify-style');
    19         wp_enqueue_script('cartnotify-script');
     17        // Higher priority
     18        add_action('wp_enqueue_scripts', [$this, 'cns_scripts_add']);
     19       
    2020    }
    2121
    22 
    23     /**
    24      * Initialize Template one
    25      * @return \cartnotify_layout_1
    26      */
    27     public function cartnotify_layout_1() {
    28 
    29         // Return if woocommerce not active
    30         if ( !class_exists( 'woocommerce' ) ) {
    31             return;
    32         }
    33 
    34         // Return if checkout page
    35         if ( class_exists( 'woocommerce' ) ) {
    36             if (is_checkout()) {
    37                 return;
    38             }
    39         }
    40         ?>
    41        
    42         <!-- Cart Notify -->
    43         <div class="cartnotify-container animated">
    44             <div class="cartnotify-productimg">
    45                 <img src=""/>
    46             </div>
    47             <div class="cartnotify-producttitel"><?php esc_html_e( 'Product Titel', 'cartnotify' ); ?></div>
    48             <a class="closecartnotify" herf="#">x</a>
    49         </div>
    50        
    51        
    52        
    53        
    54         <?php
     22    public function cns_scripts_add() {
     23        wp_enqueue_script('cartnotify-libs-script');
     24        wp_enqueue_script('cartnotify-script', array('cartnotify-libs-script'));
     25        wp_enqueue_style('cartnotify-libs-style');
     26        wp_enqueue_style('cartnotify-style');
    5527    }
    5628   
    57 
    58 
    59 
    6029}
    6130
  • cart-notify/trunk/vendor/autoload.php

    r2838974 r3033994  
    33// autoload.php @generated by Composer
    44
    5 if (PHP_VERSION_ID < 50600) {
    6     if (!headers_sent()) {
    7         header('HTTP/1.1 500 Internal Server Error');
    8     }
    9     $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
    10     if (!ini_get('display_errors')) {
    11         if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
    12             fwrite(STDERR, $err);
    13         } elseif (!headers_sent()) {
    14             echo $err;
    15         }
    16     }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
    21 }
    22 
    235require_once __DIR__ . '/composer/autoload_real.php';
    246
  • cart-notify/trunk/vendor/composer/InstalledVersions.php

    r2838974 r3033994  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
    24  *
    25  * @final
    2624 */
    2725class InstalledVersions
     
    2927    /**
    3028     * @var mixed[]|null
    31      * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
     29     * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
    3230     */
    3331    private static $installed;
     
    4038    /**
    4139     * @var array[]
    42      * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     40     * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
    4341     */
    4442    private static $installedByVendor = array();
     
    244242    /**
    245243     * @return array
    246      * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
     244     * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
    247245     */
    248246    public static function getRootPackage()
     
    258256     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    259257     * @return array[]
    260      * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
     258     * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
    261259     */
    262260    public static function getRawData()
     
    281279     *
    282280     * @return array[]
    283      * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     281     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
    284282     */
    285283    public static function getAllRawData()
     
    304302     * @return void
    305303     *
    306      * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
     304     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
    307305     */
    308306    public static function reload($data)
     
    314312    /**
    315313     * @return array[]
    316      * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     314     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
    317315     */
    318316    private static function getInstalled()
  • cart-notify/trunk/vendor/composer/autoload_classmap.php

    r2838974 r3033994  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(__DIR__);
     5$vendorDir = dirname(dirname(__FILE__));
    66$baseDir = dirname($vendorDir);
    77
    88return array(
     9    'Appsero\\Client' => $vendorDir . '/appsero/client/src/Client.php',
     10    'Appsero\\Insights' => $vendorDir . '/appsero/client/src/Insights.php',
     11    'Appsero\\License' => $vendorDir . '/appsero/client/src/License.php',
     12    'Cart\\notify\\Admin' => $baseDir . '/includes/Admin.php',
     13    'Cart\\notify\\Admin\\CartnotiSetpage' => $baseDir . '/includes/Admin/CartnotiSetpage.php',
     14    'Cart\\notify\\Assets' => $baseDir . '/includes/Assets.php',
     15    'Cart\\notify\\Frontend' => $baseDir . '/includes/Frontend.php',
     16    'Cart\\notify\\Frontend\\Notify' => $baseDir . '/includes/Frontend/Notify.php',
     17    'Cart\\notify\\Necessary' => $baseDir . '/includes/Necessary.php',
    918    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1019);
  • cart-notify/trunk/vendor/composer/autoload_namespaces.php

    r2838974 r3033994  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(__DIR__);
     5$vendorDir = dirname(dirname(__FILE__));
    66$baseDir = dirname($vendorDir);
    77
  • cart-notify/trunk/vendor/composer/autoload_psr4.php

    r2838974 r3033994  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(__DIR__);
     5$vendorDir = dirname(dirname(__FILE__));
    66$baseDir = dirname($vendorDir);
    77
    88return array(
    99    'Cart\\notify\\' => array($baseDir . '/includes'),
     10    'Appsero\\' => array($vendorDir . '/appsero/client/src'),
    1011);
  • cart-notify/trunk/vendor/composer/autoload_real.php

    r2838974 r3033994  
    2323        }
    2424
     25        require __DIR__ . '/platform_check.php';
     26
    2527        spl_autoload_register(array('ComposerAutoloaderInit25b80f0f15aca0cdc97de9b25fa0c001', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    2729        spl_autoload_unregister(array('ComposerAutoloaderInit25b80f0f15aca0cdc97de9b25fa0c001', 'loadClassLoader'));
    2830
    29         require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit25b80f0f15aca0cdc97de9b25fa0c001::getInitializer($loader));
     31        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     32        if ($useStaticLoader) {
     33            require __DIR__ . '/autoload_static.php';
     34
     35            call_user_func(\Composer\Autoload\ComposerStaticInit25b80f0f15aca0cdc97de9b25fa0c001::getInitializer($loader));
     36        } else {
     37            $map = require __DIR__ . '/autoload_namespaces.php';
     38            foreach ($map as $namespace => $path) {
     39                $loader->set($namespace, $path);
     40            }
     41
     42            $map = require __DIR__ . '/autoload_psr4.php';
     43            foreach ($map as $namespace => $path) {
     44                $loader->setPsr4($namespace, $path);
     45            }
     46
     47            $classMap = require __DIR__ . '/autoload_classmap.php';
     48            if ($classMap) {
     49                $loader->addClassMap($classMap);
     50            }
     51        }
    3152
    3253        $loader->register(true);
  • cart-notify/trunk/vendor/composer/autoload_static.php

    r2838974 r3033994  
    1212            'Cart\\notify\\' => 12,
    1313        ),
     14        'A' =>
     15        array (
     16            'Appsero\\' => 8,
     17        ),
    1418    );
    1519
     
    1923            0 => __DIR__ . '/../..' . '/includes',
    2024        ),
     25        'Appsero\\' =>
     26        array (
     27            0 => __DIR__ . '/..' . '/appsero/client/src',
     28        ),
    2129    );
    2230
    2331    public static $classMap = array (
     32        'Appsero\\Client' => __DIR__ . '/..' . '/appsero/client/src/Client.php',
     33        'Appsero\\Insights' => __DIR__ . '/..' . '/appsero/client/src/Insights.php',
     34        'Appsero\\License' => __DIR__ . '/..' . '/appsero/client/src/License.php',
     35        'Cart\\notify\\Admin' => __DIR__ . '/../..' . '/includes/Admin.php',
     36        'Cart\\notify\\Admin\\CartnotiSetpage' => __DIR__ . '/../..' . '/includes/Admin/CartnotiSetpage.php',
     37        'Cart\\notify\\Assets' => __DIR__ . '/../..' . '/includes/Assets.php',
     38        'Cart\\notify\\Frontend' => __DIR__ . '/../..' . '/includes/Frontend.php',
     39        'Cart\\notify\\Frontend\\Notify' => __DIR__ . '/../..' . '/includes/Frontend/Notify.php',
     40        'Cart\\notify\\Necessary' => __DIR__ . '/../..' . '/includes/Necessary.php',
    2441        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    2542    );
  • cart-notify/trunk/vendor/composer/installed.json

    r2838974 r3033994  
    11{
    2     "packages": [],
    3     "dev": true,
     2    "packages": [
     3        {
     4            "name": "appsero/client",
     5            "version": "dev-develop",
     6            "version_normalized": "dev-develop",
     7            "source": {
     8                "type": "git",
     9                "url": "https://github.com/Appsero/client.git",
     10                "reference": "a8e02e8a5a862671f04ff00a456e2711d807a598"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/Appsero/client/zipball/a8e02e8a5a862671f04ff00a456e2711d807a598",
     15                "reference": "a8e02e8a5a862671f04ff00a456e2711d807a598",
     16                "shasum": ""
     17            },
     18            "require": {
     19                "php": ">=5.6"
     20            },
     21            "require-dev": {
     22                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
     23                "phpcompatibility/phpcompatibility-wp": "dev-master",
     24                "phpunit/phpunit": "^8.5.31",
     25                "squizlabs/php_codesniffer": "^3.7",
     26                "tareq1988/wp-php-cs-fixer": "dev-master",
     27                "wp-coding-standards/wpcs": "dev-develop"
     28            },
     29            "time": "2024-01-30T08:15:23+00:00",
     30            "default-branch": true,
     31            "type": "library",
     32            "installation-source": "dist",
     33            "autoload": {
     34                "psr-4": {
     35                    "Appsero\\": "src/"
     36                }
     37            },
     38            "notification-url": "https://packagist.org/downloads/",
     39            "license": [
     40                "MIT"
     41            ],
     42            "authors": [
     43                {
     44                    "name": "Tareq Hasan",
     45                    "email": "[email protected]"
     46                }
     47            ],
     48            "description": "Appsero Client",
     49            "keywords": [
     50                "analytics",
     51                "plugin",
     52                "theme",
     53                "wordpress"
     54            ],
     55            "support": {
     56                "issues": "https://github.com/Appsero/client/issues",
     57                "source": "https://github.com/Appsero/client/tree/develop"
     58            },
     59            "install-path": "../appsero/client"
     60        }
     61    ],
     62    "dev": false,
    463    "dev-package-names": []
    564}
  • cart-notify/trunk/vendor/composer/installed.php

    r2838974 r3033994  
    11<?php return array(
    22    'root' => array(
    3         'name' => 'mhemelhasan/hemelhasan-plugin',
    4         'pretty_version' => 'dev-master',
    5         'version' => 'dev-master',
    6         'reference' => '881024cd1ef3d712e9f9d847a5bd8fdc9c5754f7',
     3        'pretty_version' => '1.0.0+no-version-set',
     4        'version' => '1.0.0.0',
    75        'type' => 'wordpress-plugin',
    86        'install_path' => __DIR__ . '/../../',
    97        'aliases' => array(),
    10         'dev' => true,
     8        'reference' => NULL,
     9        'name' => 'mhemelhasan/hemelhasan-plugin',
     10        'dev' => false,
    1111    ),
    1212    'versions' => array(
     13        'appsero/client' => array(
     14            'pretty_version' => 'dev-develop',
     15            'version' => 'dev-develop',
     16            'type' => 'library',
     17            'install_path' => __DIR__ . '/../appsero/client',
     18            'aliases' => array(
     19                0 => '9999999-dev',
     20            ),
     21            'reference' => 'a8e02e8a5a862671f04ff00a456e2711d807a598',
     22            'dev_requirement' => false,
     23        ),
    1324        'mhemelhasan/hemelhasan-plugin' => array(
    14             'pretty_version' => 'dev-master',
    15             'version' => 'dev-master',
    16             'reference' => '881024cd1ef3d712e9f9d847a5bd8fdc9c5754f7',
     25            'pretty_version' => '1.0.0+no-version-set',
     26            'version' => '1.0.0.0',
    1727            'type' => 'wordpress-plugin',
    1828            'install_path' => __DIR__ . '/../../',
    1929            'aliases' => array(),
     30            'reference' => NULL,
    2031            'dev_requirement' => false,
    2132        ),
Note: See TracChangeset for help on using the changeset viewer.