WooCommerce Menu Cart - Version 2.12.1

Version Description

(2022-10-04) = * Renames plugin to comply with trademark rules * New: adds disabled setting for block themes, including documentation link * Fix: moves hide woocommerce notice code to the function * Fix: removes references to Jigoshop, WP Ecommerce and Eshop * Fix: loads ajax-assist script when 'Always display cart' is disabled * Fix: escapes HTML properly before echoing * Fix: deprecate usage of globals * Fix: missing menu notice style * Tested up to WooCommerce 6.9

Download this release

Release Info

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

Code changes from version 2.12.0 to 2.12.1

README.md CHANGED
@@ -1,5 +1,5 @@
1
  # WP Menu Cart
2
- ** Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop **
3
 
4
  If you are not a developer, please use the [WP Menu Cart support forum](http://wordpress.org/support/plugin/wp-menu-cart) on WordPress.org.
5
 
@@ -28,9 +28,6 @@ Compatibility:
28
 
29
  * WooCommerce
30
  * Easy Digital Downloads
31
- * Eshop
32
- * WP-Ecommerce
33
- * Jigoshop
34
 
35
  Translations:
36
 
1
  # WP Menu Cart
2
+ ** Works with WooCommerce and Easy Digital Downloads **
3
 
4
  If you are not a developer, please use the [WP Menu Cart support forum](http://wordpress.org/support/plugin/wp-menu-cart) on WordPress.org.
5
 
28
 
29
  * WooCommerce
30
  * Easy Digital Downloads
 
 
 
31
 
32
  Translations:
33
 
assets/js/wpmenucart.js CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- * JS for WPEC, EDD and eShop
3
  *
4
  * AJAX not working for you?
5
  * You can use our custom 'wpmenucart_update_cart_ajax' handle to trigger a refresh
@@ -17,8 +17,6 @@ jQuery( function( $ ) {
17
  let wpmenucart_ajax_timer;
18
  let buttons = [
19
  ".edd-add-to-cart",
20
- ".wpsc_buy_button",
21
- ".eshopbutton",
22
  "div.cartopt p label.update input#update",
23
  ".add_to_cart_button",
24
  ".woocommerce-cart input.minus",
1
  /*
2
+ * JS for WooCommerce and EDD
3
  *
4
  * AJAX not working for you?
5
  * You can use our custom 'wpmenucart_update_cart_ajax' handle to trigger a refresh
17
  let wpmenucart_ajax_timer;
18
  let buttons = [
19
  ".edd-add-to-cart",
 
 
20
  "div.cartopt p label.update input#update",
21
  ".add_to_cart_button",
22
  ".woocommerce-cart input.minus",
assets/js/wpmenucart.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){function b(){clearTimeout(d),d=setTimeout(c,1e3)}function c(){let 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)}})}let d;a(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",".emptycart"].join(","),function(){b()}),a(document.body).on("change",["input.edd-item-quantity"].join(","),function(){b()}),a(document).on("wpmenucart_update_cart_ajax",function(){b()})});
1
+ jQuery(function(a){function b(){clearTimeout(d),d=setTimeout(c,1e3)}function c(){let 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)}})}let d;a(document.body).on("click",[".edd-add-to-cart","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",".emptycart"].join(","),function(){b()}),a(document.body).on("change",["input.edd-item-quantity"].join(","),function(){b()}),a(document).on("wpmenucart_update_cart_ajax",function(){b()})});
includes/wpmenucart-settings.php CHANGED
@@ -46,6 +46,29 @@ class WpMenuCart_Settings {
46
  )
47
  );
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  if( $parent_theme = wp_get_theme(get_template()) ) {
50
  if (in_array($parent_theme->get('Name'), array('Storefront','Divi'))) {
51
  add_settings_field(
@@ -126,6 +149,7 @@ class WpMenuCart_Settings {
126
  'menu' => $option,
127
  'id' => 'flyout_display',
128
  'disabled' => true,
 
129
  )
130
  );
131
 
@@ -152,6 +176,7 @@ class WpMenuCart_Settings {
152
  '10' => '10',
153
  ),
154
  'disabled' => true,
 
155
  )
156
  );
157
 
@@ -248,6 +273,7 @@ class WpMenuCart_Settings {
248
  'menu' => $option,
249
  'id' => 'custom_class',
250
  'disabled' => true,
 
251
  )
252
  );
253
 
@@ -265,7 +291,7 @@ class WpMenuCart_Settings {
265
  );
266
  }
267
 
268
- if ( apply_filters( 'wpo_wpmenucart_enable_builtin_ajax_setting', ( class_exists( 'WooCommerce' ) && isset( $option_values['builtin_ajax'] ) ) || defined('JIGOSHOP_VERSION') || class_exists( 'Easy_Digital_Downloads' ) ) ) {
269
 
270
  add_settings_field(
271
  'builtin_ajax',
@@ -329,9 +355,8 @@ class WpMenuCart_Settings {
329
  * Styles for settings page
330
  */
331
  public function wpmenucart_admin_styles() {
332
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
333
- wp_enqueue_style( 'wpmenucart-admin', plugins_url( '/assets/css/wpmenucart-icons'.$suffix.'.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
334
- wp_enqueue_style( 'wpmenucart-font', plugins_url( '/assets/css/wpmenucart-font'.$suffix.'.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
335
  }
336
 
337
  /**
@@ -404,7 +429,7 @@ class WpMenuCart_Settings {
404
  if ( ! $this->get_menu_array() && ! WPO_Menu_Cart()->is_block_theme() ) {
405
  ?>
406
  <div class="notice notice-error">
407
- <?php _e( 'You need to create a menu before you can use Menu Cart. Go to <strong>Appearence > Menus</strong> and create menu to add the cart to.', 'wp-menu-cart' ); ?>
408
  </div>
409
  <?php
410
  }
@@ -423,7 +448,7 @@ class WpMenuCart_Settings {
423
  </ul>
424
  </div>
425
  <div class="menucart-pro-ad menucart-pro-ad-big">
426
- <img src="<?php echo plugins_url( 'assets/images/', dirname(__FILE__) ) . 'wpo-helper.png'; ?>" class="wpo-helper">
427
  <h2><?php _e('Sell In Style With Menu Cart Pro!', 'wp-menu-cart' ) ?></h2>
428
  <br>
429
  <?php _e('Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:', 'wp-menu-cart' ) ?>
@@ -489,8 +514,9 @@ class WpMenuCart_Settings {
489
  */
490
  public function text_element_callback( $args ) {
491
  $menu = $args['menu'];
492
- $id = $args['id'];
493
  $size = isset( $args['size'] ) ? $args['size'] : '25';
 
494
 
495
  $options = get_option( $menu );
496
 
@@ -500,16 +526,16 @@ class WpMenuCart_Settings {
500
  $current = isset( $args['default'] ) ? $args['default'] : '';
501
  }
502
 
503
- $disabled = (isset( $args['disabled'] )) ? ' disabled' : '';
504
- $html = sprintf( '<input type="text" id="%1$s" name="%2$s[%1$s]" value="%3$s" size="%4$s"%5$s/>', $id, $menu, $current, $size, $disabled );
505
 
506
  // Displays option description.
507
  if ( isset( $args['description'] ) ) {
508
- $html .= sprintf( '<p class="description">%s</p>', $args['description'] );
509
  }
510
 
511
- if (isset( $args['disabled'] )) {
512
- $html .= ' <span style="display:none;" class="pro-feature"><i>'. __('This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartcustomclass">Menu Cart Pro</a></i></span>';
513
  $html .= '<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"></div>';
514
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
515
  }
@@ -524,7 +550,8 @@ class WpMenuCart_Settings {
524
  */
525
  public function select_element_callback( $args ) {
526
  $menu = $args['menu'];
527
- $id = $args['id'];
 
528
 
529
  $options = get_option( $menu );
530
 
@@ -536,20 +563,20 @@ class WpMenuCart_Settings {
536
 
537
  $disabled = (isset( $args['disabled'] )) ? ' disabled' : '';
538
 
539
- $html = sprintf( '<select name="%1$s[%2$s]" id="%1$s[%2$s]"%3$s>', $menu, $id, $disabled );
540
  $html .= sprintf( '<option value="%s"%s>%s</option>', '0', selected( $current, '0', false ), '' );
541
 
542
  foreach ( $args['options'] as $key => $label ) {
543
- $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
544
  }
545
  $html .= sprintf( '</select>' );
546
 
547
  if ( isset( $args['description'] ) ) {
548
- $html .= sprintf( '<p class="description">%s</p>', $args['description'] );
549
  }
550
 
551
- if (isset( $args['disabled'] )) {
552
- $html .= ' <span style="display:none;" class="pro-feature"><i>'. __('This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
553
  $html .= '<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"></div>';
554
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
555
  }
@@ -579,19 +606,19 @@ class WpMenuCart_Settings {
579
 
580
  $disabled = ($x == 1) ? '' : ' disabled';
581
 
582
- $html .= sprintf( '<select name="%1$s[%2$s][%3$s]" id="%1$s[%2$s][%3$s]"%4$s>', $menu, $id, $x, $disabled);
583
  $html .= sprintf( '<option value="%s"%s>%s</option>', '0', selected( $current, '0', false ), '' );
584
 
585
  foreach ( (array) $args['options'] as $key => $label ) {
586
- $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), $label );
587
  }
588
  $html .= '</select>';
589
 
590
  if ( isset( $args['description'] ) ) {
591
- $html .= sprintf( '<p class="description">%s</p>', $args['description'] );
592
  }
593
  if ( $x > 1 ) {
594
- $html .= ' <span style="display:none;" class="pro-feature"><i>'. __('This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartmultiplemenus">Menu Cart Pro</a></i></span>';
595
  $html .= '<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"></div>';
596
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
597
  }
@@ -611,7 +638,8 @@ class WpMenuCart_Settings {
611
  */
612
  public function checkbox_element_callback( $args ) {
613
  $menu = $args['menu'];
614
- $id = $args['id'];
 
615
 
616
  $options = get_option( $menu );
617
 
@@ -622,15 +650,15 @@ class WpMenuCart_Settings {
622
  }
623
 
624
  $disabled = (isset( $args['disabled'] )) ? ' disabled' : '';
625
- $html = sprintf( '<input type="checkbox" id="%1$s" name="%2$s[%1$s]" value="1"%3$s %4$s/>', $id, $menu, checked( 1, $current, false ), $disabled );
626
 
627
  // Displays option description.
628
  if ( isset( $args['description'] ) ) {
629
- $html .= sprintf( '<p class="description">%s</p>', $args['description'] );
630
  }
631
 
632
- if (isset( $args['disabled'] )) {
633
- $html .= ' <span style="display:none;" class="pro-feature"><i>'. __('This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
634
  $html .= '<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"></div>';
635
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
636
  }
@@ -645,7 +673,8 @@ class WpMenuCart_Settings {
645
  */
646
  public function radio_element_callback( $args ) {
647
  $menu = $args['menu'];
648
- $id = $args['id'];
 
649
 
650
  $options = get_option( $menu );
651
 
@@ -657,17 +686,17 @@ class WpMenuCart_Settings {
657
 
658
  $html = '';
659
  foreach ( $args['options'] as $key => $label ) {
660
- $html .= sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s />', $menu, $id, $key, checked( $current, $key, false ) );
661
- $html .= sprintf( '<label for="%1$s[%2$s][%3$s]"> %4$s</label><br>', $menu, $id, $key, $label);
662
  }
663
 
664
  // Displays option description.
665
  if ( isset( $args['description'] ) ) {
666
- $html .= sprintf( '<p class="description">%s</p>', $args['description'] );
667
  }
668
 
669
- if (isset( $args['disabled'] )) {
670
- $html .= ' <span style="display:none;" class="pro-feature"><i>'. __('This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
671
  $html .= '<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"></div>';
672
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
673
  }
@@ -697,11 +726,11 @@ class WpMenuCart_Settings {
697
 
698
  foreach ( $args['options'] as $key => $iconnumber ) {
699
  if ($key == 0) {
700
- $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);
701
- $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 ) );
702
  } else {
703
- $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);
704
- $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);
705
  $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>';
706
  $radio = '<div style="display:inline-block; position:relative;">'.$radio.'</div>';
707
 
@@ -709,7 +738,7 @@ class WpMenuCart_Settings {
709
  }
710
  }
711
 
712
- $profeature = '<span style="display:none;" class="pro-icon"><i>'. __('Additional icons are only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucarticons">Menu Cart Pro</a></i></span>';
713
 
714
  $html = '<table><tr>'.$icons.'</tr><tr>'.$radios.'</tr></table>'.$profeature;
715
 
@@ -770,9 +799,9 @@ class WpMenuCart_Settings {
770
 
771
  ?>
772
  <p>
773
- <input value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" type="text" />
774
- <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" value="" />
775
- <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" title="<?php esc_attr_e('Menu Item', 'wp-menu-cart'); ?>" />
776
  </p>
777
 
778
  <p class="wpmenucart-meta-box" id="wpmenucart-meta-box">
46
  )
47
  );
48
 
49
+ if ( WPO_Menu_Cart()->is_block_theme() ) {
50
+ add_settings_field(
51
+ 'block_theme_enabled',
52
+ __( 'Current theme is block type', 'wp-menu-cart' ),
53
+ array( &$this, 'checkbox_element_callback' ),
54
+ $option,
55
+ 'plugin_settings',
56
+ array(
57
+ 'menu' => $option,
58
+ 'id' => 'block_theme_enabled',
59
+ 'disabled' => true,
60
+ 'pro' => false,
61
+ 'default' => 1,
62
+ 'description' => sprintf(
63
+ /* translators: 1. theme name, 2. here docs link */
64
+ __( 'Your current theme, %1$s, is a block theme, therefore, you need to configure the cart menu using the navigation block. Please follow the instructions to do it %2$s.', 'wp-menu-cart' ),
65
+ '<strong>'.WPO_Menu_Cart()->get_current_theme_name().'</strong>',
66
+ '<a href="https://docs.wpovernight.com/wp-menu-cart/cart-block/" target="_blank">'.__( 'here', 'wp-menu-cart' ).'</a>'
67
+ ),
68
+ )
69
+ );
70
+ }
71
+
72
  if( $parent_theme = wp_get_theme(get_template()) ) {
73
  if (in_array($parent_theme->get('Name'), array('Storefront','Divi'))) {
74
  add_settings_field(
149
  'menu' => $option,
150
  'id' => 'flyout_display',
151
  'disabled' => true,
152
+ 'pro' => true,
153
  )
154
  );
155
 
176
  '10' => '10',
177
  ),
178
  'disabled' => true,
179
+ 'pro' => true,
180
  )
181
  );
182
 
273
  'menu' => $option,
274
  'id' => 'custom_class',
275
  'disabled' => true,
276
+ 'pro' => true,
277
  )
278
  );
279
 
291
  );
292
  }
293
 
294
+ if ( apply_filters( 'wpo_wpmenucart_enable_builtin_ajax_setting', ( class_exists( 'WooCommerce' ) && isset( $option_values['builtin_ajax'] ) ) || class_exists( 'Easy_Digital_Downloads' ) ) ) {
295
 
296
  add_settings_field(
297
  'builtin_ajax',
355
  * Styles for settings page
356
  */
357
  public function wpmenucart_admin_styles() {
358
+ wp_enqueue_style( 'wpmenucart-admin', WPO_Menu_Cart()->plugin_url() . '/assets/css/wpmenucart-icons' . WPO_Menu_Cart()->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
359
+ wp_enqueue_style( 'wpmenucart-font', WPO_Menu_Cart()->plugin_url() . '/assets/css/wpmenucart-font' . WPO_Menu_Cart()->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
 
360
  }
361
 
362
  /**
429
  if ( ! $this->get_menu_array() && ! WPO_Menu_Cart()->is_block_theme() ) {
430
  ?>
431
  <div class="notice notice-error">
432
+ <p><?php _e( 'You need to create a menu before you can use Menu Cart. Go to <strong>Appearence > Menus</strong> and create menu to add the cart to.', 'wp-menu-cart' ); ?></p>
433
  </div>
434
  <?php
435
  }
448
  </ul>
449
  </div>
450
  <div class="menucart-pro-ad menucart-pro-ad-big">
451
+ <img src="<?php echo WPO_Menu_Cart()->plugin_url() . '/assets/images/wpo-helper.png'; ?>" class="wpo-helper">
452
  <h2><?php _e('Sell In Style With Menu Cart Pro!', 'wp-menu-cart' ) ?></h2>
453
  <br>
454
  <?php _e('Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:', 'wp-menu-cart' ) ?>
514
  */
515
  public function text_element_callback( $args ) {
516
  $menu = $args['menu'];
517
+ $id = $args['id'];
518
  $size = isset( $args['size'] ) ? $args['size'] : '25';
519
+ $pro = isset( $args['pro'] ) ? $args['pro'] : false;
520
 
521
  $options = get_option( $menu );
522
 
526
  $current = isset( $args['default'] ) ? $args['default'] : '';
527
  }
528
 
529
+ $disabled = ( isset( $args['disabled'] ) ) ? ' disabled' : '';
530
+ $html = sprintf( '<input type="text" id="%1$s" name="%2$s[%1$s]" value="%3$s" size="%4$s"%5$s/>', esc_attr( $id ), esc_attr( $menu ), esc_attr( $current ), esc_attr( $size ), esc_attr( $disabled ) );
531
 
532
  // Displays option description.
533
  if ( isset( $args['description'] ) ) {
534
+ $html .= sprintf( '<p class="description">%s</p>', wp_kses_post( $args['description'] ) );
535
  }
536
 
537
+ if ( isset( $args['disabled'] ) && $pro ) {
538
+ $html .= ' <span style="display:none;" class="pro-feature"><i>'. __( 'This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartcustomclass">Menu Cart Pro</a></i></span>';
539
  $html .= '<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"></div>';
540
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
541
  }
550
  */
551
  public function select_element_callback( $args ) {
552
  $menu = $args['menu'];
553
+ $id = $args['id'];
554
+ $pro = isset( $args['pro'] ) ? $args['pro'] : false;
555
 
556
  $options = get_option( $menu );
557
 
563
 
564
  $disabled = (isset( $args['disabled'] )) ? ' disabled' : '';
565
 
566
+ $html = sprintf( '<select name="%1$s[%2$s]" id="%1$s[%2$s]"%3$s>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $disabled ) );
567
  $html .= sprintf( '<option value="%s"%s>%s</option>', '0', selected( $current, '0', false ), '' );
568
 
569
  foreach ( $args['options'] as $key => $label ) {
570
+ $html .= sprintf( '<option value="%s"%s>%s</option>', esc_attr( $key ), selected( $current , $key, false ), esc_attr( $label ) );
571
  }
572
  $html .= sprintf( '</select>' );
573
 
574
  if ( isset( $args['description'] ) ) {
575
+ $html .= sprintf( '<p class="description">%s</p>', wp_kses_post( $args['description'] ) );
576
  }
577
 
578
+ if ( isset( $args['disabled'] ) && $pro ) {
579
+ $html .= ' <span style="display:none;" class="pro-feature"><i>'. __( 'This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
580
  $html .= '<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"></div>';
581
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
582
  }
606
 
607
  $disabled = ($x == 1) ? '' : ' disabled';
608
 
609
+ $html .= sprintf( '<select name="%1$s[%2$s][%3$s]" id="%1$s[%2$s][%3$s]"%4$s>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $x ), esc_attr( $disabled ) );
610
  $html .= sprintf( '<option value="%s"%s>%s</option>', '0', selected( $current, '0', false ), '' );
611
 
612
  foreach ( (array) $args['options'] as $key => $label ) {
613
+ $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $current, $key, false ), esc_attr( $label ) );
614
  }
615
  $html .= '</select>';
616
 
617
  if ( isset( $args['description'] ) ) {
618
+ $html .= sprintf( '<p class="description">%s</p>', wp_kses_post( $args['description'] ) );
619
  }
620
  if ( $x > 1 ) {
621
+ $html .= ' <span style="display:none;" class="pro-feature"><i>'. __( 'This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartmultiplemenus">Menu Cart Pro</a></i></span>';
622
  $html .= '<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"></div>';
623
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
624
  }
638
  */
639
  public function checkbox_element_callback( $args ) {
640
  $menu = $args['menu'];
641
+ $id = $args['id'];
642
+ $pro = isset( $args['pro'] ) ? $args['pro'] : false;
643
 
644
  $options = get_option( $menu );
645
 
650
  }
651
 
652
  $disabled = (isset( $args['disabled'] )) ? ' disabled' : '';
653
+ $html = sprintf( '<input type="checkbox" id="%1$s" name="%2$s[%1$s]" value="1"%3$s %4$s/>', esc_attr( $id ), esc_attr( $menu ), checked( 1, esc_attr( $current ), false ), esc_attr( $disabled ) );
654
 
655
  // Displays option description.
656
  if ( isset( $args['description'] ) ) {
657
+ $html .= sprintf( '<p class="description">%s</p>', wp_kses_post( $args['description'] ) );
658
  }
659
 
660
+ if ( isset( $args['disabled'] ) && $pro ) {
661
+ $html .= ' <span style="display:none;" class="pro-feature"><i>'. __( 'This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
662
  $html .= '<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"></div>';
663
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
664
  }
673
  */
674
  public function radio_element_callback( $args ) {
675
  $menu = $args['menu'];
676
+ $id = $args['id'];
677
+ $pro = isset( $args['pro'] ) ? $args['pro'] : false;
678
 
679
  $options = get_option( $menu );
680
 
686
 
687
  $html = '';
688
  foreach ( $args['options'] as $key => $label ) {
689
+ $html .= sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s />', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ), checked( esc_attr( $current ), esc_attr( $key ), false ) );
690
+ $html .= sprintf( '<label for="%1$s[%2$s][%3$s]"> %4$s</label><br>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ), esc_attr( $label ) );
691
  }
692
 
693
  // Displays option description.
694
  if ( isset( $args['description'] ) ) {
695
+ $html .= sprintf( '<p class="description">%s</p>', wp_kses_post( $args['description'] ) );
696
  }
697
 
698
+ if ( isset( $args['disabled'] ) && $pro ) {
699
+ $html .= ' <span style="display:none;" class="pro-feature"><i>'. __( 'This feature only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucartflyout">Menu Cart Pro</a></i></span>';
700
  $html .= '<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"></div>';
701
  $html = '<div style="display:inline-block; position:relative;">'.$html.'</div>';
702
  }
726
 
727
  foreach ( $args['options'] as $key => $iconnumber ) {
728
  if ($key == 0) {
729
+ $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>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ), esc_attr( $iconnumber ) );
730
+ $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>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ), checked( esc_attr( $current ), esc_attr( $key ), false ) );
731
  } else {
732
+ $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>', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ), WPO_Menu_Cart()->plugin_url() . '/assets/images/', esc_attr( $iconnumber ) );
733
+ $radio = sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" disabled />', esc_attr( $menu ), esc_attr( $id ), esc_attr( $key ) );
734
  $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>';
735
  $radio = '<div style="display:inline-block; position:relative;">'.$radio.'</div>';
736
 
738
  }
739
  }
740
 
741
+ $profeature = '<span style="display:none;" class="pro-icon"><i>'. __( 'Additional icons are only available in', 'wp-menu-cart' ) .' <a href="https://wpovernight.com/downloads/menu-cart-pro?utm_source=wordpress&utm_medium=menucartfree&utm_campaign=menucarticons">Menu Cart Pro</a></i></span>';
742
 
743
  $html = '<table><tr>'.$icons.'</tr><tr>'.$radios.'</tr></table>'.$profeature;
744
 
799
 
800
  ?>
801
  <p>
802
+ <input value="custom" name="menu-item[<?php echo esc_attr( $_nav_menu_placeholder ); ?>][menu-item-type]" type="text" />
803
+ <input id="custom-menu-item-url" name="menu-item[<?php echo esc_attr( $_nav_menu_placeholder ); ?>][menu-item-url]" type="text" value="" />
804
+ <input id="custom-menu-item-name" name="menu-item[<?php echo esc_attr( $_nav_menu_placeholder ); ?>][menu-item-title]" type="text" title="<?php esc_attr_e('Menu Item', 'wp-menu-cart'); ?>" />
805
  </p>
806
 
807
  <p class="wpmenucart-meta-box" id="wpmenucart-meta-box">
languages/wp-menu-cart.pot CHANGED
@@ -1,277 +1,292 @@
1
- # Copyright (C) 2021 Jeremiah Prummer, Ewout Fernhout
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP Menu Cart 2.10.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-menu-cart\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-10-22T18:01:05+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: wp-menu-cart\n"
16
 
17
  #. Plugin Name of the plugin
18
- #: includes/wpmenucart-settings.php:372
19
  msgid "WP Menu Cart"
20
  msgstr ""
21
 
22
  #. Plugin URI of the plugin
23
- #. Author URI of the plugin
24
- msgid "https://wpovernight.com/"
25
  msgstr ""
26
 
27
  #. Description of the plugin
28
- msgid "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."
29
  msgstr ""
30
 
31
  #. Author of the plugin
32
- msgid "Jeremiah Prummer, Ewout Fernhout"
33
  msgstr ""
34
 
35
- #: includes/wpmenucart-settings.php:27
 
 
 
 
36
  msgid "Plugin settings"
37
  msgstr ""
38
 
39
- #: includes/wpmenucart-settings.php:34
40
  msgid "Select which e-commerce plugin you would like Menu Cart to work with"
41
  msgstr ""
42
 
43
- #: includes/wpmenucart-settings.php:49
 
 
 
 
 
 
 
 
44
  msgid "Hide theme shopping cart icon"
45
  msgstr ""
46
 
47
- #: includes/wpmenucart-settings.php:63
48
  msgid "Select the menu(s) in which you want to display the Menu Cart"
49
  msgstr ""
50
 
51
- #: includes/wpmenucart-settings.php:76
52
  msgid "Always display cart, even if it's empty"
53
  msgstr ""
54
 
55
- #: includes/wpmenucart-settings.php:89
56
  msgid "Show on cart & checkout page"
57
  msgstr ""
58
 
59
- #: includes/wpmenucart-settings.php:96
60
  msgid "To avoid distracting your customers with duplicate information we do not display the menu cart item on the cart & checkout pages by default"
61
  msgstr ""
62
 
63
- #: includes/wpmenucart-settings.php:103
64
  msgid "Display shopping cart icon."
65
  msgstr ""
66
 
67
- #: includes/wpmenucart-settings.php:115
68
  msgid "Display cart contents in menu fly-out."
69
  msgstr ""
70
 
71
- #: includes/wpmenucart-settings.php:128
72
  msgid "Set maximum number of products to display in fly-out"
73
  msgstr ""
74
 
75
- #: includes/wpmenucart-settings.php:154
76
  msgid "Choose a cart icon."
77
  msgstr ""
78
 
79
- #: includes/wpmenucart-settings.php:183
80
  msgid "What would you like to display in the menu?"
81
  msgstr ""
82
 
83
- #: includes/wpmenucart-settings.php:191
84
  msgid "Items Only."
85
  msgstr ""
86
 
87
- #: includes/wpmenucart-settings.php:192
88
  msgid "Price Only."
89
  msgstr ""
90
 
91
- #: includes/wpmenucart-settings.php:193
92
  msgid "Both price and items."
93
  msgstr ""
94
 
95
- #: includes/wpmenucart-settings.php:200
96
  msgid "Select the alignment that looks best with your menu."
97
  msgstr ""
98
 
99
- #: includes/wpmenucart-settings.php:208
100
  msgid "Align Left."
101
  msgstr ""
102
 
103
- #: includes/wpmenucart-settings.php:209
104
  msgid "Align Right."
105
  msgstr ""
106
 
107
- #: includes/wpmenucart-settings.php:210
108
  msgid "Default Menu Alignment."
109
  msgstr ""
110
 
111
- #: includes/wpmenucart-settings.php:218
112
  msgid "Price to display"
113
  msgstr ""
114
 
115
- #: includes/wpmenucart-settings.php:226
116
  msgid "Cart total (including discounts)"
117
  msgstr ""
118
 
119
- #: includes/wpmenucart-settings.php:227
120
  msgid "Subtotal (total of products)"
121
  msgstr ""
122
 
123
- #: includes/wpmenucart-settings.php:228
124
  msgid "Checkout total (including discounts, fees & shipping)"
125
  msgstr ""
126
 
127
- #: includes/wpmenucart-settings.php:237
128
  msgid "Enter a custom CSS class (optional)"
129
  msgstr ""
130
 
131
- #: includes/wpmenucart-settings.php:251
132
  msgid "Use WPML String Translation"
133
  msgstr ""
134
 
135
- #: includes/wpmenucart-settings.php:266
136
  msgid "Use custom AJAX"
137
  msgstr ""
138
 
139
- #: includes/wpmenucart-settings.php:273
140
  msgid "Enable this option to use the custom AJAX / live update functions instead of the default ones from your shop plugin. Only use when you have issues with AJAX!"
141
  msgstr ""
142
 
143
- #: includes/wpmenucart-settings.php:304
144
  msgid "Menu Cart"
145
  msgstr ""
146
 
147
- #: includes/wpmenucart-settings.php:305
148
  msgid "Menu Cart Setup"
149
  msgstr ""
150
 
151
- #: includes/wpmenucart-settings.php:380
152
  msgid "You need to create a menu before you can use Menu Cart. Go to <strong>Appearence > Menus</strong> and create menu to add the cart to."
153
  msgstr ""
154
 
155
- #: includes/wpmenucart-settings.php:431
156
  msgid "Want To Stand Out?"
157
  msgstr ""
158
 
159
- #: includes/wpmenucart-settings.php:431
160
  msgid "Go Pro."
161
  msgstr ""
162
 
163
- #: includes/wpmenucart-settings.php:433
164
  msgid "Unlimited Menus"
165
  msgstr ""
166
 
167
- #: includes/wpmenucart-settings.php:434
168
  msgid "Choice of 14 icons"
169
  msgstr ""
170
 
171
- #: includes/wpmenucart-settings.php:435
172
  msgid "Packed with customization options"
173
  msgstr ""
174
 
175
- #: includes/wpmenucart-settings.php:436
176
  msgid "Access to Shortcode"
177
  msgstr ""
178
 
179
- #: includes/wpmenucart-settings.php:437
180
  msgid "Top Notch Support"
181
  msgstr ""
182
 
183
- #: includes/wpmenucart-settings.php:442
184
  msgid "Sell In Style With Menu Cart Pro!"
185
  msgstr ""
186
 
187
- #: includes/wpmenucart-settings.php:444
188
  msgid "Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:"
189
  msgstr ""
190
 
191
- #: includes/wpmenucart-settings.php:447
192
  msgid "A choice of over 10 cart icons"
193
  msgstr ""
194
 
195
- #: includes/wpmenucart-settings.php:448
196
  msgid "A fully featured cart details flyout"
197
  msgstr ""
198
 
199
- #: includes/wpmenucart-settings.php:449
200
  msgid "Ability to add cart + flyout to an <strong>unlimited</strong> amount of menus"
201
  msgstr ""
202
 
203
- #: includes/wpmenucart-settings.php:450
204
  msgid "Adjust the content & URLs via the settings"
205
  msgstr ""
206
 
207
- #: includes/wpmenucart-settings.php:451
208
  msgid "Enter custom styles and apply custom classes via the settings"
209
  msgstr ""
210
 
211
- #: includes/wpmenucart-settings.php:452
212
  msgid "WPML compatible"
213
  msgstr ""
214
 
215
- #: includes/wpmenucart-settings.php:453
216
  msgid "Automatic updates on any great new features"
217
  msgstr ""
218
 
219
- #: includes/wpmenucart-settings.php:454
220
  msgid "Put the cart anywhere with the [wpmenucart] shortcode"
221
  msgstr ""
222
 
223
  #. translators: 1,2: <a> tags
224
- #: includes/wpmenucart-settings.php:458
225
  msgid "Need to see more? %1$sClick here%2$s to check it out. Add a product to your cart and watch what happens!"
226
  msgstr ""
227
 
228
- #: includes/wpmenucart-settings.php:459
229
  msgid "Buy Now"
230
  msgstr ""
231
 
232
- #: includes/wpmenucart-settings.php:528
233
- #: includes/wpmenucart-settings.php:568
234
- #: includes/wpmenucart-settings.php:610
235
- #: includes/wpmenucart-settings.php:649
236
- #: includes/wpmenucart-settings.php:686
237
  msgid "This feature only available in"
238
  msgstr ""
239
 
240
- #: includes/wpmenucart-settings.php:728
241
  msgid "Additional icons are only available in"
242
  msgstr ""
243
 
244
- #: includes/wpmenucart-settings.php:791
245
  msgid "Menu Item"
246
  msgstr ""
247
 
248
- #: includes/wpmenucart-settings.php:796
249
  msgid "Add to Menu"
250
  msgstr ""
251
 
252
- #: wp-menu-cart.php:247
253
  msgid "WP Menu Cart could not detect an active shop plugin. Make sure you have activated at least one of the supported plugins."
254
  msgstr ""
255
 
256
- #: wp-menu-cart.php:248
257
  msgid "Hide this notice"
258
  msgstr ""
259
 
260
- #: wp-menu-cart.php:253
261
- msgid "An old version of WooCommerce Menu Cart is currently activated, you need to disable or uninstall it for WP Menu Cart to function properly"
262
  msgstr ""
263
 
264
- #: wp-menu-cart.php:600
265
  msgid "View your shopping cart"
266
  msgstr ""
267
 
268
- #: wp-menu-cart.php:601
269
  msgid "Start shopping"
270
  msgstr ""
271
 
272
  #. translators: item count
273
- #: wp-menu-cart.php:603
274
  msgid "%d item"
275
  msgid_plural "%d items"
276
  msgstr[0] ""
277
  msgstr[1] ""
 
 
 
 
1
+ # Copyright (C) 2022 WP Overnight
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP Menu Cart 2.12.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-menu-cart\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-10-04T11:48:09+02:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: wp-menu-cart\n"
16
 
17
  #. Plugin Name of the plugin
18
+ #: includes/wpmenucart-settings.php:404
19
  msgid "WP Menu Cart"
20
  msgstr ""
21
 
22
  #. Plugin URI of the plugin
23
+ msgid "https://wpovernight.com/downloads/menu-cart-pro/"
 
24
  msgstr ""
25
 
26
  #. Description of the plugin
27
+ msgid "Extension for your e-commerce plugin (WooCommerce or Easy Digital Downloads) 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."
28
  msgstr ""
29
 
30
  #. Author of the plugin
31
+ msgid "WP Overnight"
32
  msgstr ""
33
 
34
+ #. Author URI of the plugin
35
+ msgid "https://wpovernight.com/"
36
+ msgstr ""
37
+
38
+ #: includes/wpmenucart-settings.php:31
39
  msgid "Plugin settings"
40
  msgstr ""
41
 
42
+ #: includes/wpmenucart-settings.php:38
43
  msgid "Select which e-commerce plugin you would like Menu Cart to work with"
44
  msgstr ""
45
 
46
+ #: includes/wpmenucart-settings.php:52
47
+ msgid "Current theme is block type"
48
+ msgstr ""
49
+
50
+ #: includes/wpmenucart-settings.php:66
51
+ msgid "here"
52
+ msgstr ""
53
+
54
+ #: includes/wpmenucart-settings.php:76
55
  msgid "Hide theme shopping cart icon"
56
  msgstr ""
57
 
58
+ #: includes/wpmenucart-settings.php:91
59
  msgid "Select the menu(s) in which you want to display the Menu Cart"
60
  msgstr ""
61
 
62
+ #: includes/wpmenucart-settings.php:105
63
  msgid "Always display cart, even if it's empty"
64
  msgstr ""
65
 
66
+ #: includes/wpmenucart-settings.php:118
67
  msgid "Show on cart & checkout page"
68
  msgstr ""
69
 
70
+ #: includes/wpmenucart-settings.php:125
71
  msgid "To avoid distracting your customers with duplicate information we do not display the menu cart item on the cart & checkout pages by default"
72
  msgstr ""
73
 
74
+ #: includes/wpmenucart-settings.php:132
75
  msgid "Display shopping cart icon."
76
  msgstr ""
77
 
78
+ #: includes/wpmenucart-settings.php:144
79
  msgid "Display cart contents in menu fly-out."
80
  msgstr ""
81
 
82
+ #: includes/wpmenucart-settings.php:158
83
  msgid "Set maximum number of products to display in fly-out"
84
  msgstr ""
85
 
86
+ #: includes/wpmenucart-settings.php:185
87
  msgid "Choose a cart icon."
88
  msgstr ""
89
 
90
+ #: includes/wpmenucart-settings.php:214
91
  msgid "What would you like to display in the menu?"
92
  msgstr ""
93
 
94
+ #: includes/wpmenucart-settings.php:222
95
  msgid "Items Only."
96
  msgstr ""
97
 
98
+ #: includes/wpmenucart-settings.php:223
99
  msgid "Price Only."
100
  msgstr ""
101
 
102
+ #: includes/wpmenucart-settings.php:224
103
  msgid "Both price and items."
104
  msgstr ""
105
 
106
+ #: includes/wpmenucart-settings.php:231
107
  msgid "Select the alignment that looks best with your menu."
108
  msgstr ""
109
 
110
+ #: includes/wpmenucart-settings.php:239
111
  msgid "Align Left."
112
  msgstr ""
113
 
114
+ #: includes/wpmenucart-settings.php:240
115
  msgid "Align Right."
116
  msgstr ""
117
 
118
+ #: includes/wpmenucart-settings.php:241
119
  msgid "Default Menu Alignment."
120
  msgstr ""
121
 
122
+ #: includes/wpmenucart-settings.php:249
123
  msgid "Price to display"
124
  msgstr ""
125
 
126
+ #: includes/wpmenucart-settings.php:257
127
  msgid "Cart total (including discounts)"
128
  msgstr ""
129
 
130
+ #: includes/wpmenucart-settings.php:258
131
  msgid "Subtotal (total of products)"
132
  msgstr ""
133
 
134
+ #: includes/wpmenucart-settings.php:259
135
  msgid "Checkout total (including discounts, fees & shipping)"
136
  msgstr ""
137
 
138
+ #: includes/wpmenucart-settings.php:268
139
  msgid "Enter a custom CSS class (optional)"
140
  msgstr ""
141
 
142
+ #: includes/wpmenucart-settings.php:283
143
  msgid "Use WPML String Translation"
144
  msgstr ""
145
 
146
+ #: includes/wpmenucart-settings.php:298
147
  msgid "Use custom AJAX"
148
  msgstr ""
149
 
150
+ #: includes/wpmenucart-settings.php:305
151
  msgid "Enable this option to use the custom AJAX / live update functions instead of the default ones from your shop plugin. Only use when you have issues with AJAX!"
152
  msgstr ""
153
 
154
+ #: includes/wpmenucart-settings.php:336
155
  msgid "Menu Cart"
156
  msgstr ""
157
 
158
+ #: includes/wpmenucart-settings.php:337
159
  msgid "Menu Cart Setup"
160
  msgstr ""
161
 
162
+ #: includes/wpmenucart-settings.php:433
163
  msgid "You need to create a menu before you can use Menu Cart. Go to <strong>Appearence > Menus</strong> and create menu to add the cart to."
164
  msgstr ""
165
 
166
+ #: includes/wpmenucart-settings.php:442
167
  msgid "Want To Stand Out?"
168
  msgstr ""
169
 
170
+ #: includes/wpmenucart-settings.php:442
171
  msgid "Go Pro."
172
  msgstr ""
173
 
174
+ #: includes/wpmenucart-settings.php:444
175
  msgid "Unlimited Menus"
176
  msgstr ""
177
 
178
+ #: includes/wpmenucart-settings.php:445
179
  msgid "Choice of 14 icons"
180
  msgstr ""
181
 
182
+ #: includes/wpmenucart-settings.php:446
183
  msgid "Packed with customization options"
184
  msgstr ""
185
 
186
+ #: includes/wpmenucart-settings.php:447
187
  msgid "Access to Shortcode"
188
  msgstr ""
189
 
190
+ #: includes/wpmenucart-settings.php:448
191
  msgid "Top Notch Support"
192
  msgstr ""
193
 
194
+ #: includes/wpmenucart-settings.php:453
195
  msgid "Sell In Style With Menu Cart Pro!"
196
  msgstr ""
197
 
198
+ #: includes/wpmenucart-settings.php:455
199
  msgid "Go Pro with Menu Cart Pro. Includes all the great standard features found in this free version plus:"
200
  msgstr ""
201
 
202
+ #: includes/wpmenucart-settings.php:458
203
  msgid "A choice of over 10 cart icons"
204
  msgstr ""
205
 
206
+ #: includes/wpmenucart-settings.php:459
207
  msgid "A fully featured cart details flyout"
208
  msgstr ""
209
 
210
+ #: includes/wpmenucart-settings.php:460
211
  msgid "Ability to add cart + flyout to an <strong>unlimited</strong> amount of menus"
212
  msgstr ""
213
 
214
+ #: includes/wpmenucart-settings.php:461
215
  msgid "Adjust the content & URLs via the settings"
216
  msgstr ""
217
 
218
+ #: includes/wpmenucart-settings.php:462
219
  msgid "Enter custom styles and apply custom classes via the settings"
220
  msgstr ""
221
 
222
+ #: includes/wpmenucart-settings.php:463
223
  msgid "WPML compatible"
224
  msgstr ""
225
 
226
+ #: includes/wpmenucart-settings.php:464
227
  msgid "Automatic updates on any great new features"
228
  msgstr ""
229
 
230
+ #: includes/wpmenucart-settings.php:465
231
  msgid "Put the cart anywhere with the [wpmenucart] shortcode"
232
  msgstr ""
233
 
234
  #. translators: 1,2: <a> tags
235
+ #: includes/wpmenucart-settings.php:469
236
  msgid "Need to see more? %1$sClick here%2$s to check it out. Add a product to your cart and watch what happens!"
237
  msgstr ""
238
 
239
+ #: includes/wpmenucart-settings.php:470
240
  msgid "Buy Now"
241
  msgstr ""
242
 
243
+ #: includes/wpmenucart-settings.php:539
244
+ #: includes/wpmenucart-settings.php:580
245
+ #: includes/wpmenucart-settings.php:622
246
+ #: includes/wpmenucart-settings.php:662
247
+ #: includes/wpmenucart-settings.php:700
248
  msgid "This feature only available in"
249
  msgstr ""
250
 
251
+ #: includes/wpmenucart-settings.php:742
252
  msgid "Additional icons are only available in"
253
  msgstr ""
254
 
255
+ #: includes/wpmenucart-settings.php:805
256
  msgid "Menu Item"
257
  msgstr ""
258
 
259
+ #: includes/wpmenucart-settings.php:810
260
  msgid "Add to Menu"
261
  msgstr ""
262
 
263
+ #: wp-menu-cart.php:241
264
  msgid "WP Menu Cart could not detect an active shop plugin. Make sure you have activated at least one of the supported plugins."
265
  msgstr ""
266
 
267
+ #: wp-menu-cart.php:242
268
  msgid "Hide this notice"
269
  msgstr ""
270
 
271
+ #: wp-menu-cart.php:247
272
+ msgid "An old version of Menu Cart for WooCommerce is currently activated, you need to disable or uninstall it for WP Menu Cart to function properly"
273
  msgstr ""
274
 
275
+ #: wp-menu-cart.php:703
276
  msgid "View your shopping cart"
277
  msgstr ""
278
 
279
+ #: wp-menu-cart.php:704
280
  msgid "Start shopping"
281
  msgstr ""
282
 
283
  #. translators: item count
284
+ #: wp-menu-cart.php:706
285
  msgid "%d item"
286
  msgid_plural "%d items"
287
  msgstr[0] ""
288
  msgstr[1] ""
289
+
290
+ #: assets/js/wpmenucart-navigation-block.js:24
291
+ msgid "Cart"
292
+ msgstr ""
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
- === WooCommerce Menu Cart ===
2
  Contributors: pomegranate, jprummer, alexmigf, yordansoares, kluver, dpeyou
3
  Donate link: https://wpovernight.com/downloads/menu-cart-pro/
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: 6.0
7
  Requires PHP: 5.3
8
- Stable tag: 2.12.0
9
 
10
- Automatically displays a shopping cart in your menu bar. Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop
11
 
12
  == Description ==
13
 
14
- **Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop**
15
 
16
  This plugin installs a shopping cart button in the navigation bar. The plugin takes less than a minute to setup,
17
  and includes the following options:
@@ -40,9 +40,6 @@ Compatibility:
40
 
41
  * WooCommerce
42
  * Easy Digital Downloads
43
- * Eshop
44
- * WP-Ecommerce
45
- * Jigoshop
46
 
47
  Translations:
48
 
@@ -85,6 +82,17 @@ Once the plugin is activated navigate to Settings > Menu Cart Setup. Select your
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
 
 
 
 
 
88
  = 2.12.0 =
89
  * Security: escape URL in admin notice
90
  * Tweak: Settings styles & colors
1
+ === Menu Cart for WooCommerce ===
2
  Contributors: pomegranate, jprummer, alexmigf, yordansoares, kluver, dpeyou
3
  Donate link: https://wpovernight.com/downloads/menu-cart-pro/
4
+ Tags: woocommerce, menu, bar, cart, basket, header, shopping cart, navigation, edd, ecommerce
5
  Requires at least: 3.4
6
+ Tested up to: 6.1
7
  Requires PHP: 5.3
8
+ Stable tag: 2.12.1
9
 
10
+ Automatically displays a shopping cart in your menu bar. Works with WooCommerce and Easy Digital Downloads (EDD)
11
 
12
  == Description ==
13
 
14
+ ** Works with WooCommerce and Easy Digital Downloads (EDD) **
15
 
16
  This plugin installs a shopping cart button in the navigation bar. The plugin takes less than a minute to setup,
17
  and includes the following options:
40
 
41
  * WooCommerce
42
  * Easy Digital Downloads
 
 
 
43
 
44
  Translations:
45
 
82
 
83
  == Changelog ==
84
 
85
+ = 2.12.1 (2022-10-04) =
86
+ * Renames plugin to comply with trademark rules
87
+ * New: adds disabled setting for block themes, including documentation link
88
+ * Fix: moves hide woocommerce notice code to the function
89
+ * Fix: removes references to Jigoshop, WP Ecommerce and Eshop
90
+ * Fix: loads ajax-assist script when 'Always display cart' is disabled
91
+ * Fix: escapes HTML properly before echoing
92
+ * Fix: deprecate usage of globals
93
+ * Fix: missing menu notice style
94
+ * Tested up to WooCommerce 6.9
95
+
96
  = 2.12.0 =
97
  * Security: escape URL in admin notice
98
  * Tweak: Settings styles & colors
wp-menu-cart.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /**
3
- * Plugin Name: WooCommerce Menu Cart
4
- * Plugin URI: https://wpovernight.com/downloads/menu-cart-pro/
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.12.0
7
- * Author: WP Overnight
8
- * Author URI: https://wpovernight.com/
9
- * License: GPLv2 or later
10
- * License URI: https://opensource.org/licenses/gpl-license.php
11
- * Text Domain: wp-menu-cart
12
  * WC requires at least: 2.0.0
13
- * WC tested up to: 6.6
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.12.0';
25
  public $plugin_slug;
26
  public $plugin_basename;
27
  public $options;
@@ -109,21 +109,6 @@ class WpMenuCart {
109
  }
110
  }
111
  break;
112
- case 'jigoshop':
113
- include_once( 'includes/wpmenucart-jigoshop.php' );
114
- $this->shop = new WPMenuCart_Jigoshop();
115
- if ( !isset($this->options['builtin_ajax']) ) {
116
- add_filter( 'add_to_cart_fragments', array( &$this, 'woocommerce_ajax_fragments' ) );
117
- }
118
- break;
119
- case 'wp-e-commerce':
120
- include_once( 'includes/wpmenucart-wpec.php' );
121
- $this->shop = new WPMenuCart_WPEC();
122
- break;
123
- case 'eshop':
124
- include_once( 'includes/wpmenucart-eshop.php' );
125
- $this->shop = new WPMenuCart_eShop();
126
- break;
127
  case 'easy-digital-downloads':
128
  include_once( 'includes/wpmenucart-edd.php' );
129
  $this->shop = new WPMenuCart_EDD();
@@ -132,7 +117,7 @@ class WpMenuCart {
132
  }
133
  break;
134
  }
135
- if ( isset( $this->options['builtin_ajax'] ) || in_array( $this->options['shop_plugin'], array( 'WP e-Commerce', 'wp-e-commerce', 'eShop', 'eshop' ) ) ) {
136
  add_action( 'wp_enqueue_scripts', array( &$this, 'load_custom_ajax' ), 0 );
137
  }
138
 
@@ -183,15 +168,6 @@ class WpMenuCart {
183
  case 'easy-digital-downloads':
184
  return function_exists('EDD');
185
  break;
186
- case 'jigoshop':
187
- return class_exists('jigoshop_cart');
188
- break;
189
- case 'wp-e-commerce':
190
- return function_exists('wpsc_cart_item_count');
191
- break;
192
- case 'eshop':
193
- return !empty($GLOBALS['eshopoptions']);
194
- break;
195
  default:
196
  return false;
197
  break;
@@ -226,11 +202,8 @@ class WpMenuCart {
226
  $active_plugins = self::get_active_plugins();
227
 
228
  $shop_plugins = array (
229
- 'WooCommerce' => 'woocommerce/woocommerce.php',
230
- 'Jigoshop' => 'jigoshop/jigoshop.php',
231
- 'WP e-Commerce' => 'wp-e-commerce/wp-shopping-cart.php',
232
- 'eShop' => 'eshop/eshop.php',
233
- 'Easy Digital Downloads' => 'easy-digital-downloads/easy-digital-downloads.php',
234
  );
235
 
236
  // filter shop plugins & add shop names as keys
@@ -267,13 +240,20 @@ class WpMenuCart {
267
  public function need_shop() {
268
  $error = __( 'WP Menu Cart could not detect an active shop plugin. Make sure you have activated at least one of the supported plugins.' , 'wp-menu-cart' );
269
  $message = sprintf( '<div class="error"><p>%1$s <a href="%2$s">%3$s</a></p></div>', $error, esc_url( add_query_arg( 'hide_wpmenucart_shop_check', 'true' ) ), __( 'Hide this notice', 'wp-menu-cart' ) );
270
- echo $message;
 
 
 
 
 
 
 
271
  }
272
 
273
  public function woocommerce_version_active() {
274
- $error = __( 'An old version of WooCommerce Menu Cart is currently activated, you need to disable or uninstall it for WP Menu Cart to function properly' , 'wp-menu-cart' );
275
  $message = '<div class="error"><p>' . $error . '</p></div>';
276
- echo $message;
277
  }
278
 
279
  /**
@@ -360,7 +340,7 @@ class WpMenuCart {
360
  public function load_custom_ajax() {
361
  wp_enqueue_script(
362
  'wpmenucart',
363
- plugins_url( '/assets/js/wpmenucart'.$this->asset_suffix.'.js' , __FILE__ ),
364
  array( 'jquery' ),
365
  WPMENUCART_VERSION,
366
  true
@@ -390,7 +370,7 @@ class WpMenuCart {
390
  public function load_edd_ajax() {
391
  wp_enqueue_script(
392
  'wpmenucart-edd-ajax',
393
- plugins_url( '/assets/js/wpmenucart-edd-ajax'.$this->asset_suffix.'.js', __FILE__ ),
394
  array( 'jquery' ),
395
  WPMENUCART_VERSION
396
  );
@@ -411,10 +391,10 @@ class WpMenuCart {
411
  */
412
  public function get_parsed_font_css() {
413
  ob_start();
414
- if ( file_exists( plugin_dir_path( __FILE__ ) . 'assets/css/wpmenucart-font'.$this->asset_suffix.'.css' ) ) {
415
- include( plugin_dir_path( __FILE__ ) . 'assets/css/wpmenucart-font'.$this->asset_suffix.'.css' ) ;
416
  }
417
- $font_css = str_replace( '../fonts', plugins_url( '/assets/fonts', __FILE__ ), ob_get_clean() );
418
 
419
  return $font_css;
420
  }
@@ -423,7 +403,7 @@ class WpMenuCart {
423
  * Allow wpmenucart-main.css to be overriden via the theme
424
  */
425
  public function get_main_css_url() {
426
- return file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' ) ? get_stylesheet_directory_uri() . '/wpmenucart-main.css' : plugins_url( '/assets/css/wpmenucart-main'.$this->asset_suffix.'.css', __FILE__ );
427
  }
428
 
429
  /**
@@ -431,11 +411,11 @@ class WpMenuCart {
431
  */
432
  public function load_admin_assets() {
433
  if ( is_admin() && get_current_screen()->id == 'woocommerce_page_wpmenucart_options_page' ) {
434
- wp_enqueue_style( 'wpmenucart-settings-styles', plugins_url( '/assets/css/wpmenucart-settings'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION );
435
 
436
  wp_enqueue_script(
437
  'wpmenucart-settings-scripts',
438
- plugins_url( '/assets/js/wpmenucart-settings'.$this->asset_suffix.'.js', __FILE__ ),
439
  array( 'jquery' ),
440
  WPMENUCART_VERSION,
441
  true
@@ -448,7 +428,7 @@ class WpMenuCart {
448
  */
449
  public function load_frontend_assets() {
450
  if ( isset( $this->options['icon_display'] ) ) {
451
- wp_enqueue_style( 'wpmenucart-icons', plugins_url( '/assets/css/wpmenucart-icons'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
452
  wp_add_inline_style( 'wpmenucart-icons', $this->get_parsed_font_css() );
453
  }
454
 
@@ -461,34 +441,36 @@ class WpMenuCart {
461
 
462
  //Load Stylesheet if twentytwelve is active
463
  if ( wp_get_theme() == 'Twenty Twelve' ) {
464
- wp_enqueue_style( 'wpmenucart-twentytwelve', plugins_url( '/assets/css/wpmenucart-twentytwelve'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
465
  }
466
 
467
  //Load Stylesheet if twentyfourteen is active
468
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
469
- wp_enqueue_style( 'wpmenucart-twentyfourteen', plugins_url( '/assets/css/wpmenucart-twentyfourteen'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
470
  }
471
 
472
  //Load Stylesheet if twentyfourteen is active
473
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
474
- wp_enqueue_style( 'wpmenucart-twentyfourteen', plugins_url( '/assets/css/wpmenucart-twentyfourteen'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
475
  }
476
 
477
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
478
- wp_enqueue_script(
479
- 'wpmenucart-ajax-assist',
480
- plugins_url( '/assets/js/wpmenucart-ajax-assist'.$this->asset_suffix.'.js', __FILE__ ),
481
- array( 'jquery' ),
482
- WPMENUCART_VERSION
483
- );
484
- wp_localize_script(
485
- 'wpmenucart-ajax-assist',
486
- 'wpmenucart_ajax_assist',
487
- array(
488
- 'shop_plugin' => isset( $this->options['shop_plugin'] ) ? $this->options['shop_plugin'] : '',
489
- 'always_display' => isset( $this->options['always_display'] ) ? $this->options['always_display'] : '',
490
- )
491
- );
 
 
492
  }
493
 
494
  /**
@@ -509,7 +491,7 @@ class WpMenuCart {
509
  foreach ( $handles as $handle ) {
510
  $style = $wp_styles->query( $handle, 'registered' );
511
  if ( ! $style ) {
512
- $wp_styles->add( 'wpmenucart-icons', plugins_url( '/assets/css/wpmenucart-icons'.$this->asset_suffix.'.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
513
  $wp_styles->add( 'wpmenucart', $this->get_main_css_url(), array(), WPMENUCART_VERSION, 'all' );
514
  }
515
  if ( $wp_styles->query( $handle, 'registered' ) && ! in_array( $handle, $wp_edit_blocks->deps, true ) ) {
@@ -528,7 +510,7 @@ class WpMenuCart {
528
 
529
  wp_register_script(
530
  'wpmenucart-navigation-block',
531
- plugins_url( '/assets/js/wpmenucart-navigation-block'.$this->asset_suffix.'.js', __FILE__ ),
532
  array( 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-server-side-render' ),
533
  WPMENUCART_VERSION
534
  );
@@ -570,6 +552,14 @@ class WpMenuCart {
570
  return false;
571
  }
572
 
 
 
 
 
 
 
 
 
573
  /**
574
  * Add filters to selected menus to add cart item <li>
575
  */
@@ -781,19 +771,27 @@ class WpMenuCart {
781
  check_ajax_referer( 'wpmenucart', 'security' );
782
 
783
  $variable = $this->wpmenucart_menu_item();
784
- echo $variable;
785
  die();
786
  }
787
 
788
- }
 
 
 
 
 
 
789
 
790
- /**
791
- * Hide notifications
792
- */
 
 
 
 
793
 
794
- if ( ! empty( $_GET['hide_wpmenucart_shop_check'] ) ) {
795
- update_option( 'wpmenucart_shop_check', 'hide' );
796
- }
797
 
798
  endif; // class_exists
799
 
1
  <?php
2
  /**
3
+ * Plugin Name: WP Menu Cart
4
+ * Plugin URI: https://wpovernight.com/downloads/menu-cart-pro/
5
+ * Description: Extension for your e-commerce plugin (WooCommerce or Easy Digital Downloads) 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.12.1
7
+ * Author: WP Overnight
8
+ * Author URI: https://wpovernight.com/
9
+ * License: GPLv2 or later
10
+ * License URI: https://opensource.org/licenses/gpl-license.php
11
+ * Text Domain: wp-menu-cart
12
  * WC requires at least: 2.0.0
13
+ * WC tested up to: 6.9
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
21
 
22
  class WpMenuCart {
23
 
24
+ protected $plugin_version = '2.12.1';
25
  public $plugin_slug;
26
  public $plugin_basename;
27
  public $options;
109
  }
110
  }
111
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  case 'easy-digital-downloads':
113
  include_once( 'includes/wpmenucart-edd.php' );
114
  $this->shop = new WPMenuCart_EDD();
117
  }
118
  break;
119
  }
120
+ if ( isset( $this->options['builtin_ajax'] ) ) {
121
  add_action( 'wp_enqueue_scripts', array( &$this, 'load_custom_ajax' ), 0 );
122
  }
123
 
168
  case 'easy-digital-downloads':
169
  return function_exists('EDD');
170
  break;
 
 
 
 
 
 
 
 
 
171
  default:
172
  return false;
173
  break;
202
  $active_plugins = self::get_active_plugins();
203
 
204
  $shop_plugins = array (
205
+ 'WooCommerce' => 'woocommerce/woocommerce.php',
206
+ 'Easy Digital Downloads' => 'easy-digital-downloads/easy-digital-downloads.php',
 
 
 
207
  );
208
 
209
  // filter shop plugins & add shop names as keys
240
  public function need_shop() {
241
  $error = __( 'WP Menu Cart could not detect an active shop plugin. Make sure you have activated at least one of the supported plugins.' , 'wp-menu-cart' );
242
  $message = sprintf( '<div class="error"><p>%1$s <a href="%2$s">%3$s</a></p></div>', $error, esc_url( add_query_arg( 'hide_wpmenucart_shop_check', 'true' ) ), __( 'Hide this notice', 'wp-menu-cart' ) );
243
+ echo wp_kses_post( $message );
244
+
245
+ /**
246
+ * Hide notifications
247
+ */
248
+ if ( isset( $_GET['hide_wpmenucart_shop_check'] ) ) {
249
+ update_option( 'wpmenucart_shop_check', 'hide' );
250
+ }
251
  }
252
 
253
  public function woocommerce_version_active() {
254
+ $error = __( 'An old version of Menu Cart for WooCommerce is currently activated, you need to disable or uninstall it for WP Menu Cart to function properly' , 'wp-menu-cart' );
255
  $message = '<div class="error"><p>' . $error . '</p></div>';
256
+ echo wp_kses_post( $message );
257
  }
258
 
259
  /**
340
  public function load_custom_ajax() {
341
  wp_enqueue_script(
342
  'wpmenucart',
343
+ $this->plugin_url() . '/assets/js/wpmenucart' . $this->asset_suffix . '.js',
344
  array( 'jquery' ),
345
  WPMENUCART_VERSION,
346
  true
370
  public function load_edd_ajax() {
371
  wp_enqueue_script(
372
  'wpmenucart-edd-ajax',
373
+ $this->plugin_url() . '/assets/js/wpmenucart-edd-ajax' . $this->asset_suffix . '.js',
374
  array( 'jquery' ),
375
  WPMENUCART_VERSION
376
  );
391
  */
392
  public function get_parsed_font_css() {
393
  ob_start();
394
+ if ( file_exists( $this->plugin_path() . '/assets/css/wpmenucart-font' . $this->asset_suffix . '.css' ) ) {
395
+ include( $this->plugin_path() . '/assets/css/wpmenucart-font' . $this->asset_suffix . '.css' ) ;
396
  }
397
+ $font_css = str_replace( '../fonts', $this->plugin_url() . '/assets/fonts', ob_get_clean() );
398
 
399
  return $font_css;
400
  }
403
  * Allow wpmenucart-main.css to be overriden via the theme
404
  */
405
  public function get_main_css_url() {
406
+ return file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' ) ? get_stylesheet_directory_uri() . '/wpmenucart-main.css' : $this->plugin_url() . '/assets/css/wpmenucart-main' . $this->asset_suffix . '.css';
407
  }
408
 
409
  /**
411
  */
412
  public function load_admin_assets() {
413
  if ( is_admin() && get_current_screen()->id == 'woocommerce_page_wpmenucart_options_page' ) {
414
+ wp_enqueue_style( 'wpmenucart-settings-styles', $this->plugin_url() . '/assets/css/wpmenucart-settings' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION );
415
 
416
  wp_enqueue_script(
417
  'wpmenucart-settings-scripts',
418
+ $this->plugin_url() . '/assets/js/wpmenucart-settings' . $this->asset_suffix . '.js',
419
  array( 'jquery' ),
420
  WPMENUCART_VERSION,
421
  true
428
  */
429
  public function load_frontend_assets() {
430
  if ( isset( $this->options['icon_display'] ) ) {
431
+ wp_enqueue_style( 'wpmenucart-icons', $this->plugin_url() . '/assets/css/wpmenucart-icons' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
432
  wp_add_inline_style( 'wpmenucart-icons', $this->get_parsed_font_css() );
433
  }
434
 
441
 
442
  //Load Stylesheet if twentytwelve is active
443
  if ( wp_get_theme() == 'Twenty Twelve' ) {
444
+ wp_enqueue_style( 'wpmenucart-twentytwelve', $this->plugin_url() . '/assets/css/wpmenucart-twentytwelve' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
445
  }
446
 
447
  //Load Stylesheet if twentyfourteen is active
448
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
449
+ wp_enqueue_style( 'wpmenucart-twentyfourteen', $this->plugin_url() . '/assets/css/wpmenucart-twentyfourteen' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
450
  }
451
 
452
  //Load Stylesheet if twentyfourteen is active
453
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
454
+ wp_enqueue_style( 'wpmenucart-twentyfourteen', $this->plugin_url() . '/assets/css/wpmenucart-twentyfourteen' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
455
  }
456
 
457
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
458
+ if ( ! isset( $this->options['always_display'] ) ) {
459
+ wp_enqueue_script(
460
+ 'wpmenucart-ajax-assist',
461
+ $this->plugin_url() . '/assets/js/wpmenucart-ajax-assist' . $this->asset_suffix . '.js',
462
+ array( 'jquery' ),
463
+ WPMENUCART_VERSION
464
+ );
465
+ wp_localize_script(
466
+ 'wpmenucart-ajax-assist',
467
+ 'wpmenucart_ajax_assist',
468
+ array(
469
+ 'shop_plugin' => isset( $this->options['shop_plugin'] ) ? $this->options['shop_plugin'] : '',
470
+ 'always_display' => isset( $this->options['always_display'] ) ? $this->options['always_display'] : '',
471
+ )
472
+ );
473
+ }
474
  }
475
 
476
  /**
491
  foreach ( $handles as $handle ) {
492
  $style = $wp_styles->query( $handle, 'registered' );
493
  if ( ! $style ) {
494
+ $wp_styles->add( 'wpmenucart-icons', $this->plugin_url() . '/assets/css/wpmenucart-icons' . $this->asset_suffix . '.css', array(), WPMENUCART_VERSION, 'all' );
495
  $wp_styles->add( 'wpmenucart', $this->get_main_css_url(), array(), WPMENUCART_VERSION, 'all' );
496
  }
497
  if ( $wp_styles->query( $handle, 'registered' ) && ! in_array( $handle, $wp_edit_blocks->deps, true ) ) {
510
 
511
  wp_register_script(
512
  'wpmenucart-navigation-block',
513
+ $this->plugin_url() . '/assets/js/wpmenucart-navigation-block' . $this->asset_suffix . '.js',
514
  array( 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-server-side-render' ),
515
  WPMENUCART_VERSION
516
  );
552
  return false;
553
  }
554
 
555
+ public function get_current_theme_name() {
556
+ $theme = wp_get_theme();
557
+ if ( ! empty( $theme ) && is_callable( array( $theme, 'display' ) ) ) {
558
+ return $theme->display( 'Name' );
559
+ }
560
+ return false;
561
+ }
562
+
563
  /**
564
  * Add filters to selected menus to add cart item <li>
565
  */
771
  check_ajax_referer( 'wpmenucart', 'security' );
772
 
773
  $variable = $this->wpmenucart_menu_item();
774
+ echo wp_kses_post( $variable );
775
  die();
776
  }
777
 
778
+ /**
779
+ * Get the plugin url.
780
+ * @return string
781
+ */
782
+ public function plugin_url() {
783
+ return untrailingslashit( plugin_dir_url( __FILE__ ) );
784
+ }
785
 
786
+ /**
787
+ * Get the plugin path.
788
+ * @return string
789
+ */
790
+ public function plugin_path() {
791
+ return untrailingslashit( plugin_dir_path( __FILE__ ) );
792
+ }
793
 
794
+ } // end class
 
 
795
 
796
  endif; // class_exists
797