From de82f1989cf51418cc5235f45131deab5c1a31ba Mon Sep 17 00:00:00 2001 From: meteor Date: Mon, 12 Aug 2024 23:37:18 +0400 Subject: [PATCH 1/4] PLUGINS-6394 --- ecwid-shopping-cart.php | 1 + includes/class-ecwid-products.php | 10 +++------- includes/class-ecwid-seo-links.php | 18 +++++++++++++++--- .../class-ecwid-integration-jetpack.php | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 includes/integrations/class-ecwid-integration-jetpack.php diff --git a/ecwid-shopping-cart.php b/ecwid-shopping-cart.php index f1b66842..a2db4ab6 100644 --- a/ecwid-shopping-cart.php +++ b/ecwid-shopping-cart.php @@ -209,6 +209,7 @@ function ecwid_init_integrations() { 'litespeed-cache/litespeed-cache.php' => 'litespeed-cache', 'sg-cachepress/sg-cachepress.php' => 'sg-optimizer', 'google-sitemap-generator/sitemap.php' => 'google-sitemap-generator', + 'jetpack/jetpack.php' => 'jetpack', ); $old_wordpress = version_compare( get_bloginfo( 'version' ), '5.0', '<' ); diff --git a/includes/class-ecwid-products.php b/includes/class-ecwid-products.php index afd2e7db..2f93fa57 100644 --- a/includes/class-ecwid-products.php +++ b/includes/class-ecwid-products.php @@ -96,9 +96,9 @@ public function join_out_of_stock( $join ) { global $wpdb; $join .= 'LEFT JOIN ' . $wpdb->postmeta . ' ' . self::DB_ALIAS_OUT_OF_STOCK - . ' ON ' . $wpdb->posts . '.id = ' . self::DB_ALIAS_OUT_OF_STOCK . '.post_id' - . ' AND ' . self::DB_ALIAS_OUT_OF_STOCK . '.meta_key="in_stock"' - . ' AND ' . self::DB_ALIAS_OUT_OF_STOCK . '.meta_value=1'; + . ' ON ' . $wpdb->posts . '.id = ' . self::DB_ALIAS_OUT_OF_STOCK . '.post_id' + . ' AND ' . self::DB_ALIAS_OUT_OF_STOCK . '.meta_key="in_stock"' + . ' AND ' . self::DB_ALIAS_OUT_OF_STOCK . '.meta_value=1'; return $join; } @@ -325,12 +325,10 @@ public function sync( $settings = null ) { } if ( ! $settings || $settings['one_at_a_time'] && ! $did_something ) { - $did_something = $this->_process_products( $settings ); } if ( ! $settings || $settings['one_at_a_time'] && ! $did_something ) { - $this->_status->update_last_sync_time( time() ); return true; @@ -410,7 +408,6 @@ protected function _process_products( $settings ) { } while ( ! $over ) { - $this->_status_event( array( 'event' => 'fetching_products', @@ -551,7 +548,6 @@ protected function _process_deleted_products( $settings = array() ) { } while ( ! $over ) { - $this->_status_event( array( 'event' => 'fetching_deleted_product_ids', diff --git a/includes/class-ecwid-seo-links.php b/includes/class-ecwid-seo-links.php index 1b6fff4e..9cc95641 100644 --- a/includes/class-ecwid-seo-links.php +++ b/includes/class-ecwid-seo-links.php @@ -338,10 +338,15 @@ public function build_rewrite_rules( $rules ) { $patterns = self::get_seo_links_patterns(); $post = get_post( $page_id ); + if ( ! $post ) { continue; } - if ( ! in_array( $post->post_type, array( 'page', 'post' ) ) ) { + + $default_post_types = array( 'page', 'post' ); + $allowed_post_types = apply_filters( 'ecwid_seo_allowed_post_types', $default_post_types ); + + if ( ! in_array( $post->post_type, $allowed_post_types ) ) { continue; } @@ -358,9 +363,16 @@ public function build_rewrite_rules( $rules ) { } foreach ( $patterns as $pattern ) { - $additional_rules[ $link . '/' . $pattern . '.*' ] = 'index.php?' . $param_name . '=' . $link_page_id; + $query = 'index.php?' . $param_name . '=' . $link_page_id; + + // adding post_type parameters for non-default types + if ( ! in_array( $post->post_type, $default_post_types ) ) { + $query .= '&post_type=' . $post->post_type; + } + + $additional_rules[ $link . '/' . $pattern . '.*' ] = $query; } - } + }//end foreach }//end foreach if ( self::is_store_on_home_page() ) { diff --git a/includes/integrations/class-ecwid-integration-jetpack.php b/includes/integrations/class-ecwid-integration-jetpack.php new file mode 100644 index 00000000..8610305f --- /dev/null +++ b/includes/integrations/class-ecwid-integration-jetpack.php @@ -0,0 +1,17 @@ +post_types ); + + return $types; + } +} + +new Ecwid_Integration_Jetpack(); From b6fe5133438aebaad5daf4bd55d72d9a59fe6b56 Mon Sep 17 00:00:00 2001 From: meteor Date: Tue, 13 Aug 2024 16:53:41 +0400 Subject: [PATCH 2/4] PLUGINS-6808, PLUGINS-6919, PLUGINS-6924 - changed the order of statics and dynamics blocks --- .../shortcodes/class-ecwid-shortcode-productbrowser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/shortcodes/class-ecwid-shortcode-productbrowser.php b/includes/shortcodes/class-ecwid-shortcode-productbrowser.php index 000d84f0..94b4d62b 100644 --- a/includes/shortcodes/class-ecwid-shortcode-productbrowser.php +++ b/includes/shortcodes/class-ecwid-shortcode-productbrowser.php @@ -58,7 +58,9 @@ public function render() { add_filter( 'ecwid_is_defer_store_init_enabled', '__return_false' ); } - $code .= '
'; + $code .= self::get_dynamic_html_code( $is_default_render, $classname ); + + $code .= '
'; $code .= htmlspecialchars_decode( Ecwid_Static_Page::get_html_code() ); $js_code = Ecwid_Static_Page::get_js_code(); @@ -67,8 +69,6 @@ public function render() { } $code .= '
'; - $code .= self::get_dynamic_html_code( $is_default_render, $classname ); - $force_dynamic_js_code = 'if( typeof window.ec.storefront.staticPages != "undefined" && typeof window.ec.storefront.staticPages.forceDynamicLoadingIfRequired != "undefined" ) { window.ec.storefront.staticPages.forceDynamicLoadingIfRequired(); }'; From d15bce911d53864d1573698e5d00c868552004ea Mon Sep 17 00:00:00 2001 From: meteor Date: Fri, 16 Aug 2024 17:41:36 +0400 Subject: [PATCH 3/4] PLUGINS-6928 --- includes/class-ecwid-config.php | 56 +++++++++++++++------------- includes/class-ecwid-static-page.php | 3 +- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/includes/class-ecwid-config.php b/includes/class-ecwid-config.php index e0b75204..4b26c8cb 100644 --- a/includes/class-ecwid-config.php +++ b/includes/class-ecwid-config.php @@ -1,22 +1,23 @@ 'oauth_appid', - self::OAUTH_APPSECRET => 'oauth_appsecret', - self::TOKEN => 'oauth_token', - self::STORE_ID => 'store_id', - self::CHANNEL_ID => 'channel_id', - self::API_DOMAIN => 'api_domain', - self::FRONTEND_DOMAIN => 'scriptjs_domain', - self::CPANEL_DOMAIN => 'cp_domain', - self::DEMO_STORE_ID => 'demo_store_id', + self::OAUTH_APPID => 'oauth_appid', + self::OAUTH_APPSECRET => 'oauth_appsecret', + self::TOKEN => 'oauth_token', + self::STORE_ID => 'store_id', + self::CHANNEL_ID => 'channel_id', + self::API_DOMAIN => 'api_domain', + self::STATIC_PAGES_API_DOMAIN => 'static_pages_api_domain', + self::FRONTEND_DOMAIN => 'scriptjs_domain', + self::CPANEL_DOMAIN => 'cp_domain', + self::DEMO_STORE_ID => 'demo_store_id', ); return $common_config; diff --git a/includes/class-ecwid-static-page.php b/includes/class-ecwid-static-page.php index e8601a89..e33f4dc4 100644 --- a/includes/class-ecwid-static-page.php +++ b/includes/class-ecwid-static-page.php @@ -9,7 +9,6 @@ class Ecwid_Static_Page { const OPTION_VALUE_AUTO = ''; const HANDLE_STATIC_PAGE = 'static-page'; - const API_URL = 'https://storefront.ecwid.com/'; protected static $cache_key; @@ -68,7 +67,7 @@ protected static function get_endpoint_url( $params = false ) { $params['mode'] = 'home'; } - $url = self::API_URL; + $url = 'https://' . Ecwid_Config::get_static_pages_api_domain() . '/'; $url .= sprintf( '%s-page/', $params['mode'] ); $url .= sprintf( '%s/', get_ecwid_store_id() ); From 4042be61749432577cb4297322efc8f5612411b7 Mon Sep 17 00:00:00 2001 From: meteor Date: Mon, 19 Aug 2024 15:07:47 +0400 Subject: [PATCH 4/4] v 6.12.18 changelog --- CHANGELOG.txt | 4 ++++ ecwid-shopping-cart.php | 2 +- readme.txt | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cc56708b..f547b006 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,8 @@ == Changelog == += 6.12.18 - Aug 19, 2024 = +- Improved compatibility with pages created using the Jetpack plugin. Now ecommerce blocks added to Portfolio and Testimonial pages work as well as on regular pages. +- Fixed an issue with product option fields working on product pages. In some cases, product options were not clickable. We've fixed this. + = 6.12.17 - Aug 5, 2024 = - Internal improvements and optimizations. diff --git a/ecwid-shopping-cart.php b/ecwid-shopping-cart.php index a2db4ab6..c64c07ea 100644 --- a/ecwid-shopping-cart.php +++ b/ecwid-shopping-cart.php @@ -5,7 +5,7 @@ Description: Ecwid by Lightspeed is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up. Text Domain: ecwid-shopping-cart Author: Ecwid Ecommerce -Version: 6.12.17 +Version: 6.12.18 Author URI: https://ecwid.to/ecwid-site License: GPLv2 or later */ diff --git a/readme.txt b/readme.txt index 12b73275..663447a5 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Requires at least: 4.4 Tested up to: 6.6 -Stable tag: 6.12.17 +Stable tag: 6.12.18 Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available. @@ -153,6 +153,10 @@ You can use Ecwid’s built-in import tools to copy your store products from any * [Ecwid Help Center](http://help.ecwid.com "Ecwid Help") == Changelog == += 6.12.18 - Aug 19, 2024 = +- Improved compatibility with pages created using the Jetpack plugin. Now ecommerce blocks added to Portfolio and Testimonial pages work as well as on regular pages. +- Fixed an issue with product option fields working on product pages. In some cases, product options were not clickable. We've fixed this. + = 6.12.17 - Aug 5, 2024 = - Internal improvements and optimizations.