HT Mega – Addons for Elementor Page Builder ( Elementor Addons, Post Grid, Post Slider, Post Carousel, Mega Menu, Elementor Widgets, Elementor Templates, Accordion, Forms, Tables) - Version 1.6.9

Version Description

Download this release

Release Info

Developer devitemsllc
Plugin Icon 128x128 HT Mega – Addons for Elementor Page Builder ( Elementor Addons, Post Grid, Post Slider, Post Carousel, Mega Menu, Elementor Widgets, Elementor Templates, Accordion, Forms, Tables)
Version 1.6.9
Comparing to
See all releases

Code changes from version 1.6.8 to 1.6.9

htmega_addons_elementor.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: http://demo.wphash.com/htmega/
6
  * Author: HasThemes
7
  * Author URI: https://hasthemes.com/
8
- * Version: 1.6.8
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: htmega-addons
@@ -15,7 +15,7 @@
15
  */
16
 
17
  if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
18
- define( 'HTMEGA_VERSION', '1.6.8' );
19
  define( 'HTMEGA_ADDONS_PL_ROOT', __FILE__ );
20
  define( 'HTMEGA_ADDONS_PL_URL', plugins_url( '/', HTMEGA_ADDONS_PL_ROOT ) );
21
  define( 'HTMEGA_ADDONS_PL_PATH', plugin_dir_path( HTMEGA_ADDONS_PL_ROOT ) );
5
  * Plugin URI: http://demo.wphash.com/htmega/
6
  * Author: HasThemes
7
  * Author URI: https://hasthemes.com/
8
+ * Version: 1.6.9
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: htmega-addons
15
  */
16
 
17
  if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
18
+ define( 'HTMEGA_VERSION', '1.6.9' );
19
  define( 'HTMEGA_ADDONS_PL_ROOT', __FILE__ );
20
  define( 'HTMEGA_ADDONS_PL_URL', plugins_url( '/', HTMEGA_ADDONS_PL_ROOT ) );
21
  define( 'HTMEGA_ADDONS_PL_PATH', plugin_dir_path( HTMEGA_ADDONS_PL_ROOT ) );
includes/class.assests.php CHANGED
@@ -407,7 +407,7 @@ if ( !class_exists( 'HTMega_Elementor_Addons_Assests' ) ) {
407
  // JS
408
  wp_enqueue_script( 'htmega-popper' );
409
  wp_enqueue_script( 'htbbootstrap' );
410
- wp_enqueue_script( 'waypoints' );
411
 
412
  }
413
 
407
  // JS
408
  wp_enqueue_script( 'htmega-popper' );
409
  wp_enqueue_script( 'htbbootstrap' );
410
+ wp_enqueue_script( 'waypoints' );
411
 
412
  }
413
 
