From baf7286762c0dcc01633a7b6956d7592eba0ccdf Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Wed, 14 Oct 2020 12:08:05 +0600 Subject: [PATCH 1/6] gutenberg file just added, not activated yet --- modules/build/index.js | 33 +++++++++++++++++++++++++++++++++ modules/gutenberg.php | 20 ++++++++++++++++++++ woo-product-table.php | 12 +++++++++--- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 modules/build/index.js create mode 100644 modules/gutenberg.php diff --git a/modules/build/index.js b/modules/build/index.js new file mode 100644 index 00000000..c446667e --- /dev/null +++ b/modules/build/index.js @@ -0,0 +1,33 @@ +( function( blocks, element ) { + var el = element.createElement; + + var blockStyle = { + backgroundColor: '#900', + color: '#fff', + padding: '20px', + }; + console.log(blocks); + blocks.registerBlockType( 'gutenberg-examples/example-01-basic', { + title: 'Example: Basic', + icon: 'universal-access-alt', + category: 'design', + example: {}, + edit: function() { + return el( + 'div', + { style: blockStyle }, + 'Hello World, step 1 (from the editor).' + ); + }, + save: function() { + return el( + 'div', + { style: blockStyle }, + 'Hello World, step 1 (from the frontend).' + ); + }, + } ); +}( + window.wp.blocks, + window.wp.element +) ); \ No newline at end of file diff --git a/modules/gutenberg.php b/modules/gutenberg.php new file mode 100644 index 00000000..d9fd1c93 --- /dev/null +++ b/modules/gutenberg.php @@ -0,0 +1,20 @@ + array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'a35cc1c098b69994c9c6d6dc1416bb90'); + + wp_register_script( + 'gutenberg-examples-01-esnext', + plugins_url( 'build/index.js', __FILE__ ), + $asset_file['dependencies'], + $asset_file['version'] + ); + + register_block_type( 'gutenberg-examples/example-01-basic', array( + 'editor_script' => 'gutenberg-examples-01-esnext', + ) ); + +} +add_action( 'init', 'gutenberg_examples_01_register_block' ); \ No newline at end of file diff --git a/woo-product-table.php b/woo-product-table.php index f2cb4d5a..e5dcaa5d 100644 --- a/woo-product-table.php +++ b/woo-product-table.php @@ -477,9 +477,15 @@ public function __construct() { } //Coll elementor Module, If installed Elementor if ( did_action( 'elementor/loaded' ) ) { - include_once $this->path('BASE_DIR','modules/elementor.php'); //MObile or Table Defice Detector - } - + include_once $this->path('BASE_DIR','modules/elementor.php'); //MObile or Table Defice Detector //gutenberg + } + /** + * Supporting Gutenberg + * + * @since 2.7.6 + */ + //include_once $this->path('BASE_DIR','modules/gutenberg.php'); //gutenberg + if( !class_exists( 'Mobile_Detect' ) ){ include_once $this->path('BASE_DIR','modules/Mobile_Detect.php'); //MObile or Table Defice Detector } From a329ddfba94db02e79e7d911ffa08848b2383725 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Wed, 14 Oct 2020 17:10:42 +0600 Subject: [PATCH 2/6] Quote Button Revert on Change Variation --- assets/js/custom.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/assets/js/custom.js b/assets/js/custom.js index d2290b57..9e913371 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -1583,6 +1583,22 @@ $('#table_id_' + temp_number + ' .instance_search_input').val(''); } + /** + * Quote Button Revert on Change Variation + */ + $(window).on('wpt_changed_variations',function(e,Attrs){ + if( Attrs.status ){ + console.log(Attrs); + var product_id = Attrs.product_id; + var quoteElm = $('tr.product_id_'+product_id + ' td.wpt_quoterequest a.wpt_yith_add_to_quote_request'); + var response_msg = quoteElm.data('msg'); + quoteElm.html(response_msg.text); + + quoteElm.closest('div.quoterequest').find('.yith_ywraq_add_item_response_message').remove(); + quoteElm.closest('div.quoterequest').find('.yith_browse_link').remove(); + + } + }); /** * For Add to Quote Plugin * YITH add to Quote Request plugin @@ -1599,7 +1615,9 @@ } var msg = $(this).data('msg'); var response_msg = $(this).attr('data-response_msg'); - if(response_msg !== ''){ + var type = $(this).closest('tr.wpt_row').data('type') + + if(type !== 'variable' && response_msg !== ''){ alert(response_msg); $('.' + selector).html(msg.added); return false; @@ -1647,7 +1665,7 @@ //$('.' + selector + '+.yith_ywraq_add_item_browse_message').remove(); //$('.' + selector + '+.yith_ywraq_add_item_response_message').remove(); html = '
' + response.message + '
'; - html += '' + yith_browse_list + ''; + html += '' + yith_browse_list + ''; $('.' + selector).parent().append( html ).show(); //response.label_browse }else{ From 2c58f83b0bb628276d3f419a3264d8b11061fbe1 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Wed, 14 Oct 2020 17:12:31 +0600 Subject: [PATCH 3/6] Quote Button Revert on Change Variation --- assets/js/custom.js | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/js/custom.js b/assets/js/custom.js index 9e913371..bc66d117 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -1588,7 +1588,6 @@ */ $(window).on('wpt_changed_variations',function(e,Attrs){ if( Attrs.status ){ - console.log(Attrs); var product_id = Attrs.product_id; var quoteElm = $('tr.product_id_'+product_id + ' td.wpt_quoterequest a.wpt_yith_add_to_quote_request'); var response_msg = quoteElm.data('msg'); From ce6e962edeec16c1b8b057a91cc44e7d2665e070 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Wed, 14 Oct 2020 17:15:35 +0600 Subject: [PATCH 4/6] css select2 conflict fix --- assets/css/admin.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index 39abc494..1b13d0a4 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -747,7 +747,9 @@ div#wpt_configuration_form .ultraaddons-panel { padding-bottom: 10px; */ } -div#wpt_configuration_form select.wpt_select2,#wpt_product_ids,span.select2.select2-container{width: 100% !important;} +div#wpt_configuration_form select.wpt_select2, +#wpt_product_ids, +#wpt_configuration_form span.select2.select2-container{width: 100% !important;} span.wpt_column_arrow { position: absolute; From ac6ca5ff362078546f3c3dcc66866e511d328f46 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 15 Oct 2020 14:30:01 +0600 Subject: [PATCH 5/6] Issue for Single Product page - not showing all product - issue has solved --- includes/functions.php | 4 ++++ readme.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index e03a5716..e7901de7 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -804,6 +804,10 @@ function wpt_table_edit_link( $table_ID ) { * @return type */ function wpt_args_manipulation_frontend( $args ){ + + if( is_page() || is_single() ){ + return $args; + } //MainTain for Archives Page global $wpdb; $query_vars = isset( $GLOBALS['wp_query']->query_vars ) ? $GLOBALS['wp_query']->query_vars : false; diff --git a/readme.txt b/readme.txt index 7b7a7334..2f64e374 100644 --- a/readme.txt +++ b/readme.txt @@ -159,6 +159,7 @@ You can easily show specific category products. While creating new table click o = 2.7.6 = * Fixed: Product Weight calculation issue fixed. * Added: Elementor Widget Features Added. +* Fixed: Table on Product Page (Not showing product issue) has solved = 2.7.5 = * Fixed: Chrome Scrollbar Issue fixed. From f9bad9cde8a5d51f74452e0c749a17a4c0e5a678 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 15 Oct 2020 15:37:53 +0600 Subject: [PATCH 6/6] is_page and Is_single condition added for function wpt_args_manipulation_frontend at functions.php file --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index e7901de7..7bc123f2 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -804,7 +804,7 @@ function wpt_table_edit_link( $table_ID ) { * @return type */ function wpt_args_manipulation_frontend( $args ){ - + if( is_page() || is_single() ){ return $args; }