Plugin Directory

Changeset 2656992


Ignore:
Timestamp:
01/13/2022 06:56:27 AM (4 years ago)
Author:
tribeinteractive
Message:

Plugin updated to v1.8

Location:
caddy
Files:
78 added
10 edited

Legend:

Unmodified
Added
Removed
  • caddy/trunk/README.txt

    r2596417 r2656992  
    55Tags: caddy, woocommerce, woo, cart, side cart, sticky cart, cart notices, popup cart, woocommerce cart, shopping cart, mini-cart, floating cart
    66Requires at least: 5.0
    7 Tested up to: 5.8.1
     7Tested up to: 5.8.3
    88Requires PHP: 7.0
    9 Stable tag: v1.7.9
     9Stable tag: v1.8
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9494
    9595== Changelog ==
     96
     97= 1.8 =
     98* Improvement: caddy-public-fonts.css added as a separate file
     99* Fix: Redirect external product to the URL
     100* Improvement: Update Caddy cart screen qty field based on the product "Sold individually" settings
     101* Fix: cc_cart_icon & cart_text undefined error for the widgets
     102* Improvement: Premium version license activation check function added
     103* Improvement: Add support for "Display on the Checkout page" premium version option
     104* Fix: Excluding draft products to appear on the product recommendation
     105* Improvement: UK country code added in the free shipping meter
     106* Improvement: Hooks added before and after caddy cart items
    96107
    97108= 1.7.9 =
  • caddy/trunk/caddy.php

    r2596417 r2656992  
    1010 * Plugin URI:        https://usecaddy.com
    1111 * Description:       A high performance, conversion-boosting side cart for your WooCommerce store that improves the shopping experience & helps grow your sales.
    12  * Version:           1.7.9
     12 * Version:           1.8
    1313 * Author:            Tribe Interactive
    1414 * Author URI:        https://www.madebytribe.com
     
    3131 */
    3232if ( ! defined( 'CADDY_VERSION' ) ) {
    33     define( 'CADDY_VERSION', '1.7.9' );
     33    define( 'CADDY_VERSION', '1.8' );
    3434}
    3535if ( ! defined( 'CADDY_PLUGIN_FILE' ) ) {
  • caddy/trunk/includes/class-caddy-cart-widget.php

    r2563235 r2656992  
    2626    public function widget( $args, $instance ) {
    2727        $cart_widget_title = isset( $instance['cart_widget_title'] ) ? apply_filters( 'widget_title', $instance['cart_widget_title'] ) : '';
     28        $cc_cart_icon = isset( $instance['cc_cart_icon'] ) ? $instance['cc_cart_icon'] : '';
     29        $cart_text = isset( $instance['cart_text'] ) ? $instance['cart_text'] : '';
     30
    2831        // before and after widget arguments are defined by themes
    2932        echo $args['before_widget'];
     
    4346            'javascript:void(0);',
    4447            esc_html__( 'Cart Items', 'caddy' ),
    45             ( 'on' == $instance['cc_cart_icon'] ) ? '' : $cart_icon_class,
    46             esc_html( $instance['cart_text'] ),
     48            ( 'on' == $cc_cart_icon ) ? '' : $cart_icon_class,
     49            esc_html( $cart_text ),
    4750            $cc_cart_class,
    4851            esc_html( $cart_count )
  • caddy/trunk/includes/class-caddy.php

    r2596417 r2656992  
    169169
    170170    /**
     171     * The name of the plugin used to uniquely identify it within the context of
     172     * WordPress and to define internationalization functionality.
     173     *
     174     * @return    string    The name of the plugin.
     175     * @since     1.0.0
     176     */
     177    public function get_plugin_name() {
     178        return $this->plugin_name;
     179    }
     180
     181    /**
     182     * Retrieve the version number of the plugin.
     183     *
     184     * @return    string    The version number of the plugin.
     185     * @since     1.0.0
     186     */
     187    public function get_version() {
     188        return $this->version;
     189    }
     190
     191    /**
    171192     * Register all of the hooks related to the public-facing functionality
    172193     * of the plugin.
     
    295316
    296317    /**
    297      * The name of the plugin used to uniquely identify it within the context of
    298      * WordPress and to define internationalization functionality.
    299      *
    300      * @return    string    The name of the plugin.
    301      * @since     1.0.0
    302      */
    303     public function get_plugin_name() {
    304         return $this->plugin_name;
    305     }
    306 
    307     /**
    308318     * The reference to the class that orchestrates the hooks with the plugin.
    309319     *
     
    316326
    317327    /**
    318      * Retrieve the version number of the plugin.
    319      *
    320      * @return    string    The version number of the plugin.
    321      * @since     1.0.0
    322      */
    323     public function get_version() {
    324         return $this->version;
     328     * Check Caddy premium version license is active or not
     329     *
     330     * @return bool
     331     */
     332    public function cc_check_premium_license_activation() {
     333        $caddy_license_status = get_transient( 'cp_license_status' );
     334        // Check if premium plugin is active or not
     335        if ( ! class_exists( 'Caddy_Premium' ) ||
     336             ( isset( $caddy_license_status ) && ! empty( $caddy_license_status ) ) ) {
     337            // Return if the license key is valid
     338            if ( 'valid' === $caddy_license_status ) {
     339                return true;
     340            } else {
     341                return false;
     342            }
     343        } else {
     344            return false;
     345        }
    325346    }
    326347
  • caddy/trunk/languages/caddy.pot

    r2596417 r2656992  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Caddy - Smart Side Cart for WooCommerce 1.7.9\n"
     5"Project-Id-Version: Caddy - Smart Side Cart for WooCommerce 1.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/caddy\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • caddy/trunk/public/class-caddy-public.php

    r2596417 r2656992  
    6363    public function enqueue_styles() {
    6464
    65         if ( ! is_checkout() ) { // Not load on the checkout page
    66             wp_enqueue_style( 'cc-fontawesome', 'https://use.fontawesome.com/releases/v5.6.3/css/all.css', array(), '5.6.3', 'all' );
    67             wp_enqueue_style( 'cc-slick', plugin_dir_url( __FILE__ ) . 'css/slick.css', array(), $this->version, 'all' );
    68             wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/caddy-public.css', array( 'cc-fontawesome' ), $this->version, 'all' );
    69             wp_enqueue_style( 'cc-icons', plugin_dir_url( __FILE__ ) . 'css/caddy-icons.css', array(), $this->version, 'all' );
    70         }
     65        if ( is_checkout() ) {
     66            $caddy                         = new Caddy();
     67            $cc_premium_license_activation = $caddy->cc_check_premium_license_activation();
     68            if ( $cc_premium_license_activation ) {
     69                $cc_enable_on_checkout_page = get_option( 'cc_enable_on_checkout_page' );
     70                if ( 'enabled' !== $cc_enable_on_checkout_page ) {
     71                    return;
     72                }
     73            } else {
     74                return;
     75            }
     76        }
     77
     78        wp_enqueue_style( 'cc-fontawesome', 'https://use.fontawesome.com/releases/v5.6.3/css/all.css', array(), '5.6.3', 'all' );
     79        wp_enqueue_style( 'cc-slick', plugin_dir_url( __FILE__ ) . 'css/slick.css', array(), $this->version, 'all' );
     80        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/caddy-public.css', array( 'cc-fontawesome' ), $this->version, 'all' );
     81        wp_enqueue_style( 'cc-public-font', plugin_dir_url( __FILE__ ) . 'css/caddy-public-fonts.css', array(), $this->version, 'all' );
     82        wp_enqueue_style( 'cc-icons', plugin_dir_url( __FILE__ ) . 'css/caddy-icons.css', array(), $this->version, 'all' );
     83
    7184    }
    7285
     
    8194            return;
    8295        }
    83         if ( ! is_checkout() ) { // Not load on the checkout page
    84             if ( ! wp_script_is( 'jquery' ) ) {
    85                 wp_enqueue_script( 'jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js' );
    86             }
    87             //wp_enqueue_script( 'jquery-ui-tabs' );
    88             wp_enqueue_script( 'cc-tabby-js', plugin_dir_url( __FILE__ ) . 'js/tabby.js', array( 'jquery' ), $this->version, true );
    89             wp_enqueue_script( 'cc-tabby-polyfills-js', plugin_dir_url( __FILE__ ) . 'js/tabby.polyfills.min.js', array( 'jquery' ), $this->version, true );
    90             wp_enqueue_script( 'cc-slick-js', plugin_dir_url( __FILE__ ) . 'js/slick.min.js', array( 'jquery' ), $this->version, true );
    91             wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/caddy-public.js', array( 'jquery' ), null, true );
    92 
    93             // make the ajaxurl var available to the above script
    94             $params = array(
    95                 'ajaxurl'            => admin_url( 'admin-ajax.php' ),
    96                 'wc_currency_symbol' => get_woocommerce_currency_symbol(),
    97                 'nonce'              => wp_create_nonce( 'caddy' ),
    98                 'wc_archive_page'    => ( is_shop() || is_product_category() || is_product_tag() ) ? true : false,
    99                 'is_mobile'          => wp_is_mobile(),
    100             );
    101             wp_localize_script( $this->plugin_name, 'cc_ajax_script', $params );
    102         }
     96        if ( is_checkout() ) {
     97            $caddy                         = new Caddy();
     98            $cc_premium_license_activation = $caddy->cc_check_premium_license_activation();
     99            if ( $cc_premium_license_activation ) {
     100                $cc_enable_on_checkout_page = get_option( 'cc_enable_on_checkout_page' );
     101                if ( 'enabled' !== $cc_enable_on_checkout_page ) {
     102                    return;
     103                }
     104            } else {
     105                return;
     106            }
     107        }
     108
     109        if ( ! wp_script_is( 'jquery' ) ) {
     110            wp_enqueue_script( 'jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js' );
     111        }
     112        //wp_enqueue_script( 'jquery-ui-tabs' );
     113        wp_enqueue_script( 'cc-tabby-js', plugin_dir_url( __FILE__ ) . 'js/tabby.js', array( 'jquery' ), $this->version, true );
     114        wp_enqueue_script( 'cc-tabby-polyfills-js', plugin_dir_url( __FILE__ ) . 'js/tabby.polyfills.min.js', array( 'jquery' ), $this->version, true );
     115        wp_enqueue_script( 'cc-slick-js', plugin_dir_url( __FILE__ ) . 'js/slick.min.js', array( 'jquery' ), $this->version, true );
     116        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/caddy-public.js', array( 'jquery' ), null, true );
     117
     118        // make the ajaxurl var available to the above script
     119        $params = array(
     120            'ajaxurl'            => admin_url( 'admin-ajax.php' ),
     121            'wc_currency_symbol' => get_woocommerce_currency_symbol(),
     122            'nonce'              => wp_create_nonce( 'caddy' ),
     123            'wc_archive_page'    => ( is_shop() || is_product_category() || is_product_tag() ) ? true : false,
     124            'is_mobile'          => wp_is_mobile(),
     125        );
     126        wp_localize_script( $this->plugin_name, 'cc_ajax_script', $params );
    103127    }
    104128
     
    111135            return;
    112136        }
    113         if ( ! is_checkout() ) { // Not load on the checkout page
    114             require_once( plugin_dir_path( __FILE__ ) . 'partials/caddy-public-display.php' );
    115         }
     137
     138        if ( is_checkout() ) {
     139            $caddy                         = new Caddy();
     140            $cc_premium_license_activation = $caddy->cc_check_premium_license_activation();
     141            if ( $cc_premium_license_activation ) {
     142                $cc_enable_on_checkout_page = get_option( 'cc_enable_on_checkout_page' );
     143                if ( 'enabled' !== $cc_enable_on_checkout_page ) {
     144                    return;
     145                }
     146            } else {
     147                return;
     148            }
     149        }
     150
     151        require_once( plugin_dir_path( __FILE__ ) . 'partials/caddy-public-display.php' );
    116152    }
    117153
     
    225261
    226262        return $fragments;
    227     }
    228 
    229     /**
    230      * Window screen template.
    231      */
    232     public function cc_window_screen() {
    233         include( plugin_dir_path( __FILE__ ) . 'partials/cc-window-screen.php' );
    234263    }
    235264
     
    339368
    340369        wp_die();
     370    }
     371
     372    /**
     373     * Window screen template.
     374     */
     375    public function cc_window_screen() {
     376        include( plugin_dir_path( __FILE__ ) . 'partials/cc-window-screen.php' );
    341377    }
    342378
     
    10891125
    10901126            $cc_shipping_country = get_option( 'cc_shipping_country' );
     1127            if ( 'GB' === $cc_shipping_country ) {
     1128                $cc_shipping_country = 'UK';
     1129            }
    10911130
    10921131            $cc_bar_active = ( $final_cart_subtotal >= $cc_free_shipping_amount ) ? ' cc-bar-active' : '';
     
    11971236                                </div>
    11981237                                <div class="cc_item_quantity_wrap">
    1199                                     <div class="cc_item_quantity_update cc_item_quantity_minus" data-type="minus">-</div>
    1200                                     <input type="text" readonly class="cc_item_quantity" data-product_id="<?php echo esc_attr( $product_id ); ?>"
    1201                                            data-key="<?php echo esc_attr( $cart_item_key ); ?>" value="<?php echo $cart_item['quantity']; ?>">
    1202                                     <div class="cc_item_quantity_update cc_item_quantity_plus<?php echo esc_attr( $plus_disable ); ?>" data-type="plus">+</div>
     1238                                    <?php if ( $_product->is_sold_individually() ) {
     1239                                        echo sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $cart_item_key );
     1240                                    } else { ?>
     1241                                        <div class="cc_item_quantity_update cc_item_quantity_minus" data-type="minus">-</div>
     1242                                        <input type="text" readonly class="cc_item_quantity" data-product_id="<?php echo esc_attr( $product_id ); ?>"
     1243                                               data-key="<?php echo esc_attr( $cart_item_key ); ?>" value="<?php echo $cart_item['quantity']; ?>">
     1244                                        <div class="cc_item_quantity_update cc_item_quantity_plus<?php echo esc_attr( $plus_disable ); ?>" data-type="plus">+</div>
     1245                                    <?php } ?>
    12031246                                </div>
    12041247                                <?php if ( is_user_logged_in() ) { ?>
  • caddy/trunk/public/css/caddy-public.css

    r2596417 r2656992  
    33 * included in this file.
    44 */
    5 
    6 /* ibm-plex-sans-regular - latin */
    7 @font-face {
    8     font-family: 'IBM Plex Sans';
    9     font-style: normal;
    10     font-weight: 400;
    11     src: url('../fonts/ibm-plex-sans-v7-latin-regular.eot'); /* IE9 Compat Modes */
    12     src: local('IBM Plex Sans'), local('IBMPlexSans'),
    13     url('../fonts/ibm-plex-sans-v7-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../fonts/ibm-plex-sans-v7-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ url('../fonts/ibm-plex-sans-v7-latin-regular.woff') format('woff'), /* Modern Browsers */ url('../fonts/ibm-plex-sans-v7-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('../fonts/ibm-plex-sans-v7-latin-regular.svg#IBMPlexSans') format('svg'); /* Legacy iOS */
    14 }
    15 
    16 /* ibm-plex-sans-600 - latin */
    17 @font-face {
    18     font-family: 'IBM Plex Sans';
    19     font-style: normal;
    20     font-weight: 600;
    21     src: url('../fonts/ibm-plex-sans-v7-latin-600.eot'); /* IE9 Compat Modes */
    22     src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
    23     url('../fonts/ibm-plex-sans-v7-latin-600.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../fonts/ibm-plex-sans-v7-latin-600.woff2') format('woff2'), /* Super Modern Browsers */ url('../fonts/ibm-plex-sans-v7-latin-600.woff') format('woff'), /* Modern Browsers */ url('../fonts/ibm-plex-sans-v7-latin-600.ttf') format('truetype'), /* Safari, Android, iOS */ url('../fonts/ibm-plex-sans-v7-latin-600.svg#IBMPlexSans') format('svg'); /* Legacy iOS */
    24 }
    255
    266.cc-window, .cc-compass-count, .cc-cart input, .cc_sfl_btn a.save_for_later_btn, .cc_move_to_cart_btn a.button, .slick-slide .single_add_to_cart_button, .slick-slide .button, .cc-coupon-form .cc-coupon-btn, .toast {
  • caddy/trunk/public/js/caddy-public.js

    r2576919 r2656992  
    117117
    118118            //If the product is not simple on the shop page.
    119             if ( $( this ).hasClass( 'product_type_variable' ) || $( this ).hasClass( 'product_type_bundle' ) ) {
     119            if ( $( this ).hasClass( 'product_type_variable' ) || $( this ).hasClass( 'product_type_bundle' ) ||
     120                $( this ).hasClass( 'product_type_external' ) ) {
    120121                var product_url = $( this ).attr( 'href' );
    121122                window.location = product_url;
  • caddy/trunk/public/partials/cc-cart-screen.php

    r2596417 r2656992  
    6666                </div>
    6767            <?php } ?>
     68
     69            <?php do_action( 'caddy_before_cart_items' ); ?>
    6870
    6971            <div class="cc-row cc-cart-items text-center">
     
    8284
    8385            </div>
     86
     87            <?php do_action( 'caddy_after_cart_items' ); ?>
    8488
    8589            <?php
  • caddy/trunk/public/partials/cc-product-recommendations-screen.php

    r2576919 r2656992  
    4444if ( ! empty( $upsells ) ) {
    4545    foreach ( $upsells as $upsell ) {
    46         $final_upsell_products[] = $upsell->get_id();
     46        $upsell_product_data   = wc_get_product( $upsell->get_id() );
     47        $upsell_product_status = $upsell_product_data->get_status();
     48        if ( 'draft' !== $upsell_product_status ) {
     49            $final_upsell_products[] = $upsell->get_id();
     50        }
    4751    }
    4852} else {
Note: See TracChangeset for help on using the changeset viewer.