Changeset 2656992
- Timestamp:
- 01/13/2022 06:56:27 AM (4 years ago)
- Location:
- caddy
- Files:
-
- 78 added
- 10 edited
-
tags/1.7.9 (added)
-
tags/1.7.9/LICENSE.txt (added)
-
tags/1.7.9/README.txt (added)
-
tags/1.7.9/admin (added)
-
tags/1.7.9/admin/class-caddy-admin.php (added)
-
tags/1.7.9/admin/css (added)
-
tags/1.7.9/admin/css/caddy-admin.css (added)
-
tags/1.7.9/admin/img (added)
-
tags/1.7.9/admin/img/caddy-logo.svg (added)
-
tags/1.7.9/admin/img/caddy-welcome.svg (added)
-
tags/1.7.9/admin/img/klaviyo-logo.jpg (added)
-
tags/1.7.9/admin/img/ls-logo.png (added)
-
tags/1.7.9/admin/index.php (added)
-
tags/1.7.9/admin/js (added)
-
tags/1.7.9/admin/js/caddy-admin.js (added)
-
tags/1.7.9/admin/partials (added)
-
tags/1.7.9/admin/partials/caddy-addons-page.php (added)
-
tags/1.7.9/admin/partials/caddy-admin-display.php (added)
-
tags/1.7.9/admin/partials/caddy-admin-settings-screen.php (added)
-
tags/1.7.9/admin/partials/caddy-admin-style-screen.php (added)
-
tags/1.7.9/caddy.php (added)
-
tags/1.7.9/includes (added)
-
tags/1.7.9/includes/class-caddy-activator.php (added)
-
tags/1.7.9/includes/class-caddy-cart-widget.php (added)
-
tags/1.7.9/includes/class-caddy-deactivator.php (added)
-
tags/1.7.9/includes/class-caddy-i18n.php (added)
-
tags/1.7.9/includes/class-caddy-loader.php (added)
-
tags/1.7.9/includes/class-caddy-saved-items-widget.php (added)
-
tags/1.7.9/includes/class-caddy.php (added)
-
tags/1.7.9/includes/index.php (added)
-
tags/1.7.9/index.php (added)
-
tags/1.7.9/languages (added)
-
tags/1.7.9/languages/caddy-es_ES.mo (added)
-
tags/1.7.9/languages/caddy-es_ES.po (added)
-
tags/1.7.9/languages/caddy-nl_NL.mo (added)
-
tags/1.7.9/languages/caddy-nl_NL.po (added)
-
tags/1.7.9/languages/caddy.pot (added)
-
tags/1.7.9/public (added)
-
tags/1.7.9/public/class-caddy-public.php (added)
-
tags/1.7.9/public/css (added)
-
tags/1.7.9/public/css/caddy-icons.css (added)
-
tags/1.7.9/public/css/caddy-public.css (added)
-
tags/1.7.9/public/css/slick.css (added)
-
tags/1.7.9/public/fonts (added)
-
tags/1.7.9/public/fonts/cc-public-icons.eot (added)
-
tags/1.7.9/public/fonts/cc-public-icons.svg (added)
-
tags/1.7.9/public/fonts/cc-public-icons.ttf (added)
-
tags/1.7.9/public/fonts/cc-public-icons.woff (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-600.eot (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-600.svg (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-600.ttf (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-600.woff (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-600.woff2 (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-regular.eot (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-regular.svg (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-regular.ttf (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-regular.woff (added)
-
tags/1.7.9/public/fonts/ibm-plex-sans-v7-latin-regular.woff2 (added)
-
tags/1.7.9/public/img (added)
-
tags/1.7.9/public/img/box-emoji.png (added)
-
tags/1.7.9/public/img/loading.gif (added)
-
tags/1.7.9/public/img/sparkles-emoji.png (added)
-
tags/1.7.9/public/img/voltage-emoji.png (added)
-
tags/1.7.9/public/index.php (added)
-
tags/1.7.9/public/js (added)
-
tags/1.7.9/public/js/caddy-public.js (added)
-
tags/1.7.9/public/js/slick.min.js (added)
-
tags/1.7.9/public/js/tabby.js (added)
-
tags/1.7.9/public/js/tabby.min.js (added)
-
tags/1.7.9/public/js/tabby.polyfills.min.js (added)
-
tags/1.7.9/public/partials (added)
-
tags/1.7.9/public/partials/caddy-public-display.php (added)
-
tags/1.7.9/public/partials/cc-cart-screen.php (added)
-
tags/1.7.9/public/partials/cc-product-recommendations-screen.php (added)
-
tags/1.7.9/public/partials/cc-sfl-screen.php (added)
-
tags/1.7.9/public/partials/cc-window-screen.php (added)
-
tags/1.7.9/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/caddy.php (modified) (2 diffs)
-
trunk/includes/class-caddy-cart-widget.php (modified) (2 diffs)
-
trunk/includes/class-caddy.php (modified) (3 diffs)
-
trunk/languages/caddy.pot (modified) (1 diff)
-
trunk/public/class-caddy-public.php (modified) (7 diffs)
-
trunk/public/css/caddy-public-fonts.css (added)
-
trunk/public/css/caddy-public.css (modified) (1 diff)
-
trunk/public/js/caddy-public.js (modified) (1 diff)
-
trunk/public/partials/cc-cart-screen.php (modified) (2 diffs)
-
trunk/public/partials/cc-product-recommendations-screen.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
caddy/trunk/README.txt
r2596417 r2656992 5 5 Tags: caddy, woocommerce, woo, cart, side cart, sticky cart, cart notices, popup cart, woocommerce cart, shopping cart, mini-cart, floating cart 6 6 Requires at least: 5.0 7 Tested up to: 5.8. 17 Tested up to: 5.8.3 8 8 Requires PHP: 7.0 9 Stable tag: v1. 7.99 Stable tag: v1.8 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 94 94 95 95 == 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 96 107 97 108 = 1.7.9 = -
caddy/trunk/caddy.php
r2596417 r2656992 10 10 * Plugin URI: https://usecaddy.com 11 11 * 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.912 * Version: 1.8 13 13 * Author: Tribe Interactive 14 14 * Author URI: https://www.madebytribe.com … … 31 31 */ 32 32 if ( ! defined( 'CADDY_VERSION' ) ) { 33 define( 'CADDY_VERSION', '1. 7.9' );33 define( 'CADDY_VERSION', '1.8' ); 34 34 } 35 35 if ( ! defined( 'CADDY_PLUGIN_FILE' ) ) { -
caddy/trunk/includes/class-caddy-cart-widget.php
r2563235 r2656992 26 26 public function widget( $args, $instance ) { 27 27 $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 28 31 // before and after widget arguments are defined by themes 29 32 echo $args['before_widget']; … … 43 46 'javascript:void(0);', 44 47 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 ), 47 50 $cc_cart_class, 48 51 esc_html( $cart_count ) -
caddy/trunk/includes/class-caddy.php
r2596417 r2656992 169 169 170 170 /** 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 /** 171 192 * Register all of the hooks related to the public-facing functionality 172 193 * of the plugin. … … 295 316 296 317 /** 297 * The name of the plugin used to uniquely identify it within the context of298 * WordPress and to define internationalization functionality.299 *300 * @return string The name of the plugin.301 * @since 1.0.0302 */303 public function get_plugin_name() {304 return $this->plugin_name;305 }306 307 /**308 318 * The reference to the class that orchestrates the hooks with the plugin. 309 319 * … … 316 326 317 327 /** 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 } 325 346 } 326 347 -
caddy/trunk/languages/caddy.pot
r2596417 r2656992 3 3 msgid "" 4 4 msgstr "" 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" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/caddy\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
caddy/trunk/public/class-caddy-public.php
r2596417 r2656992 63 63 public function enqueue_styles() { 64 64 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 71 84 } 72 85 … … 81 94 return; 82 95 } 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 ); 103 127 } 104 128 … … 111 135 return; 112 136 } 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' ); 116 152 } 117 153 … … 225 261 226 262 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' );234 263 } 235 264 … … 339 368 340 369 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' ); 341 377 } 342 378 … … 1089 1125 1090 1126 $cc_shipping_country = get_option( 'cc_shipping_country' ); 1127 if ( 'GB' === $cc_shipping_country ) { 1128 $cc_shipping_country = 'UK'; 1129 } 1091 1130 1092 1131 $cc_bar_active = ( $final_cart_subtotal >= $cc_free_shipping_amount ) ? ' cc-bar-active' : ''; … … 1197 1236 </div> 1198 1237 <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 } ?> 1203 1246 </div> 1204 1247 <?php if ( is_user_logged_in() ) { ?> -
caddy/trunk/public/css/caddy-public.css
r2596417 r2656992 3 3 * included in this file. 4 4 */ 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 }25 5 26 6 .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 117 117 118 118 //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' ) ) { 120 121 var product_url = $( this ).attr( 'href' ); 121 122 window.location = product_url; -
caddy/trunk/public/partials/cc-cart-screen.php
r2596417 r2656992 66 66 </div> 67 67 <?php } ?> 68 69 <?php do_action( 'caddy_before_cart_items' ); ?> 68 70 69 71 <div class="cc-row cc-cart-items text-center"> … … 82 84 83 85 </div> 86 87 <?php do_action( 'caddy_after_cart_items' ); ?> 84 88 85 89 <?php -
caddy/trunk/public/partials/cc-product-recommendations-screen.php
r2576919 r2656992 44 44 if ( ! empty( $upsells ) ) { 45 45 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 } 47 51 } 48 52 } else {
Note: See TracChangeset
for help on using the changeset viewer.