WooCommerce Menu Cart - Version 2.10.0

Version Description

  • New: use minified JS & CSS files to reduce load time on live sites (enabling SCRIPT_DEBUG will load full versions)
  • Tested up to WooCommerce 5.7 & WP5.8
Download this release

Release Info

Developer wpovernight
Plugin Icon 128x128 WooCommerce Menu Cart
Version 2.10.0
Comparing to
See all releases

Code changes from version 2.9.8 to 2.10.0

assets/css/wpmenucart-font.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'WPMenuCart';
3
+ src: url('../fonts/WPMenuCart.eot');
4
+ src: url('../fonts/WPMenuCart.eot?#iefix') format('embedded-opentype'),
5
+ url('../fonts/WPMenuCart.woff2') format('woff2'),
6
+ url('../fonts/WPMenuCart.woff') format('woff'),
7
+ url('../fonts/WPMenuCart.ttf') format('truetype'),
8
+ url('../fonts/WPMenuCart.svg#WPMenuCart') format('svg');
9
+ font-weight: normal;
10
+ font-style: normal;
11
+ font-display: swap;
12
+ }
assets/css/wpmenucart-font.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @font-face{font-family:WPMenuCart;src:url(../fonts/WPMenuCart.eot);src:url(../fonts/WPMenuCart.eot?#iefix) format('embedded-opentype'),url(../fonts/WPMenuCart.woff2) format('woff2'),url(../fonts/WPMenuCart.woff) format('woff'),url(../fonts/WPMenuCart.ttf) format('truetype'),url(../fonts/WPMenuCart.svg#WPMenuCart) format('svg');font-weight:400;font-style:normal;font-display:swap}
assets/css/wpmenucart-icons.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wpmenucart-icon-shopping-cart-0:before {
2
+ font-family: 'WPMenuCart';
3
+ speak: none;
4
+ font-style: normal;
5
+ font-weight: normal;
6
+ display: inline;
7
+ width: auto;
8
+ height: auto;
9
+ line-height: normal;
10
+ text-decoration: inherit;
11
+ -webkit-font-smoothing: antialiased;
12
+ vertical-align: baseline;
13
+ background-image: none;
14
+ background-position: 0 0;
15
+ background-repeat: repeat;
16
+ margin-top: 0;
17
+ margin-right: 0.25em;
18
+ }
19
+
20
+ .wpmenucart-icon-shopping-cart-0:before{content:"\f07a"}
assets/css/wpmenucart-icons.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .wpmenucart-icon-shopping-cart-0:before{font-family:WPMenuCart;speak:none;font-style:normal;font-weight:400;display:inline;width:auto;height:auto;line-height:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0;margin-right:.25em}.wpmenucart-icon-shopping-cart-0:before{content:"\f07a"}
assets/css/wpmenucart-main.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .hidden-wpmenucart,
2
+ .empty-wpmenucart {
3
+ display: none !important;
4
+ }
5
+
6
+ .cartcontents + .amount:before {
7
+ content: '-';
8
+ margin: 0 0.25em;
9
+ }
10
+
11
+ .wpmenucart-display-standard {
12
+
13
+ }
14
+ .wpmenucart-display-right {
15
+ float: right !important;
16
+ }
17
+ .wpmenucart-display-left {
18
+ float: left !important;
19
+ }
20
+ .wpmenucart-icon-shopping-cart {
21
+ background-image: none;
22
+ vertical-align: inherit;
23
+ }
24
+
25
+ .wpmenucart-thumbnail img {
26
+ width: 32px;
27
+ height: auto;
28
+ margin-right: 8px;
29
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3);
30
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3);
31
+ -moz-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3);
32
+ }
33
+
34
+ .wpmenucart-submenu-item a {
35
+ overflow: hidden;
36
+ white-space:nowrap !important;
37
+ }
38
+
39
+ .wpmenucart-thumbnail, .wpmenucart-order-item-info {
40
+ display:inline-block;
41
+ vertical-align:middle;
42
+ }
43
+
44
+ .wpmenucart-product-name, .wpmenucart-product-quantity-price {
45
+ display:block;
46
+ }
47
+
48
+ .wpmenucart .clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
49
+ .wpmenucart .clearfix {display: inline-block;}
50
+ /* Hides from IE-mac \*/
51
+ * html .wpmenucart .clearfix {height: 1%;}
52
+ .wpmenucart .clearfix {display: block;}
53
+ /* End hide from IE-mac */
54
+ /* Force Inline Display */
55
+ li.wpmenucartli a.wpmenucart-contents span{
56
+ display: inline-block !important;
57
+ }
assets/css/wpmenucart-main.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .empty-wpmenucart,.hidden-wpmenucart{display:none!important}.cartcontents+.amount:before{content:'-';margin:0 .25em}.wpmenucart-display-right{float:right!important}.wpmenucart-display-left{float:left!important}.wpmenucart-icon-shopping-cart{background-image:none;vertical-align:inherit}.wpmenucart-thumbnail img{width:32px;height:auto;margin-right:8px;box-shadow:0 1px 2px 0 rgba(0,0,0,.3);-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.3);-moz-box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.wpmenucart-submenu-item a{overflow:hidden;white-space:nowrap!important}.wpmenucart-order-item-info,.wpmenucart-thumbnail{display:inline-block;vertical-align:middle}.wpmenucart-product-name,.wpmenucart-product-quantity-price{display:block}.wpmenucart .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.wpmenucart .clearfix{display:inline-block}* html .wpmenucart .clearfix{height:1%}.wpmenucart .clearfix{display:block}li.wpmenucartli a.wpmenucart-contents span{display:inline-block!important}
assets/css/wpmenucart-twentyfourteen.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ @media screen and (min-width: 783px) {
2
+ .primary-navigation .nav-menu {
3
+ display: inline-table !important;
4
+ margin-bottom: -4px;
5
+ }
6
+ }
assets/css/wpmenucart-twentyfourteen.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @media screen and (min-width:783px){.primary-navigation .nav-menu{display:inline-table!important;margin-bottom:-4px}}
assets/css/wpmenucart-twentytwelve.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .main-navigation li {
2
+ line-height: 0 !important;
3
+ }
assets/css/wpmenucart-twentytwelve.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .main-navigation li{line-height:0!important}
assets/fonts/WPMenuCart.eot ADDED
Binary file
assets/fonts/WPMenuCart.svg ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
4
+ <metadata>
5
+ Created by FontForge 20190801 at Fri May 8 10:17:53 2020
6
+ By www-data
7
+ Copyright Dave Gandy 2016. All rights reserved.
8
+ </metadata>
9
+ <defs>
10
+ <font id="WPMenuCart" horiz-adv-x="896" >
11
+ <font-face
12
+ font-family="WPMenuCart"
13
+ font-weight="400"
14
+ font-stretch="normal"
15
+ units-per-em="1792"
16
+ panose-1="0 0 0 0 0 0 0 0 0 0"
17
+ ascent="1536"
18
+ descent="-256"
19
+ bbox="0 -256 1664 1536"
20
+ underline-thickness="50"
21
+ underline-position="-100"
22
+ unicode-range="U+0020-F07A"
23
+ />
24
+ <missing-glyph
25
+ d="M735 -256h-568v1792h568v-1792zM301 1416v-59h117v-67h-119v-59h298v59h-119v67h119v59h-296zM299 1185v-187h298v61h-119v126h-179zM418 1059h-60v65h60v-65zM299 950v-59h119v-66h-119v-60h179v126h119v59h-298zM538 842v-118h-239v-61h298v179h-59zM418 624v-100h60
26
+ v41h60v-84h-180v143h-59v-203h298v203h-179zM299 314v-203h298v203h-298zM538 170h-180v85h180v-85zM299 70v-59h126l-126 -84v-59h298v59h-183l125 84h58v59h-298z" />
27
+ <glyph glyph-name=".notdef"
28
+ d="M735 -256h-568v1792h568v-1792zM301 1416v-59h117v-67h-119v-59h298v59h-119v67h119v59h-296zM299 1185v-187h298v61h-119v126h-179zM418 1059h-60v65h60v-65zM299 950v-59h119v-66h-119v-60h179v126h119v59h-298zM538 842v-118h-239v-61h298v179h-59zM418 624v-100h60
29
+ v41h60v-84h-180v143h-59v-203h298v203h-179zM299 314v-203h298v203h-298zM538 170h-180v85h180v-85zM299 70v-59h126l-126 -84v-59h298v59h-183l125 84h58v59h-298z" />
30
+ <glyph glyph-name="space" unicode=" " horiz-adv-x="0"
31
+ />
32
+ <glyph glyph-name="uniF07A" unicode="&#xf07a;" horiz-adv-x="1664"
33
+ d="M602 90q38 -38 38 -90t-38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38zM1498 90q38 -38 38 -90t-38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38zM1664 1088v-512q0 -24 -16.5 -42.5t-40.5 -21.5l-1044 -122q13 -60 13 -70q0 -16 -24 -64h920q26 0 45 -19t19 -45
34
+ t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 11 8 31.5t16 36t21.5 40t15.5 29.5l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t19.5 -15.5t13 -24.5t8 -26t5.5 -29.5t4.5 -26h1201q26 0 45 -19t19 -45v0z" />
35
+ </font>
36
+ </defs></svg>
assets/fonts/WPMenuCart.ttf ADDED
Binary file
assets/fonts/WPMenuCart.woff ADDED
Binary file
assets/fonts/WPMenuCart.woff2 ADDED
Binary file
assets/images/cart-icon-1.png ADDED
Binary file
assets/images/cart-icon-10.png ADDED
Binary file
assets/images/cart-icon-11.png ADDED
Binary file
assets/images/cart-icon-12.png ADDED
Binary file
assets/images/cart-icon-13.png ADDED
Binary file
assets/images/cart-icon-2.png ADDED
Binary file
assets/images/cart-icon-3.png ADDED
Binary file
assets/images/cart-icon-4.png ADDED
Binary file
assets/images/cart-icon-5.png ADDED
Binary file
assets/images/cart-icon-6.png ADDED
Binary file
assets/images/cart-icon-7.png ADDED
Binary file
assets/images/cart-icon-8.png ADDED
Binary file
assets/images/cart-icon-9.png ADDED
Binary file
assets/images/wpo-helper.png ADDED
Binary file
assets/js/wpmenucart-ajax-assist.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This script is intended for sites with server side caching enabled - normally the classes in the menu would follow the cart state */
2
+ jQuery( function( $ ) {
3
+ /* Cart Hiding */
4
+ if ( typeof wpmenucart_ajax_assist.shop_plugin !== 'undefined' && wpmenucart_ajax_assist.shop_plugin.toLowerCase() == 'woocommerce' ) {
5
+ // update on page load
6
+ wpmenucart_update_menu_classes();
7
+ // update when cart is updated
8
+ $( document.body ).on( 'adding_to_cart added_to_cart updated_wc_div', wpmenucart_update_menu_classes );
9
+ }
10
+
11
+ function wpmenucart_update_menu_classes() {
12
+ if ( typeof window.Cookies !== 'undefined' ) { // WC3.0
13
+ items_in_cart = Cookies.get( 'woocommerce_items_in_cart' );
14
+ } else if ( typeof $.cookie !== 'undefined' && $.isFunction($.cookie) ){ // WC2.X
15
+ items_in_cart = $.cookie( 'woocommerce_items_in_cart' );
16
+ } else {
17
+ return; // no business here
18
+ }
19
+
20
+ if ( items_in_cart > 0 ) {
21
+ $('.empty-wpmenucart').removeClass('empty-wpmenucart');
22
+ } else if ( !(wpmenucart_ajax_assist.always_display) ) {
23
+ $('.wpmenucartli').addClass('empty-wpmenucart');
24
+ $('.wpmenucart-shortcode').addClass('empty-wpmenucart');
25
+ }
26
+ }
27
+ });
assets/js/wpmenucart-ajax-assist.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(a){function b(){if("undefined"!=typeof window.Cookies)items_in_cart=Cookies.get("woocommerce_items_in_cart");else if("undefined"!=typeof a.cookie&&a.isFunction(a.cookie))items_in_cart=a.cookie("woocommerce_items_in_cart");else return;0<items_in_cart?a(".empty-wpmenucart").removeClass("empty-wpmenucart"):!wpmenucart_ajax_assist.always_display&&(a(".wpmenucartli").addClass("empty-wpmenucart"),a(".wpmenucart-shortcode").addClass("empty-wpmenucart"))}"undefined"!=typeof wpmenucart_ajax_assist.shop_plugin&&"woocommerce"==wpmenucart_ajax_assist.shop_plugin.toLowerCase()&&(b(),a(document.body).on("adding_to_cart added_to_cart updated_wc_div",b))});
assets/js/wpmenucart-edd-ajax.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function( $ ) {
2
+ // reload when item is added or removed
3
+ $( document.body ).on( 'edd_cart_item_removed edd_cart_item_added', function( event, response ) {
4
+ var data = {
5
+ security: wpmenucart_ajax.nonce,
6
+ action: "wpmenucart_ajax",
7
+ };
8
+
9
+ xhr = $.ajax({
10
+ type: 'POST',
11
+ url: wpmenucart_ajax.ajaxurl,
12
+ data: data,
13
+ success: function( response ) {
14
+ $('.wpmenucartli').html( response );
15
+ $('div.wpmenucart-shortcode span.reload_shortcode').html( response );
16
+ }
17
+ });
18
+
19
+ // update empty class for menu item
20
+ if ( 'cart_quantity' in response && parseInt( response.cart_quantity ) > 0 ) {
21
+ $('.empty-wpmenucart').removeClass('empty-wpmenucart');
22
+ } else if ( !(wpmenucart_ajax.always_display) ) {
23
+ $('.wpmenucartli').addClass('empty-wpmenucart');
24
+ $('.wpmenucart-shortcode').addClass('empty-wpmenucart');
25
+ }
26
+ });
27
+ });
assets/js/wpmenucart-edd-ajax.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(a){a(document.body).on("edd_cart_item_removed edd_cart_item_added",function(b,c){var d={security:wpmenucart_ajax.nonce,action:"wpmenucart_ajax"};xhr=a.ajax({type:"POST",url:wpmenucart_ajax.ajaxurl,data:d,success:function(b){a(".wpmenucartli").html(b),a("div.wpmenucart-shortcode span.reload_shortcode").html(b)}}),"cart_quantity"in c&&0<parseInt(c.cart_quantity)?a(".empty-wpmenucart").removeClass("empty-wpmenucart"):!wpmenucart_ajax.always_display&&(a(".wpmenucartli").addClass("empty-wpmenucart"),a(".wpmenucart-shortcode").addClass("empty-wpmenucart"))})});
assets/js/wpmenucart.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JS for WPEC, EDD and eShop
3
+ *
4
+ * AJAX not working for you? Look for the (specific) class attached to your 'add to cart' button (example: YOURCLASS)
5
+ * The add it to the list of class selectors in the jQuery command:
6
+ * $(".edd-add-to-cart, .wpsc_buy_button, .eshopbutton, div.cartopt p label.update input#update, .YOURCLASS").on('click', function(){
7
+ *
8
+ */
9
+
10
+ jQuery( function( $ ) {
11
+ var buttons = [
12
+ ".edd-add-to-cart",
13
+ ".wpsc_buy_button",
14
+ ".eshopbutton",
15
+ "div.cartopt p label.update input#update",
16
+ ".add_to_cart_button",
17
+ ".woocommerce-cart input.minus",
18
+ ".cart_item a.remove",
19
+ "#order_review .opc_cart_item a.remove",
20
+ ".woocommerce-cart input.plus",
21
+ ".single_add_to_cart_button"
22
+ ];
23
+
24
+ var inputs = [
25
+ "input.edd-item-quantity"
26
+ ];
27
+
28
+ jQuery(document.body).on('click', buttons.join(','), function(){
29
+ WPMenucart_Timeout();
30
+ });
31
+
32
+ jQuery(document.body).on('change', inputs.join(','), function(){
33
+ WPMenucart_Timeout();
34
+ });
35
+
36
+ function WPMenucart_Timeout() {
37
+ setTimeout( WPMenucart_Load_AJAX, 1000);
38
+ }
39
+
40
+ function WPMenucart_Load_AJAX() {
41
+ var data = {
42
+ security: wpmenucart_ajax.nonce,
43
+ action: "wpmenucart_ajax",
44
+ };
45
+
46
+ xhr = $.ajax({
47
+ type: 'POST',
48
+ url: wpmenucart_ajax.ajaxurl,
49
+ data: data,
50
+ success: function( response ) {
51
+ $('.wpmenucartli').html( response );
52
+ }
53
+ });
54
+ }
55
+ });
assets/js/wpmenucart.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(function(a){function b(){setTimeout(c,1e3)}function c(){var b={security:wpmenucart_ajax.nonce,action:"wpmenucart_ajax"};xhr=a.ajax({type:"POST",url:wpmenucart_ajax.ajaxurl,data:b,success:function(b){a(".wpmenucartli").html(b)}})}jQuery(document.body).on("click",[".edd-add-to-cart",".wpsc_buy_button",".eshopbutton","div.cartopt p label.update input#update",".add_to_cart_button",".woocommerce-cart input.minus",".cart_item a.remove","#order_review .opc_cart_item a.remove",".woocommerce-cart input.plus",".single_add_to_cart_button"].join(","),function(){b()}),jQuery(document.body).on("change",["input.edd-item-quantity"].join(","),function(){b()})});
includes/wpmenucart-settings.php CHANGED
@@ -323,8 +323,9 @@ class WpMenuCart_Settings {
323
  * Styles for settings page
324
  */
325
  public function wpmenucart_admin_styles() {
326
- wp_enqueue_style( 'wpmenucart-admin', plugins_url( 'css/wpmenucart-icons.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
327
- wp_enqueue_style( 'wpmenucart-font', plugins_url( '/css/wpmenucart-font.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
 
328
  }
329
 
330
  /**
@@ -437,7 +438,7 @@ class WpMenuCart_Settings {
437
  </ul>
438
  </div>
439
  <div class="menucart-pro-ad menucart-pro-ad-big">
440
- <img src="<?php echo plugins_url( 'images/', dirname(__FILE__) ) . 'wpo-helper.png'; ?>" class="wpo-helper">
441
  <h2><?php _e('Sell In Style With Menu Cart Pro!', 'wp-menu-cart' ) ?></h2>
442
  <br>
443
  <?php _e('Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:', 'wp-menu-cart' ) ?>
@@ -715,7 +716,7 @@ class WpMenuCart_Settings {
715
  $icons .= sprintf( '<td style="padding-bottom:0;font-size:16pt;" align="center"><label for="%1$s[%2$s][%3$s]"><i class="wpmenucart-icon-shopping-cart-%4$s"></i></label></td>', $menu, $id, $key, $iconnumber);
716
  $radios .= sprintf( '<td style="padding-top:0" align="center"><input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s /></td>', $menu, $id, $key, checked( $current, $key, false ) );
717
  } else {
718
- $icons .= sprintf( '<td style="padding-bottom:0;font-size:16pt;" align="center"><label for="%1$s[%2$s][%3$s]"><img src="%4$scart-icon-%5$s.png" /></label></td>', $menu, $id, $key, plugins_url( 'images/', dirname(__FILE__) ), $iconnumber);
719
  $radio = sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" disabled />', $menu, $id, $key);
720
  $radio .= '<div style="position:absolute; left:0; right:0; top:0; bottom:0; background-color:white; -moz-opacity: 0; opacity:0;filter: alpha(opacity=0);" class="hidden-input-icon"></div>';
721
  $radio = '<div style="display:inline-block; position:relative;">'.$radio.'</div>';
323
  * Styles for settings page
324
  */
325
  public function wpmenucart_admin_styles() {
326
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
327
+ wp_enqueue_style( 'wpmenucart-admin', plugins_url( '/assets/css/wpmenucart-icons'.$suffix.'.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
328
+ wp_enqueue_style( 'wpmenucart-font', plugins_url( '/assets/css/wpmenucart-font'.$suffix.'.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
329
  }
330
 
331
  /**
438
  </ul>
439
  </div>
440
  <div class="menucart-pro-ad menucart-pro-ad-big">
441
+ <img src="<?php echo plugins_url( 'assets/images/', dirname(__FILE__) ) . 'wpo-helper.png'; ?>" class="wpo-helper">
442
  <h2><?php _e('Sell In Style With Menu Cart Pro!', 'wp-menu-cart' ) ?></h2>
443
  <br>
444
  <?php _e('Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:', 'wp-menu-cart' ) ?>
716
  $icons .= sprintf( '<td style="padding-bottom:0;font-size:16pt;" align="center"><label for="%1$s[%2$s][%3$s]"><i class="wpmenucart-icon-shopping-cart-%4$s"></i></label></td>', $menu, $id, $key, $iconnumber);
717
  $radios .= sprintf( '<td style="padding-top:0" align="center"><input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s /></td>', $menu, $id, $key, checked( $current, $key, false ) );
718
  } else {
719
+ $icons .= sprintf( '<td style="padding-bottom:0;font-size:16pt;" align="center"><label for="%1$s[%2$s][%3$s]"><img src="%4$scart-icon-%5$s.png" /></label></td>', $menu, $id, $key, plugins_url( 'assets/images/', dirname(__FILE__) ), $iconnumber);
720
  $radio = sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" disabled />', $menu, $id, $key);
721
  $radio .= '<div style="position:absolute; left:0; right:0; top:0; bottom:0; background-color:white; -moz-opacity: 0; opacity:0;filter: alpha(opacity=0);" class="hidden-input-icon"></div>';
722
  $radio = '<div style="display:inline-block; position:relative;">'.$radio.'</div>';
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: jprummer, pomegranate
3
  Donate link: https://www.wpovernight.com/
4
  Tags: woocommerce, menu, bar, cart, basket, header, shopping cart, navigation, edd, ecommerce, eshop, wp-ecommerce, jigoshop, wpec
5
  Requires at least: 3.4
6
- Tested up to: 5.7
7
  Requires PHP: 5.3
8
- Stable tag: 2.9.8
9
 
10
  Automatically displays a shopping cart in your menu bar. Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop
11
 
@@ -85,6 +85,10 @@ Once the plugin is activated navigate to Settings > Menu Cart Setup. Select your
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  = 2.9.8 =
89
  * Fix: Don't load free version if Pro version is loaded/installed
90
  * Fix: jQuery deprecation notices
3
  Donate link: https://www.wpovernight.com/
4
  Tags: woocommerce, menu, bar, cart, basket, header, shopping cart, navigation, edd, ecommerce, eshop, wp-ecommerce, jigoshop, wpec
5
  Requires at least: 3.4
6
+ Tested up to: 5.8
7
  Requires PHP: 5.3
8
+ Stable tag: 2.10.0
9
 
10
  Automatically displays a shopping cart in your menu bar. Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop
11
 
85
 
86
  == Changelog ==
87
 
88
+ = 2.10.0 =
89
+ * New: use minified JS & CSS files to reduce load time on live sites (enabling `SCRIPT_DEBUG` will load full versions)
90
+ * Tested up to WooCommerce 5.7 & WP5.8
91
+
92
  = 2.9.8 =
93
  * Fix: Don't load free version if Pro version is loaded/installed
94
  * Fix: jQuery deprecation notices
wp-menu-cart.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: WooCommerce Menu Cart
4
  * Plugin URI: https://wpovernight.com/
5
  * Description: Extension for your e-commerce plugin (WooCommerce, WP-Ecommerce, Easy Digital Downloads, Eshop or Jigoshop) that places a cart icon with number of items and total cost in the menu bar. Activate the plugin, set your options and you're ready to go! Will automatically conform to your theme styles.
6
- * Version: 2.9.8
7
  * Author: Jeremiah Prummer, Ewout Fernhout
8
  * Author URI: https://wpovernight.com/
9
  * License: GPLv2 or later
10
  * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  * Text Domain: wp-menu-cart
12
  * WC requires at least: 2.0.0
13
- * WC tested up to: 5.4.0
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
@@ -21,7 +21,7 @@ if ( ! class_exists( 'WpMenuCart' ) && ! class_exists( 'WPO_Menu_Cart_Pro' ) ) :
21
 
22
  class WpMenuCart {
23
 
24
- protected $plugin_version = '2.9.8';
25
  public static $plugin_slug;
26
  public static $plugin_basename;
27
 
@@ -337,9 +337,10 @@ class WpMenuCart {
337
  * Load custom ajax
338
  */
339
  public function load_custom_ajax() {
 
340
  wp_enqueue_script(
341
  'wpmenucart',
342
- plugins_url( '/javascript/wpmenucart.js' , __FILE__ ),
343
  array( 'jquery' ),
344
  WPMENUCART_VERSION,
345
  true
@@ -367,9 +368,10 @@ class WpMenuCart {
367
  * Load EDD ajax helper
368
  */
369
  public function load_edd_ajax() {
 
370
  wp_enqueue_script(
371
  'wpmenucart-edd-ajax',
372
- plugins_url( '/javascript/wpmenucart-edd-ajax.js', __FILE__ ),
373
  array( 'jquery' ),
374
  WPMENUCART_VERSION
375
  );
@@ -390,22 +392,25 @@ class WpMenuCart {
390
  * Load CSS
391
  */
392
  public function load_scripts_styles() {
 
 
393
  if (isset($this->options['icon_display'])) {
394
- wp_enqueue_style( 'wpmenucart-icons', plugins_url( '/css/wpmenucart-icons.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
395
 
396
  // in order to avoid issues with relative font paths, we parse the CSS file and print it inline
397
- // wp_enqueue_style( 'wpmenucart-font', plugins_url( '/css/wpmenucart-font.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
398
  ob_start();
399
- if ( file_exists( plugin_dir_path( __FILE__ ) . 'css/wpmenucart-font.css' ) ) {
400
- include( plugin_dir_path( __FILE__ ) . 'css/wpmenucart-font.css' ) ;
401
  }
402
- $font_css = str_replace( '../font', plugins_url( '/font', __FILE__ ), ob_get_clean() );
403
  wp_add_inline_style( 'wpmenucart-icons', $font_css );
404
  }
405
 
 
406
  $css = file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' )
407
  ? get_stylesheet_directory_uri() . '/wpmenucart-main.css'
408
- : plugins_url( '/css/wpmenucart-main.css', __FILE__ );
409
  wp_enqueue_style( 'wpmenucart', $css, array(), WPMENUCART_VERSION, 'all' );
410
 
411
  // Hide built-in theme carts
@@ -415,18 +420,18 @@ class WpMenuCart {
415
 
416
  //Load Stylesheet if twentytwelve is active
417
  if ( wp_get_theme() == 'Twenty Twelve' ) {
418
- wp_enqueue_style( 'wpmenucart-twentytwelve', plugins_url( '/css/wpmenucart-twentytwelve.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
419
  }
420
 
421
  //Load Stylesheet if twentyfourteen is active
422
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
423
- wp_enqueue_style( 'wpmenucart-twentyfourteen', plugins_url( '/css/wpmenucart-twentyfourteen.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
424
  }
425
 
426
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
427
  wp_enqueue_script(
428
  'wpmenucart-ajax-assist',
429
- plugins_url( '/javascript/wpmenucart-ajax-assist.js', __FILE__ ),
430
  array( 'jquery' ),
431
  WPMENUCART_VERSION
432
  );
3
  * Plugin Name: WooCommerce Menu Cart
4
  * Plugin URI: https://wpovernight.com/
5
  * Description: Extension for your e-commerce plugin (WooCommerce, WP-Ecommerce, Easy Digital Downloads, Eshop or Jigoshop) that places a cart icon with number of items and total cost in the menu bar. Activate the plugin, set your options and you're ready to go! Will automatically conform to your theme styles.
6
+ * Version: 2.10.0
7
  * Author: Jeremiah Prummer, Ewout Fernhout
8
  * Author URI: https://wpovernight.com/
9
  * License: GPLv2 or later
10
  * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  * Text Domain: wp-menu-cart
12
  * WC requires at least: 2.0.0
13
+ * WC tested up to: 5.7.0
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
21
 
22
  class WpMenuCart {
23
 
24
+ protected $plugin_version = '2.10.0';
25
  public static $plugin_slug;
26
  public static $plugin_basename;
27
 
337
  * Load custom ajax
338
  */
339
  public function load_custom_ajax() {
340
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
341
  wp_enqueue_script(
342
  'wpmenucart',
343
+ plugins_url( '/assets/js/wpmenucart'.$suffix.'.js' , __FILE__ ),
344
  array( 'jquery' ),
345
  WPMENUCART_VERSION,
346
  true
368
  * Load EDD ajax helper
369
  */
370
  public function load_edd_ajax() {
371
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
372
  wp_enqueue_script(
373
  'wpmenucart-edd-ajax',
374
+ plugins_url( '/assets/js/wpmenucart-edd-ajax'.$suffix.'.js', __FILE__ ),
375
  array( 'jquery' ),
376
  WPMENUCART_VERSION
377
  );
392
  * Load CSS
393
  */
394
  public function load_scripts_styles() {
395
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
396
+
397
  if (isset($this->options['icon_display'])) {
398
+ wp_enqueue_style( 'wpmenucart-icons', plugins_url( '/assets/css/wpmenucart-icons'.$suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
399
 
400
  // in order to avoid issues with relative font paths, we parse the CSS file and print it inline
401
+ // wp_enqueue_style( 'wpmenucart-font', plugins_url( '/assets/css/wpmenucart-font'.$suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
402
  ob_start();
403
+ if ( file_exists( plugin_dir_path( __FILE__ ) . 'assets/css/wpmenucart-font'.$suffix.'.css' ) ) {
404
+ include( plugin_dir_path( __FILE__ ) . 'assets/css/wpmenucart-font'.$suffix.'.css' ) ;
405
  }
406
+ $font_css = str_replace( '../fonts', plugins_url( '/assets/fonts', __FILE__ ), ob_get_clean() );
407
  wp_add_inline_style( 'wpmenucart-icons', $font_css );
408
  }
409
 
410
+ // Allow wpmenucart-main.css to be overriden via the theme
411
  $css = file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' )
412
  ? get_stylesheet_directory_uri() . '/wpmenucart-main.css'
413
+ : plugins_url( '/assets/css/wpmenucart-main'.$suffix.'.css', __FILE__ );
414
  wp_enqueue_style( 'wpmenucart', $css, array(), WPMENUCART_VERSION, 'all' );
415
 
416
  // Hide built-in theme carts
420
 
421
  //Load Stylesheet if twentytwelve is active
422
  if ( wp_get_theme() == 'Twenty Twelve' ) {
423
+ wp_enqueue_style( 'wpmenucart-twentytwelve', plugins_url( '/assets/css/wpmenucart-twentytwelve'.$suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
424
  }
425
 
426
  //Load Stylesheet if twentyfourteen is active
427
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
428
+ wp_enqueue_style( 'wpmenucart-twentyfourteen', plugins_url( '/assets/css/wpmenucart-twentyfourteen'.$suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
429
  }
430
 
431
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
432
  wp_enqueue_script(
433
  'wpmenucart-ajax-assist',
434
+ plugins_url( '/assets/js/wpmenucart-ajax-assist'.$suffix.'.js', __FILE__ ),
435
  array( 'jquery' ),
436
  WPMENUCART_VERSION
437
  );