includes/widgets/htmega_gallery_justify.php CHANGED
@@ -30,6 +30,7 @@ class HTMega_Elementor_Widget_Gallery_Justify extends Widget_Base {
30
  public function get_script_depends() {
31
  return [
32
  'justified-gallery',
 
33
  ];
34
  }
35
 
@@ -106,23 +107,25 @@ class HTMega_Elementor_Widget_Gallery_Justify extends Widget_Base {
106
  jQuery(document).ready(function($) {
107
 
108
  'use strict';
109
- $('#npgallery<?php echo $id; ?>').justifiedGallery({
110
- rowHeight: <?php echo $settings['row_height']; ?>,
111
- maxRowHeight: null,
112
- margins: <?php echo $settings['space_margin']; ?>,
113
- border: 0,
114
- rel: 'npgallery<?php echo $id; ?>',
115
- lastRow: 'nojustify',
116
- captions: true,
117
- randomize: false,
118
- sizeRangeSuffixes: {
119
- lt100: '_t',
120
- lt240: '_m',
121
- lt320: '_n',
122
- lt500: '',
123
- lt640: '_z',
124
- lt1024: '_b'
125
- }
 
 
126
  });
127
 
128
  });
30
  public function get_script_depends() {
31
  return [
32
  'justified-gallery',
33
+ 'imagesloaded'
34
  ];
35
  }
36
 
107
  jQuery(document).ready(function($) {
108
 
109
  'use strict';
110
+ $('#npgallery<?php echo $id; ?>').imagesLoaded( function() {
111
+ $('#npgallery<?php echo $id; ?>').justifiedGallery({
112
+ rowHeight: <?php echo $settings['row_height']; ?>,
113
+ maxRowHeight: null,
114
+ margins: <?php echo $settings['space_margin']; ?>,
115
+ border: 0,
116
+ rel: 'npgallery<?php echo $id; ?>',
117
+ lastRow: 'nojustify',
118
+ captions: true,
119
+ randomize: false,
120
+ sizeRangeSuffixes: {
121
+ lt100: '_t',
122
+ lt240: '_m',
123
+ lt320: '_n',
124
+ lt500: '',
125
+ lt640: '_z',
126
+ lt1024: '_b'
127
+ }
128
+ });
129
  });
130
 
131
  });
includes/widgets/htmega_switcher.php CHANGED
@@ -656,7 +656,7 @@ class HTMega_Elementor_Widget_Switcher extends Widget_Base {
656
  ?>
657
  </span>
658
  <label class="htmega-switch-toggle">
659
- <input type="checkbox">
660
  <span class="htmega-switche-toggle-slider"></span>
661
  </label>
662
  <span class="htmega-switcher-toggle-title" id="switcher-toggle-title-1">
@@ -701,15 +701,20 @@ class HTMega_Elementor_Widget_Switcher extends Widget_Base {
701
  jQuery(document).ready(function($){
702
  var switcherTglOne ='#switchertglone-'+'<?php echo $this->get_id(); ?>';
703
  var switcherTglTwo ='#switchertgltwo-'+'<?php echo $this->get_id(); ?>';
 
704
  $('.htmega-switch-toggle input').on( 'click', function() {
705
- if(this.checked) {
 
 
 
 
706
  $(switcherTglOne).removeClass('toggl-active');
707
  $(switcherTglTwo).addClass('toggl-active');
708
  }else{
709
  $(switcherTglTwo).removeClass('toggl-active');
710
  $(switcherTglOne).addClass('toggl-active');
711
- }
712
- });
713
  });
714
  </script>
715
  <?php
656
  ?>
657
  </span>
658
  <label class="htmega-switch-toggle">
659
+ <input type="checkbox" checked="checked">
660
  <span class="htmega-switche-toggle-slider"></span>
661
  </label>
662
  <span class="htmega-switcher-toggle-title" id="switcher-toggle-title-1">
701
  jQuery(document).ready(function($){
702
  var switcherTglOne ='#switchertglone-'+'<?php echo $this->get_id(); ?>';
703
  var switcherTglTwo ='#switchertgltwo-'+'<?php echo $this->get_id(); ?>';
704
+ activeSwitcherContent(true);
705
  $('.htmega-switch-toggle input').on( 'click', function() {
706
+ activeSwitcherContent(this.checked);
707
+ });
708
+
709
+ function activeSwitcherContent(status){
710
+ if(status){
711
  $(switcherTglOne).removeClass('toggl-active');
712
  $(switcherTglTwo).addClass('toggl-active');
713
  }else{
714
  $(switcherTglTwo).removeClass('toggl-active');
715
  $(switcherTglOne).addClass('toggl-active');
716
+ }
717
+ }
718
  });
719
  </script>
720
  <?php
includes/widgets/htmega_wc_add_to_cart.php CHANGED
@@ -122,7 +122,7 @@ class HTMega_Elementor_Widget_WC_Add_to_Cart extends Widget_Button {
122
 
123
  if ( ! empty( $settings['product_id'] ) ) {
124
  $product_id = $settings['product_id'];
125
- } elseif ( \Elementor\Utils::is_ajax() ) {
126
  $product_id = $_POST['post_id'];
127
  } else {
128
  $product_id = get_queried_object_id();
@@ -143,7 +143,7 @@ class HTMega_Elementor_Widget_WC_Add_to_Cart extends Widget_Button {
143
  if ( $product ) {
144
  if ( version_compare( WC()->version, '3.0.0', '>=' ) ) {
145
  $product_type = $product->get_type();
146
- } else {
147
  $product_type = $product->product_type;
148
  }
149
 
@@ -162,12 +162,13 @@ class HTMega_Elementor_Widget_WC_Add_to_Cart extends Widget_Button {
162
  ]
163
  );
164
 
 
 
165
  } elseif ( current_user_can( 'manage_options' ) ) {
166
- $settings['text'] = __( 'Please set a valid product', 'htmega-addons' );
167
- $this->set_settings( $settings );
 
168
  }
169
-
170
- parent::render();
171
  }
172
 
173
  private function render_form_button( $product ) {
@@ -187,7 +188,15 @@ class HTMega_Elementor_Widget_WC_Add_to_Cart extends Widget_Button {
187
  add_filter( 'esc_html', [ $this, 'unescape_html' ], 10 ,2 );
188
 
189
  ob_start();
190
- woocommerce_template_single_add_to_cart();
 
 
 
 
 
 
 
 
191
  $form = ob_get_clean();
192
  $form = str_replace( 'single_add_to_cart_button', 'single_add_to_cart_button elementor-button', $form );
193
  echo $form;
122
 
123
  if ( ! empty( $settings['product_id'] ) ) {
124
  $product_id = $settings['product_id'];
125
+ } elseif ( wp_doing_ajax() ) {
126
  $product_id = $_POST['post_id'];
127
  } else {
128
  $product_id = get_queried_object_id();
143
  if ( $product ) {
144
  if ( version_compare( WC()->version, '3.0.0', '>=' ) ) {
145
  $product_type = $product->get_type();
146
+ }else{
147
  $product_type = $product->product_type;
148
  }
149
 
162
  ]
163
  );
164
 
165
+ parent::render();
166
+
167
  } elseif ( current_user_can( 'manage_options' ) ) {
168
+ /*$settings['text'] = __( 'Please set a valid product', 'htmega-addons' );
169
+ $this->set_settings( $settings );*/
170
+ echo esc_html__( 'Please set a valid product', 'htmega-addons' );
171
  }
 
 
172
  }
173
 
174
  private function render_form_button( $product ) {
188
  add_filter( 'esc_html', [ $this, 'unescape_html' ], 10 ,2 );
189
 
190
  ob_start();
191
+
192
+ if($product){
193
+ echo '<div class="product">';
194
+ do_action( 'woocommerce_' . $product->get_type() . '_add_to_cart' );
195
+ echo '</div>';
196
+ }else{
197
+ woocommerce_template_single_add_to_cart();
198
+ }
199
+
200
  $form = ob_get_clean();
201
  $form = str_replace( 'single_add_to_cart_button', 'single_add_to_cart_button elementor-button', $form );
202
  echo $form;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: hasthemes, htplugins, devitemsllc, tarekht
3
  Tags: Elementor, Elementor Addons, Elementor Widgets, elementor page builder, Elementor Blocks
4
  Requires at least: 4.7
5
  Tested up to: 5.8
6
- Stable tag: 1.6.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -170,6 +170,10 @@ Feel free to [Contact us](https://hasthemes.com/contact-us/)
170
  Visit [HasThemes](https://hasthemes.com/) for more details about HTML, Shopify and WordPress products and services.
171
 
172
  == Changelog ==
 
 
 
 
173
  = Version: 1.6.8 - Date: 2021-11-14 =
174
  * Added: Switcher Toggle layout option in Switcher addon
175
  * Added: Alignment option in accordion style three and four
3
  Tags: Elementor, Elementor Addons, Elementor Widgets, elementor page builder, Elementor Blocks
4
  Requires at least: 4.7
5
  Tested up to: 5.8
6
+ Stable tag: 1.6.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
170
  Visit [HasThemes](https://hasthemes.com/) for more details about HTML, Shopify and WordPress products and services.
171
 
172
  == Changelog ==
173
+ = Version: 1.6.9 - Date: 2021-12-07 =
174
+ * Fixed: Image loading issue of Gallery Justify addon
175
+ * Fixed: Empty product error of add to cart addon
176
+
177
  = Version: 1.6.8 - Date: 2021-11-14 =
178
  * Added: Switcher Toggle layout option in Switcher addon
179
  * Added: Alignment option in accordion style three and four