Version Description
- June 08, 2022 =
- Improvements for the integration with the All in One SEO plugin. There was a minor SEO issue with duplicates of the canonical tag on ecommerce store pages. There was sitemaps issue generated by plugin did not work well with those generated by All in One SEO. These issues has been fixed and everything should work fine now.
- Minor fixes for Gutenberg ecommerce blocks.
- Improvements for the Store page speedup feature.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 6.10.22 |
Comparing to | |
See all releases |
Code changes from version 6.10.21 to 6.10.22
- ecwid-shopping-cart.php +2 -2
- includes/class-ec-store-sitemap-provider.php +8 -12
- includes/class-ecwid-admin-developers-page.php +14 -7
- includes/class-ecwid-admin-storefront-page.php +309 -303
- includes/class-ecwid-sitemap-builder.php +0 -2
- includes/gutenberg/class-ecwid-gutenberg-block-store.php +93 -89
- includes/gutenberg/class-ecwid-gutenberg.php +139 -134
- includes/integrations/class-ecwid-integration-aiosp.php +128 -55
- includes/integrations/class-ecwid-integration-wpseo.php +82 -92
- js/gutenberg/blocks.build.js +1 -1
- lib/ecwid_platform.php +244 -227
- readme.txt +6 -1
- templates/admin/developers.php +65 -65
ecwid-shopping-cart.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?partner=wporg
|
|
5 |
Description: Ecwid 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.
|
6 |
Text Domain: ecwid-shopping-cart
|
7 |
Author: Ecwid Ecommerce
|
8 |
-
Version: 6.10.
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
License: GPLv2 or later
|
11 |
*/
|
@@ -2679,7 +2679,7 @@ function ecwid_sync_products_sse() {
|
|
2679 |
|
2680 |
function ecwid_format_date( $unixtime ) {
|
2681 |
|
2682 |
-
return date_i18n( get_option('date_format') . ' ' . get_option('time_format'), $unixtime + get_option(
|
2683 |
}
|
2684 |
|
2685 |
function ecwid_slow_sync_progress($status) {
|
5 |
Description: Ecwid 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.
|
6 |
Text Domain: ecwid-shopping-cart
|
7 |
Author: Ecwid Ecommerce
|
8 |
+
Version: 6.10.22
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
License: GPLv2 or later
|
11 |
*/
|
2679 |
|
2680 |
function ecwid_format_date( $unixtime ) {
|
2681 |
|
2682 |
+
return date_i18n( get_option('date_format') . ' ' . get_option('time_format'), $unixtime + get_option('gmt_offset') * 60 * 60 );
|
2683 |
}
|
2684 |
|
2685 |
function ecwid_slow_sync_progress($status) {
|
includes/class-ec-store-sitemap-provider.php
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
class Ec_Store_Sitemap_Provider extends WP_Sitemaps_Provider {
|
5 |
|
6 |
public function __construct() {
|
@@ -10,13 +8,13 @@ class Ec_Store_Sitemap_Provider extends WP_Sitemaps_Provider {
|
|
10 |
|
11 |
public static function init() {
|
12 |
$provider = new self();
|
13 |
-
|
14 |
}
|
15 |
|
16 |
public function get_url_list( $page_num, $post_type = '' ) {
|
17 |
$this->url_list = array();
|
18 |
|
19 |
-
ecwid_build_sitemap( array($this, 'sitemap_callback') );
|
20 |
|
21 |
return $this->url_list;
|
22 |
}
|
@@ -25,15 +23,15 @@ class Ec_Store_Sitemap_Provider extends WP_Sitemaps_Provider {
|
|
25 |
return 1;
|
26 |
}
|
27 |
|
28 |
-
public function sitemap_callback($url, $priority, $frequency, $obj) {
|
29 |
-
|
30 |
$sitemap_entry = array(
|
31 |
-
'loc'
|
32 |
'changefreq' => $frequency,
|
33 |
-
'priority'
|
34 |
);
|
35 |
-
|
36 |
-
if( isset($obj->updated) ) {
|
37 |
$sitemap_entry['lastmod'] = $obj->updated;
|
38 |
}
|
39 |
|
@@ -42,5 +40,3 @@ class Ec_Store_Sitemap_Provider extends WP_Sitemaps_Provider {
|
|
42 |
}
|
43 |
|
44 |
add_filter( 'init', 'Ec_Store_Sitemap_Provider::init' );
|
45 |
-
|
46 |
-
?>
|
1 |
<?php
|
|
|
|
|
2 |
class Ec_Store_Sitemap_Provider extends WP_Sitemaps_Provider {
|
3 |
|
4 |
public function __construct() {
|
8 |
|
9 |
public static function init() {
|
10 |
$provider = new self();
|
11 |
+
wp_register_sitemap_provider( 'ecstore', $provider );
|
12 |
}
|
13 |
|
14 |
public function get_url_list( $page_num, $post_type = '' ) {
|
15 |
$this->url_list = array();
|
16 |
|
17 |
+
ecwid_build_sitemap( array( $this, 'sitemap_callback' ) );
|
18 |
|
19 |
return $this->url_list;
|
20 |
}
|
23 |
return 1;
|
24 |
}
|
25 |
|
26 |
+
public function sitemap_callback( $url, $priority, $frequency, $obj ) {
|
27 |
+
|
28 |
$sitemap_entry = array(
|
29 |
+
'loc' => $url,
|
30 |
'changefreq' => $frequency,
|
31 |
+
'priority' => $priority,
|
32 |
);
|
33 |
+
|
34 |
+
if ( isset( $obj->updated ) ) {
|
35 |
$sitemap_entry['lastmod'] = $obj->updated;
|
36 |
}
|
37 |
|
40 |
}
|
41 |
|
42 |
add_filter( 'init', 'Ec_Store_Sitemap_Provider::init' );
|
|
|
|
includes/class-ecwid-admin-developers-page.php
CHANGED
@@ -1,22 +1,29 @@
|
|
1 |
<?php
|
2 |
-
class Ecwid_Admin_Developers_Page
|
3 |
-
|
4 |
const ADMIN_SLUG = 'ec-store-developers';
|
5 |
public static $templates_dir;
|
6 |
-
|
7 |
public function __construct() {
|
8 |
|
9 |
}
|
10 |
|
11 |
public static function do_page() {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
self::$templates_dir = ECWID_PLUGIN_DIR . '/templates/admin/';
|
14 |
|
15 |
-
|
16 |
require_once self::$templates_dir . 'developers.php';
|
17 |
-
|
18 |
-
// require_once ECWID_PLUGIN_DIR . 'templates/admin-footer.php';
|
19 |
}
|
20 |
}
|
21 |
|
22 |
-
$_ecwid_admin_developers_page = new Ecwid_Admin_Developers_Page();
|
1 |
<?php
|
2 |
+
class Ecwid_Admin_Developers_Page {
|
3 |
+
|
4 |
const ADMIN_SLUG = 'ec-store-developers';
|
5 |
public static $templates_dir;
|
6 |
+
|
7 |
public function __construct() {
|
8 |
|
9 |
}
|
10 |
|
11 |
public static function do_page() {
|
12 |
|
13 |
+
global $current_user;
|
14 |
+
$admin_email = $current_user->user_email;
|
15 |
+
|
16 |
+
if ( ! ecwid_is_demo_store() ) {
|
17 |
+
$api = new Ecwid_Api_V3();
|
18 |
+
$profile = $api->get_store_profile();
|
19 |
+
$admin_email = $profile->account->accountEmail;
|
20 |
+
}
|
21 |
+
|
22 |
self::$templates_dir = ECWID_PLUGIN_DIR . '/templates/admin/';
|
23 |
|
24 |
+
echo Ecwid_Admin_UI_Framework::print_fix_js(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
25 |
require_once self::$templates_dir . 'developers.php';
|
|
|
|
|
26 |
}
|
27 |
}
|
28 |
|
29 |
+
$_ecwid_admin_developers_page = new Ecwid_Admin_Developers_Page();
|
includes/class-ecwid-admin-storefront-page.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
-
class Ecwid_Admin_Storefront_Page
|
3 |
-
|
4 |
const ADMIN_SLUG = 'ec-storefront-settings';
|
5 |
public static $templates_dir;
|
6 |
-
|
7 |
public function __construct() {
|
8 |
add_action( 'enqueue_block_editor_assets', array( $this, 'register_script_for_select_block' ) );
|
9 |
|
@@ -19,47 +19,47 @@ class Ecwid_Admin_Storefront_Page
|
|
19 |
|
20 |
self::$templates_dir = ECWID_PLUGIN_DIR . '/templates/admin/storefront/';
|
21 |
|
22 |
-
$page_id
|
23 |
$store_pages = false;
|
24 |
|
25 |
-
if( ecwid_is_demo_store() ) {
|
26 |
$page_status = 'demo';
|
27 |
-
$page_link
|
28 |
-
} elseif(
|
29 |
$page_status = 'no-pages';
|
30 |
}
|
31 |
|
32 |
-
if( $page_id && !isset( $page_status ) ) {
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
$store_on_front = Ecwid_Seo_Links::is_store_on_home_page();
|
38 |
|
39 |
-
if( self::is_gutenberg_active() ) {
|
40 |
$design_edit_link = get_edit_post_link( $page_id ) . '&ec-show-store-settings';
|
41 |
} else {
|
42 |
-
$page
|
43 |
-
$time
|
44 |
$iframe_src = false;
|
45 |
-
|
46 |
-
if( !Ecwid_Admin::disable_dashboard() ){
|
47 |
-
$iframe_src = ecwid_get_iframe_src($time, $page);
|
48 |
}
|
49 |
|
50 |
-
if(
|
51 |
$design_edit_link = 'https://' . Ecwid_Config::get_cpanel_domain() . '/#design';
|
52 |
} else {
|
53 |
$design_edit_link = get_admin_url( null, 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-admin-design' );
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
if( class_exists( 'Ecwid_Floating_Minicart' ) ) {
|
58 |
-
$minicart_hide
|
59 |
-
$customizer_minicart_link = admin_url('customize.php') . '?autofocus[section]=ec-store-minicart&url=' . rawurlencode($page_link);
|
60 |
}
|
61 |
|
62 |
-
if ( count
|
63 |
$store_pages = Ecwid_Store_Page::get_store_pages_array_for_selector();
|
64 |
}
|
65 |
|
@@ -67,291 +67,297 @@ class Ecwid_Admin_Storefront_Page
|
|
67 |
|
68 |
$api = new Ecwid_Api_V3();
|
69 |
$res = $api->get_products( array() );
|
70 |
-
if( $res ) {
|
71 |
-
$products
|
72 |
$products_total = $res->total;
|
73 |
}
|
74 |
|
75 |
$need_show_draft_warning = time() - get_option( 'ecwid_installation_date' ) > 3 * DAY_IN_SECONDS;
|
76 |
} else {
|
77 |
-
$store_on_front
|
78 |
-
$page_edit_link
|
79 |
-
$page_data
|
80 |
-
$design_edit_link
|
81 |
-
$page_slug
|
82 |
-
$minicart_hide
|
83 |
-
$categories
|
84 |
-
$products_total
|
85 |
$customizer_minicart_link = false;
|
86 |
|
87 |
-
if( !isset($page_link) )
|
88 |
-
|
|
|
|
|
89 |
|
90 |
-
|
91 |
|
92 |
-
|
93 |
require_once self::$templates_dir . 'main.php';
|
94 |
}
|
95 |
|
96 |
-
|
97 |
-
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
|
114 |
-
|
115 |
-
|
116 |
|
117 |
public function ajax_set_status() {
|
118 |
$page_statuses = array(
|
119 |
0 => 'draft',
|
120 |
-
1 => 'publish'
|
121 |
);
|
122 |
|
123 |
-
if( !isset( $_GET['status'] ) ) {
|
124 |
return false;
|
125 |
}
|
126 |
|
127 |
$status = intval( $_GET['status'] );
|
128 |
-
if( !array_key_exists( $status, $page_statuses ) ) {
|
129 |
return false;
|
130 |
}
|
131 |
|
132 |
-
$page_id
|
133 |
-
|
134 |
|
135 |
-
wp_update_post(
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
|
|
139 |
|
140 |
$page_data = self::get_page_data( $page_id );
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
}
|
148 |
|
149 |
public function ajax_set_store_on_front() {
|
150 |
-
$status = isset($_GET['status']) ? intval( $_GET['status'] ) : false;
|
151 |
|
152 |
-
|
153 |
|
154 |
-
if( $status ) {
|
155 |
$this->_set_previous_frontpage_settings();
|
156 |
$page_id = $store_page_id;
|
157 |
-
$type
|
158 |
-
} else {
|
159 |
$saved_settings = $this->_get_previous_frontpage_settings();
|
160 |
-
$page_id
|
161 |
-
$type
|
162 |
}
|
163 |
|
164 |
update_option( 'page_on_front', $page_id );
|
165 |
update_option( 'show_on_front', $type );
|
166 |
|
167 |
-
|
168 |
wp_send_json(
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
}
|
175 |
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
|
205 |
public function ajax_set_display_cart_icon() {
|
206 |
-
$status = isset($_GET['status']) ? intval( $_GET['status'] ) : false;
|
207 |
|
208 |
-
if( $status ) {
|
209 |
update_option( Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, Ecwid_Floating_Minicart::DISPLAY_ALL );
|
210 |
update_option( Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART, 1 );
|
211 |
} else {
|
212 |
update_option( Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, Ecwid_Floating_Minicart::DISPLAY_NONE );
|
213 |
}
|
214 |
-
|
215 |
-
wp_send_json(array('status' => 'success'));
|
216 |
}
|
217 |
|
218 |
public function ajax_set_page_slug() {
|
219 |
-
if( !isset( $_GET['slug'] ) ) {
|
220 |
return;
|
221 |
}
|
222 |
|
223 |
-
$slug = sanitize_text_field(wp_unslash( $_GET['slug'] ));
|
224 |
|
225 |
-
$args
|
226 |
-
'name'
|
227 |
-
'post_type'
|
228 |
'post_status' => 'publish',
|
229 |
'numberposts' => 1,
|
230 |
-
'exclude'
|
231 |
);
|
232 |
-
$posts = get_posts($args);
|
233 |
|
234 |
-
if(
|
235 |
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
236 |
-
wp_update_post(
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
241 |
$page_data = self::get_page_data( $page_id );
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
} else {
|
249 |
wp_send_json(
|
250 |
array(
|
251 |
-
'status'
|
252 |
-
'message' => __( 'Page with that name already exists.', 'ecwid-shopping-cart' )
|
253 |
)
|
254 |
);
|
255 |
-
}
|
256 |
}
|
257 |
|
258 |
public function ajax_create_page() {
|
259 |
-
if( !isset($_GET['type']) ) {
|
260 |
return;
|
261 |
}
|
262 |
|
263 |
-
$type = sanitize_text_field(wp_unslash( $_GET['type'] ));
|
264 |
|
265 |
-
if( isset($_GET['item_id']) ) {
|
266 |
$item_id = intval( $_GET['item_id'] );
|
267 |
} else {
|
268 |
$item_id = '';
|
269 |
}
|
270 |
|
271 |
$pages = array(
|
272 |
-
'store'
|
273 |
-
'title'
|
274 |
-
'block'
|
275 |
'block_add_shortcode' => true,
|
276 |
-
'params'
|
277 |
-
'default_category_id' => ''
|
278 |
-
)
|
279 |
),
|
280 |
'category' => array(
|
281 |
-
'title'
|
282 |
-
'block'
|
283 |
'params' => array(
|
284 |
-
'default_category_id' => $item_id
|
285 |
-
)
|
286 |
),
|
287 |
-
'product'
|
288 |
-
'title'
|
289 |
-
'block'
|
290 |
'params' => array(
|
291 |
-
'default_product_id' => $item_id
|
292 |
-
)
|
293 |
),
|
294 |
-
'cart'
|
295 |
-
'title'
|
296 |
-
'block'
|
297 |
'params' => array(
|
298 |
-
'default_page' => 'cart'
|
299 |
-
)
|
300 |
),
|
301 |
-
'search'
|
302 |
-
'title'
|
303 |
-
'block'
|
304 |
'params' => array(
|
305 |
-
'default_page' => 'search'
|
306 |
-
)
|
307 |
-
)
|
308 |
);
|
309 |
|
310 |
-
if( !isset( $pages[$type] ) ) {
|
311 |
-
wp_send_json(array('status' => 'error'));
|
312 |
}
|
313 |
|
314 |
-
$page = $pages[$type];
|
315 |
|
316 |
-
if( $type == 'product' && $item_id > 0 ) {
|
317 |
-
$api
|
318 |
$product = $api->get_product( $item_id );
|
319 |
|
320 |
-
if( $product ) {
|
321 |
$page['title'] = $product->name;
|
322 |
}
|
323 |
}
|
324 |
|
325 |
-
if( $type == 'category' && $item_id > 0 ) {
|
326 |
-
$api
|
327 |
$product = $api->get_category( $item_id );
|
328 |
|
329 |
-
if( $product ) {
|
330 |
$page['title'] = $product->name;
|
331 |
}
|
332 |
}
|
333 |
|
334 |
-
if( !isset( $page['params'] ) ) {
|
335 |
$page['params'] = array();
|
336 |
}
|
337 |
|
338 |
$shortcode_params = '';
|
339 |
-
foreach( $page['params'] as $key => $value ) {
|
340 |
$shortcode_params .= sprintf( '%s="%s"', $key, $value );
|
341 |
}
|
342 |
|
343 |
$shortcode = sprintf( '[ec_store widgets="productbrowser" %s]', $shortcode_params );
|
344 |
|
345 |
-
if( self::is_gutenberg_active() ) {
|
346 |
-
if( count($page['params']) ) {
|
347 |
$block_params = json_encode( $page['params'] );
|
348 |
} else {
|
349 |
$block_params = '';
|
350 |
}
|
351 |
|
352 |
-
if( isset($page['block_add_shortcode']) && $page['block_add_shortcode'] ) {
|
353 |
-
$shortcode = str_replace('ec_store', 'ecwid', $shortcode);
|
354 |
-
$content
|
355 |
} else {
|
356 |
$content = sprintf( '<!-- wp:%1$s %2$s /-->', $page['block'], $block_params );
|
357 |
}
|
@@ -360,36 +366,36 @@ class Ecwid_Admin_Storefront_Page
|
|
360 |
}
|
361 |
|
362 |
$post = array(
|
363 |
-
'post_title'
|
364 |
-
'post_content'
|
365 |
-
'post_status'
|
366 |
-
'post_author'
|
367 |
-
'post_type'
|
368 |
-
'comment_status' => 'closed'
|
369 |
);
|
370 |
-
|
371 |
$page_id = wp_insert_post( $post );
|
372 |
-
$url
|
373 |
|
374 |
-
if( $type != 'store' ) {
|
375 |
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
376 |
}
|
377 |
$page_data = self::get_page_data( $page_id );
|
378 |
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
}
|
388 |
|
389 |
private function _set_previous_frontpage_settings() {
|
390 |
$settings = array(
|
391 |
'page_on_front' => get_option( 'page_on_front' ),
|
392 |
-
'show_on_front' => get_option( 'show_on_front' )
|
393 |
);
|
394 |
|
395 |
update_option( 'ecwid_frontpage_settings', $settings );
|
@@ -398,10 +404,10 @@ class Ecwid_Admin_Storefront_Page
|
|
398 |
private function _get_previous_frontpage_settings() {
|
399 |
$settings = get_option( 'ecwid_frontpage_settings', false );
|
400 |
|
401 |
-
if(
|
402 |
$settings = array(
|
403 |
'page_on_front' => 0,
|
404 |
-
'show_on_front' => 'posts'
|
405 |
);
|
406 |
}
|
407 |
|
@@ -409,11 +415,11 @@ class Ecwid_Admin_Storefront_Page
|
|
409 |
}
|
410 |
|
411 |
public static function is_gutenberg_active() {
|
412 |
-
$version = get_bloginfo('version');
|
413 |
|
414 |
if ( version_compare( $version, '5.0' ) < 0 ) {
|
415 |
-
|
416 |
-
if( is_plugin_active('gutenberg/gutenberg.php') ) {
|
417 |
return true;
|
418 |
}
|
419 |
|
@@ -426,7 +432,7 @@ class Ecwid_Admin_Storefront_Page
|
|
426 |
'divi-builder/divi-builder.php',
|
427 |
'beaver-builder-lite-version/fl-builder.php',
|
428 |
'disable-gutenberg/disable-gutenberg.php',
|
429 |
-
'js_composer/js_composer.php'
|
430 |
);
|
431 |
|
432 |
foreach ( $plugins_disabling_gutenberg as $plugin ) {
|
@@ -434,8 +440,8 @@ class Ecwid_Admin_Storefront_Page
|
|
434 |
return false;
|
435 |
}
|
436 |
|
437 |
-
//check Divi builder from themes
|
438 |
-
if( defined('ET_BUILDER_THEME') && ET_BUILDER_THEME ) {
|
439 |
return false;
|
440 |
}
|
441 |
}
|
@@ -444,8 +450,8 @@ class Ecwid_Admin_Storefront_Page
|
|
444 |
}
|
445 |
|
446 |
public function register_script_for_select_block() {
|
447 |
-
|
448 |
-
if( !array_key_exists( 'ec-show-store-settings', $_GET ) ) {
|
449 |
return;
|
450 |
}
|
451 |
|
@@ -475,109 +481,109 @@ class Ecwid_Admin_Storefront_Page
|
|
475 |
";
|
476 |
|
477 |
wp_register_script( 'ec-blockeditor-inline-js', '', array(), '', true );
|
478 |
-
wp_enqueue_script( 'ec-blockeditor-inline-js'
|
479 |
wp_add_inline_script( 'ec-blockeditor-inline-js', $script );
|
480 |
}
|
481 |
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
return admin_url( self::get_relative_page_url() );
|
576 |
}
|
577 |
|
578 |
-
static
|
579 |
return 'admin.php?page=' . self::ADMIN_SLUG;
|
580 |
}
|
581 |
}
|
582 |
|
583 |
-
$_ecwid_admin_storefront_page = new Ecwid_Admin_Storefront_Page();
|
1 |
<?php
|
2 |
+
class Ecwid_Admin_Storefront_Page {
|
3 |
+
|
4 |
const ADMIN_SLUG = 'ec-storefront-settings';
|
5 |
public static $templates_dir;
|
6 |
+
|
7 |
public function __construct() {
|
8 |
add_action( 'enqueue_block_editor_assets', array( $this, 'register_script_for_select_block' ) );
|
9 |
|
19 |
|
20 |
self::$templates_dir = ECWID_PLUGIN_DIR . '/templates/admin/storefront/';
|
21 |
|
22 |
+
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
23 |
$store_pages = false;
|
24 |
|
25 |
+
if ( ecwid_is_demo_store() ) {
|
26 |
$page_status = 'demo';
|
27 |
+
$page_link = get_permalink( $page_id );
|
28 |
+
} elseif ( ! $page_id ) {
|
29 |
$page_status = 'no-pages';
|
30 |
}
|
31 |
|
32 |
+
if ( $page_id && ! isset( $page_status ) ) {
|
33 |
+
|
34 |
+
$page_data = self::get_page_data( $page_id );
|
35 |
+
extract( $page_data, EXTR_PREFIX_ALL, 'page' );
|
36 |
|
37 |
$store_on_front = Ecwid_Seo_Links::is_store_on_home_page();
|
38 |
|
39 |
+
if ( self::is_gutenberg_active() ) {
|
40 |
$design_edit_link = get_edit_post_link( $page_id ) . '&ec-show-store-settings';
|
41 |
} else {
|
42 |
+
$page = Ecwid_Admin_Main_Page::PAGE_HASH_DASHBOARD;
|
43 |
+
$time = time() - get_option( 'ecwid_time_correction', 0 );
|
44 |
$iframe_src = false;
|
45 |
+
|
46 |
+
if ( ! Ecwid_Admin::disable_dashboard() ) {
|
47 |
+
$iframe_src = ecwid_get_iframe_src( $time, $page );
|
48 |
}
|
49 |
|
50 |
+
if ( ! $iframe_src ) {
|
51 |
$design_edit_link = 'https://' . Ecwid_Config::get_cpanel_domain() . '/#design';
|
52 |
} else {
|
53 |
$design_edit_link = get_admin_url( null, 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '-admin-design' );
|
54 |
}
|
55 |
}
|
56 |
|
57 |
+
if ( class_exists( 'Ecwid_Floating_Minicart' ) ) {
|
58 |
+
$minicart_hide = get_option( Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY ) == Ecwid_Floating_Minicart::DISPLAY_NONE;
|
59 |
+
$customizer_minicart_link = admin_url( 'customize.php' ) . '?autofocus[section]=ec-store-minicart&url=' . rawurlencode( $page_link );
|
60 |
}
|
61 |
|
62 |
+
if ( count( Ecwid_Store_Page::get_store_pages_array_for_selector() ) > 1 ) {
|
63 |
$store_pages = Ecwid_Store_Page::get_store_pages_array_for_selector();
|
64 |
}
|
65 |
|
67 |
|
68 |
$api = new Ecwid_Api_V3();
|
69 |
$res = $api->get_products( array() );
|
70 |
+
if ( $res ) {
|
71 |
+
$products = $res->items;
|
72 |
$products_total = $res->total;
|
73 |
}
|
74 |
|
75 |
$need_show_draft_warning = time() - get_option( 'ecwid_installation_date' ) > 3 * DAY_IN_SECONDS;
|
76 |
} else {
|
77 |
+
$store_on_front = false;
|
78 |
+
$page_edit_link = false;
|
79 |
+
$page_data = false;
|
80 |
+
$design_edit_link = false;
|
81 |
+
$page_slug = false;
|
82 |
+
$minicart_hide = false;
|
83 |
+
$categories = false;
|
84 |
+
$products_total = false;
|
85 |
$customizer_minicart_link = false;
|
86 |
|
87 |
+
if ( ! isset( $page_link ) ) {
|
88 |
+
$page_link = false;
|
89 |
+
}
|
90 |
+
}//end if
|
91 |
|
92 |
+
wp_enqueue_script( 'ecwid-admin-storefront-js', ECWID_PLUGIN_URL . 'js/admin-storefront.js', array(), get_option( 'ecwid_plugin_version' ) );
|
93 |
|
94 |
+
echo Ecwid_Admin_UI_Framework::print_fix_js();
|
95 |
require_once self::$templates_dir . 'main.php';
|
96 |
}
|
97 |
|
98 |
+
public static function get_page_data( $page_id ) {
|
99 |
+
$status = get_post_status( $page_id );
|
100 |
|
101 |
+
if ( ! $status ) {
|
102 |
+
$status = 'no-pages';
|
103 |
+
}
|
104 |
|
105 |
+
if ( $status == 'trash' ) {
|
106 |
+
$status = 'draft';
|
107 |
+
}
|
108 |
|
109 |
+
$page = array(
|
110 |
+
'link' => get_permalink( $page_id ),
|
111 |
+
'edit_link' => get_edit_post_link( $page_id ),
|
112 |
+
'slug' => urldecode( get_post_field( 'post_name', $page_id ) ),
|
113 |
+
'status' => $status,
|
114 |
+
);
|
115 |
|
116 |
+
return $page;
|
117 |
+
}
|
118 |
|
119 |
public function ajax_set_status() {
|
120 |
$page_statuses = array(
|
121 |
0 => 'draft',
|
122 |
+
1 => 'publish',
|
123 |
);
|
124 |
|
125 |
+
if ( ! isset( $_GET['status'] ) ) {
|
126 |
return false;
|
127 |
}
|
128 |
|
129 |
$status = intval( $_GET['status'] );
|
130 |
+
if ( ! array_key_exists( $status, $page_statuses ) ) {
|
131 |
return false;
|
132 |
}
|
133 |
|
134 |
+
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
135 |
+
$new_status = $page_statuses[ $status ];
|
136 |
|
137 |
+
wp_update_post(
|
138 |
+
array(
|
139 |
+
'ID' => $page_id,
|
140 |
+
'post_status' => $new_status,
|
141 |
+
)
|
142 |
+
);
|
143 |
|
144 |
$page_data = self::get_page_data( $page_id );
|
145 |
+
wp_send_json(
|
146 |
+
array(
|
147 |
+
'status' => 'success',
|
148 |
+
'storepage' => $page_data,
|
149 |
+
)
|
150 |
+
);
|
151 |
}
|
152 |
|
153 |
public function ajax_set_store_on_front() {
|
154 |
+
$status = isset( $_GET['status'] ) ? intval( $_GET['status'] ) : false;
|
155 |
|
156 |
+
$store_page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
157 |
|
158 |
+
if ( $status ) {
|
159 |
$this->_set_previous_frontpage_settings();
|
160 |
$page_id = $store_page_id;
|
161 |
+
$type = 'page';
|
162 |
+
} else {
|
163 |
$saved_settings = $this->_get_previous_frontpage_settings();
|
164 |
+
$page_id = $saved_settings['page_on_front'];
|
165 |
+
$type = $saved_settings['show_on_front'];
|
166 |
}
|
167 |
|
168 |
update_option( 'page_on_front', $page_id );
|
169 |
update_option( 'show_on_front', $type );
|
170 |
|
171 |
+
$page_data = self::get_page_data( $store_page_id );
|
172 |
wp_send_json(
|
173 |
+
array(
|
174 |
+
'status' => 'success',
|
175 |
+
'storepage' => $page_data,
|
176 |
+
)
|
177 |
+
);
|
178 |
}
|
179 |
|
180 |
+
public function ajax_set_mainpage() {
|
181 |
+
if ( ! isset( $_GET['page'] ) ) {
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
+
$page_id = intval( $_GET['page'] );
|
186 |
+
|
187 |
+
if ( ! Ecwid_Store_Page::is_store_page( $page_id ) ) {
|
188 |
+
wp_send_json( array( 'status' => 'error' ) );
|
189 |
+
}
|
190 |
+
|
191 |
+
if ( get_option( 'show_on_front' ) == 'page' ) {
|
192 |
+
$front_page_id = get_option( 'page_on_front' );
|
193 |
+
if ( Ecwid_Store_Page::is_store_page( $front_page_id ) ) {
|
194 |
+
update_option( 'page_on_front', $page_id );
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
Ecwid_Store_Page::update_main_store_page_id( $page_id );
|
199 |
+
|
200 |
+
$page_data = self::get_page_data( $page_id );
|
201 |
+
wp_send_json(
|
202 |
+
array(
|
203 |
+
'status' => 'success',
|
204 |
+
'storepage' => $page_data,
|
205 |
+
)
|
206 |
+
);
|
207 |
+
}
|
208 |
|
209 |
public function ajax_set_display_cart_icon() {
|
210 |
+
$status = isset( $_GET['status'] ) ? intval( $_GET['status'] ) : false;
|
211 |
|
212 |
+
if ( $status ) {
|
213 |
update_option( Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, Ecwid_Floating_Minicart::DISPLAY_ALL );
|
214 |
update_option( Ecwid_Floating_Minicart::OPTION_SHOW_EMPTY_CART, 1 );
|
215 |
} else {
|
216 |
update_option( Ecwid_Floating_Minicart::OPTION_WIDGET_DISPLAY, Ecwid_Floating_Minicart::DISPLAY_NONE );
|
217 |
}
|
218 |
+
|
219 |
+
wp_send_json( array( 'status' => 'success' ) );
|
220 |
}
|
221 |
|
222 |
public function ajax_set_page_slug() {
|
223 |
+
if ( ! isset( $_GET['slug'] ) ) {
|
224 |
return;
|
225 |
}
|
226 |
|
227 |
+
$slug = sanitize_text_field( wp_unslash( $_GET['slug'] ) );
|
228 |
|
229 |
+
$args = array(
|
230 |
+
'name' => $slug,
|
231 |
+
'post_type' => 'page',
|
232 |
'post_status' => 'publish',
|
233 |
'numberposts' => 1,
|
234 |
+
'exclude' => get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID ),
|
235 |
);
|
236 |
+
$posts = get_posts( $args );
|
237 |
|
238 |
+
if ( ! $posts ) {
|
239 |
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
240 |
+
wp_update_post(
|
241 |
+
array(
|
242 |
+
'ID' => $page_id,
|
243 |
+
'post_name' => $slug,
|
244 |
+
)
|
245 |
+
);
|
246 |
+
|
247 |
$page_data = self::get_page_data( $page_id );
|
248 |
+
wp_send_json(
|
249 |
+
array(
|
250 |
+
'status' => 'success',
|
251 |
+
'storepage' => $page_data,
|
252 |
+
)
|
253 |
+
);
|
254 |
} else {
|
255 |
wp_send_json(
|
256 |
array(
|
257 |
+
'status' => 'error',
|
258 |
+
'message' => __( 'Page with that name already exists.', 'ecwid-shopping-cart' ),
|
259 |
)
|
260 |
);
|
261 |
+
}//end if
|
262 |
}
|
263 |
|
264 |
public function ajax_create_page() {
|
265 |
+
if ( ! isset( $_GET['type'] ) ) {
|
266 |
return;
|
267 |
}
|
268 |
|
269 |
+
$type = sanitize_text_field( wp_unslash( $_GET['type'] ) );
|
270 |
|
271 |
+
if ( isset( $_GET['item_id'] ) ) {
|
272 |
$item_id = intval( $_GET['item_id'] );
|
273 |
} else {
|
274 |
$item_id = '';
|
275 |
}
|
276 |
|
277 |
$pages = array(
|
278 |
+
'store' => array(
|
279 |
+
'title' => __( 'Store', 'ecwid-shopping-cart' ),
|
280 |
+
'block' => 'ecwid/store-block',
|
281 |
'block_add_shortcode' => true,
|
282 |
+
'params' => array(
|
283 |
+
'default_category_id' => '',
|
284 |
+
),
|
285 |
),
|
286 |
'category' => array(
|
287 |
+
'title' => __( 'Category', 'ecwid-shopping-cart' ),
|
288 |
+
'block' => 'ec-store/category-page',
|
289 |
'params' => array(
|
290 |
+
'default_category_id' => $item_id,
|
291 |
+
),
|
292 |
),
|
293 |
+
'product' => array(
|
294 |
+
'title' => __( 'Product', 'ecwid-shopping-cart' ),
|
295 |
+
'block' => 'ec-store/product-page',
|
296 |
'params' => array(
|
297 |
+
'default_product_id' => $item_id,
|
298 |
+
),
|
299 |
),
|
300 |
+
'cart' => array(
|
301 |
+
'title' => __( 'Cart', 'ecwid-shopping-cart' ),
|
302 |
+
'block' => 'ec-store/cart-page',
|
303 |
'params' => array(
|
304 |
+
'default_page' => 'cart',
|
305 |
+
),
|
306 |
),
|
307 |
+
'search' => array(
|
308 |
+
'title' => __( 'Search products', 'ecwid-shopping-cart' ),
|
309 |
+
'block' => 'ec-store/filters-page',
|
310 |
'params' => array(
|
311 |
+
'default_page' => 'search',
|
312 |
+
),
|
313 |
+
),
|
314 |
);
|
315 |
|
316 |
+
if ( ! isset( $pages[ $type ] ) ) {
|
317 |
+
wp_send_json( array( 'status' => 'error' ) );
|
318 |
}
|
319 |
|
320 |
+
$page = $pages[ $type ];
|
321 |
|
322 |
+
if ( $type == 'product' && $item_id > 0 ) {
|
323 |
+
$api = new Ecwid_Api_V3();
|
324 |
$product = $api->get_product( $item_id );
|
325 |
|
326 |
+
if ( $product ) {
|
327 |
$page['title'] = $product->name;
|
328 |
}
|
329 |
}
|
330 |
|
331 |
+
if ( $type == 'category' && $item_id > 0 ) {
|
332 |
+
$api = new Ecwid_Api_V3();
|
333 |
$product = $api->get_category( $item_id );
|
334 |
|
335 |
+
if ( $product ) {
|
336 |
$page['title'] = $product->name;
|
337 |
}
|
338 |
}
|
339 |
|
340 |
+
if ( ! isset( $page['params'] ) ) {
|
341 |
$page['params'] = array();
|
342 |
}
|
343 |
|
344 |
$shortcode_params = '';
|
345 |
+
foreach ( $page['params'] as $key => $value ) {
|
346 |
$shortcode_params .= sprintf( '%s="%s"', $key, $value );
|
347 |
}
|
348 |
|
349 |
$shortcode = sprintf( '[ec_store widgets="productbrowser" %s]', $shortcode_params );
|
350 |
|
351 |
+
if ( self::is_gutenberg_active() ) {
|
352 |
+
if ( count( $page['params'] ) ) {
|
353 |
$block_params = json_encode( $page['params'] );
|
354 |
} else {
|
355 |
$block_params = '';
|
356 |
}
|
357 |
|
358 |
+
if ( isset( $page['block_add_shortcode'] ) && $page['block_add_shortcode'] ) {
|
359 |
+
$shortcode = str_replace( 'ec_store', 'ecwid', $shortcode );
|
360 |
+
$content = sprintf( '<!-- wp:%1$s %2$s -->%3$s<!-- /wp:%1$s -->', $page['block'], $block_params, $shortcode );
|
361 |
} else {
|
362 |
$content = sprintf( '<!-- wp:%1$s %2$s /-->', $page['block'], $block_params );
|
363 |
}
|
366 |
}
|
367 |
|
368 |
$post = array(
|
369 |
+
'post_title' => $page['title'],
|
370 |
+
'post_content' => $content,
|
371 |
+
'post_status' => 'draft',
|
372 |
+
'post_author' => 1,
|
373 |
+
'post_type' => 'page',
|
374 |
+
'comment_status' => 'closed',
|
375 |
);
|
376 |
+
|
377 |
$page_id = wp_insert_post( $post );
|
378 |
+
$url = get_edit_post_link( $page_id, 'context' );
|
379 |
|
380 |
+
if ( $type != 'store' ) {
|
381 |
$page_id = get_option( Ecwid_Store_Page::OPTION_MAIN_STORE_PAGE_ID );
|
382 |
}
|
383 |
$page_data = self::get_page_data( $page_id );
|
384 |
|
385 |
+
wp_send_json(
|
386 |
+
array(
|
387 |
+
'status' => 'success',
|
388 |
+
'url' => $url,
|
389 |
+
'storepage' => $page_data,
|
390 |
+
'open_page' => ( $type != 'store' ),
|
391 |
+
)
|
392 |
+
);
|
393 |
}
|
394 |
|
395 |
private function _set_previous_frontpage_settings() {
|
396 |
$settings = array(
|
397 |
'page_on_front' => get_option( 'page_on_front' ),
|
398 |
+
'show_on_front' => get_option( 'show_on_front' ),
|
399 |
);
|
400 |
|
401 |
update_option( 'ecwid_frontpage_settings', $settings );
|
404 |
private function _get_previous_frontpage_settings() {
|
405 |
$settings = get_option( 'ecwid_frontpage_settings', false );
|
406 |
|
407 |
+
if ( ! $settings ) {
|
408 |
$settings = array(
|
409 |
'page_on_front' => 0,
|
410 |
+
'show_on_front' => 'posts',
|
411 |
);
|
412 |
}
|
413 |
|
415 |
}
|
416 |
|
417 |
public static function is_gutenberg_active() {
|
418 |
+
$version = get_bloginfo( 'version' );
|
419 |
|
420 |
if ( version_compare( $version, '5.0' ) < 0 ) {
|
421 |
+
|
422 |
+
if ( is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
|
423 |
return true;
|
424 |
}
|
425 |
|
432 |
'divi-builder/divi-builder.php',
|
433 |
'beaver-builder-lite-version/fl-builder.php',
|
434 |
'disable-gutenberg/disable-gutenberg.php',
|
435 |
+
'js_composer/js_composer.php',
|
436 |
);
|
437 |
|
438 |
foreach ( $plugins_disabling_gutenberg as $plugin ) {
|
440 |
return false;
|
441 |
}
|
442 |
|
443 |
+
// check Divi builder from themes
|
444 |
+
if ( defined( 'ET_BUILDER_THEME' ) && ET_BUILDER_THEME ) {
|
445 |
return false;
|
446 |
}
|
447 |
}
|
450 |
}
|
451 |
|
452 |
public function register_script_for_select_block() {
|
453 |
+
|
454 |
+
if ( ! array_key_exists( 'ec-show-store-settings', $_GET ) ) {
|
455 |
return;
|
456 |
}
|
457 |
|
481 |
";
|
482 |
|
483 |
wp_register_script( 'ec-blockeditor-inline-js', '', array(), '', true );
|
484 |
+
wp_enqueue_script( 'ec-blockeditor-inline-js' );
|
485 |
wp_add_inline_script( 'ec-blockeditor-inline-js', $script );
|
486 |
}
|
487 |
|
488 |
+
public static function render_dropdown_list_items( $items ) {
|
489 |
+
if ( ! is_array( $items ) ) {
|
490 |
+
return false;
|
491 |
+
}
|
492 |
+
|
493 |
+
foreach ( $items as $key => $item ) {
|
494 |
+
$attributes = '';
|
495 |
+
$text = '';
|
496 |
+
|
497 |
+
if ( isset( $item['is_separator'] ) && $item['is_separator'] ) {
|
498 |
+
echo '<li class="list-dropdown__separator"></li>';
|
499 |
+
continue;
|
500 |
+
}
|
501 |
+
|
502 |
+
if ( isset( $item['attributes'] ) && is_array( $item['attributes'] ) ) {
|
503 |
+
foreach ( $item['attributes'] as $attribute => $attribute_value ) {
|
504 |
+
$attributes .= sprintf( ' %s="%s"', $attribute, $attribute_value );
|
505 |
+
}
|
506 |
+
}
|
507 |
+
|
508 |
+
if ( isset( $item['text'] ) ) {
|
509 |
+
$text = $item['text'];
|
510 |
+
}
|
511 |
+
|
512 |
+
echo sprintf( '<li><a%s>%s</a></li>', $attributes, $text );
|
513 |
+
}//end foreach
|
514 |
+
}
|
515 |
+
|
516 |
+
public static function get_dropdown_items( $status, $page_data ) {
|
517 |
+
|
518 |
+
if ( empty( $page_data ) ) {
|
519 |
+
return;
|
520 |
+
}
|
521 |
+
|
522 |
+
extract( $page_data, EXTR_PREFIX_ALL, 'page' );
|
523 |
+
|
524 |
+
$items['publish'] = array(
|
525 |
+
array(
|
526 |
+
'text' => __( 'View store page', 'ecwid-shopping-cart' ),
|
527 |
+
'attributes' => array(
|
528 |
+
'href' => $page_link,
|
529 |
+
'target' => '_blank',
|
530 |
+
),
|
531 |
+
),
|
532 |
+
array(
|
533 |
+
'text' => __( 'Edit page', 'ecwid-shopping-cart' ),
|
534 |
+
'attributes' => array(
|
535 |
+
'href' => $page_edit_link,
|
536 |
+
'target' => '_blank',
|
537 |
+
),
|
538 |
+
),
|
539 |
+
array(
|
540 |
+
'is_separator' => 1,
|
541 |
+
),
|
542 |
+
array(
|
543 |
+
'text' => __( 'Switch to draft', 'ecwid-shopping-cart' ),
|
544 |
+
'attributes' => array(
|
545 |
+
'data-storefront-status' => '0',
|
546 |
+
),
|
547 |
+
),
|
548 |
+
);
|
549 |
+
|
550 |
+
$items['draft'] = array(
|
551 |
+
array(
|
552 |
+
'text' => __( 'Preview', 'ecwid-shopping-cart' ),
|
553 |
+
'attributes' => array(
|
554 |
+
'href' => $page_link,
|
555 |
+
'target' => '_blank',
|
556 |
+
),
|
557 |
+
),
|
558 |
+
array(
|
559 |
+
'text' => __( 'Edit', 'ecwid-shopping-cart' ),
|
560 |
+
'attributes' => array(
|
561 |
+
'href' => $page_edit_link,
|
562 |
+
'target' => '_blank',
|
563 |
+
),
|
564 |
+
),
|
565 |
+
array(
|
566 |
+
'text' => __( 'Publish', 'ecwid-shopping-cart' ),
|
567 |
+
'attributes' => array(
|
568 |
+
'data-storefront-status' => '1',
|
569 |
+
),
|
570 |
+
),
|
571 |
+
);
|
572 |
+
|
573 |
+
if ( isset( $items[ $status ] ) ) {
|
574 |
+
return $items[ $status ];
|
575 |
+
}
|
576 |
+
|
577 |
+
return false;
|
578 |
+
}
|
579 |
+
|
580 |
+
public static function get_page_url() {
|
581 |
return admin_url( self::get_relative_page_url() );
|
582 |
}
|
583 |
|
584 |
+
public static function get_relative_page_url() {
|
585 |
return 'admin.php?page=' . self::ADMIN_SLUG;
|
586 |
}
|
587 |
}
|
588 |
|
589 |
+
$_ecwid_admin_storefront_page = new Ecwid_Admin_Storefront_Page();
|
includes/class-ecwid-sitemap-builder.php
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
class EcwidSitemapBuilder {
|
5 |
var $callback;
|
6 |
var $type;
|
1 |
<?php
|
|
|
|
|
2 |
class EcwidSitemapBuilder {
|
3 |
var $callback;
|
4 |
var $type;
|
includes/gutenberg/class-ecwid-gutenberg-block-store.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
|
5 |
class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
6 |
-
|
7 |
protected $_name = 'store';
|
8 |
|
9 |
public function get_block_name() {
|
@@ -12,61 +12,62 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
12 |
|
13 |
public function get_params() {
|
14 |
|
15 |
-
$request_uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : '';
|
16 |
|
17 |
$params = array(
|
18 |
-
'attributes'
|
19 |
-
'isNewProductList'
|
20 |
-
'isNewDetailsPage'
|
21 |
'isEnabledProductSubtitles' => $this->_is_enabled_product_subtitles(),
|
22 |
-
'storeBlockTitle'
|
23 |
-
'shortcodeName'
|
24 |
-
'title'
|
25 |
-
'icon'=> self::get_icon_path(),
|
26 |
-
'isDemoStore'
|
27 |
-
'customizeMinicartText'
|
28 |
sprintf(
|
29 |
__(
|
30 |
'You can enable an extra shopping bag icon widget that will appear on your site pages. Open “<a href="%1$s">Appearance → Customize → %2$s</a>” menu to enable it.',
|
31 |
'ecwid-shopping-cart'
|
32 |
),
|
33 |
-
'customize.php?autofocus[section]=' . Ecwid_Customizer::SECTION_MINICART . '&return=' . rawurlencode(
|
|
|
34 |
),
|
35 |
Ecwid_Config::get_brand()
|
36 |
),
|
37 |
);
|
38 |
-
|
39 |
$params = array_merge(
|
40 |
$params,
|
41 |
$this->_get_common_block_params()
|
42 |
);
|
43 |
-
|
44 |
return $params;
|
45 |
}
|
46 |
|
47 |
public function render_callback( $params ) {
|
48 |
-
|
49 |
$print_js_refresh_config = false;
|
50 |
-
$is_wp_customize
|
51 |
-
$is_get_request
|
52 |
|
53 |
-
if (
|
54 |
return '';
|
55 |
}
|
56 |
|
57 |
-
$result =
|
58 |
-
|
59 |
$params['widgets'] = 'productbrowser';
|
60 |
-
if ( isset($params['show_categories']) ) {
|
61 |
$params['widgets'] .= ' categories';
|
62 |
}
|
63 |
-
if ( isset($params['show_search']) ) {
|
64 |
$params['widgets'] .= ' search';
|
65 |
}
|
66 |
|
67 |
-
foreach ($params as $key => $value) {
|
68 |
-
if( is_object($value) || is_array($value) ) {
|
69 |
-
$value = json_encode($value);
|
70 |
}
|
71 |
|
72 |
$result .= " $key='$value'";
|
@@ -79,23 +80,23 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
79 |
$attributes = $this->get_attributes_for_editor();
|
80 |
|
81 |
$store_page_data = array();
|
82 |
-
|
83 |
foreach ( $attributes as $key => $attribute ) {
|
84 |
|
85 |
$name = $attribute['name'];
|
86 |
-
if ( !isset( $params[$name] ) ) {
|
87 |
-
$store_page_data[$name] = $attribute['default'];
|
88 |
-
}
|
89 |
-
|
90 |
$value = null;
|
91 |
|
92 |
-
if ( isset( $params[$name] ) ) {
|
93 |
-
$value = $params[$name];
|
94 |
}
|
95 |
|
96 |
if ( $name == 'show_description_under_image' ) {
|
97 |
|
98 |
-
$layout = ( isset($params['product_details_layout']) ) ? $params['product_details_layout'] : null;
|
99 |
if ( is_null( $layout ) ) {
|
100 |
$layout = $attributes['product_details_layout']['default'];
|
101 |
}
|
@@ -104,34 +105,34 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
104 |
if ( in_array( $layout, $applicableLayouts ) ) {
|
105 |
if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT' ) {
|
106 |
$name = 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar';
|
107 |
-
}
|
108 |
$name = 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar';
|
109 |
}
|
110 |
|
111 |
$attribute['is_storefront_api'] = true;
|
112 |
|
113 |
-
$api
|
114 |
$settings = $api->get_store_profile();
|
115 |
|
116 |
-
if( $settings ){
|
117 |
-
$design_settings
|
118 |
-
$value
|
119 |
$attribute['profile_default'] = $design_settings->$name;
|
120 |
}
|
121 |
}
|
122 |
-
}
|
123 |
|
124 |
-
if( $name == 'storefront_view' && !isset($params['default_category_id']) ) {
|
125 |
|
126 |
-
if( $value !== 'FILTERS_PAGE' ) {
|
127 |
-
$attribute['type']
|
128 |
$attribute['is_storefront_api'] = true;
|
129 |
|
130 |
-
foreach ($attribute['values'] as $item) {
|
131 |
-
if( $item['value'] == $value ) {
|
132 |
$selected_attribute = $item;
|
133 |
-
|
134 |
-
$name
|
135 |
$value = $selected_attribute['config_value'];
|
136 |
|
137 |
break;
|
@@ -139,37 +140,37 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
139 |
}
|
140 |
} else {
|
141 |
$is_need_open_filter_page = true;
|
142 |
-
$config_js[]
|
143 |
}
|
144 |
-
}
|
145 |
|
146 |
-
if ( isset($attribute['is_storefront_api']) && $attribute['is_storefront_api'] && strpos( $name, 'chameleon') === false ) {
|
147 |
|
148 |
if ( is_null( $value ) ) {
|
149 |
$value = $attribute['default'];
|
150 |
}
|
151 |
-
|
152 |
-
$profile_default
|
153 |
-
? $attribute['profile_default']
|
154 |
: $attribute['default'];
|
155 |
$is_profile_default = $profile_default === $value;
|
156 |
|
157 |
-
if (
|
158 |
-
if ( @$attribute['type'] == 'boolean') {
|
159 |
-
$config_js[] = 'window.ec.storefront.' . $name .
|
160 |
} else {
|
161 |
$config_js[] = 'window.ec.storefront.' . $name . "='" . $value . "';";
|
162 |
}
|
163 |
-
$store_page_data[$name] = $value;
|
164 |
}
|
165 |
}
|
166 |
-
}
|
167 |
|
168 |
$colors = array();
|
169 |
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
|
170 |
-
$color = ( isset($params['chameleon_color_' . $kind]) ) ? $params['chameleon_color_' . $kind] : false;
|
171 |
if ( $color ) {
|
172 |
-
$colors['color-' . $kind] = $color;
|
173 |
}
|
174 |
}
|
175 |
|
@@ -177,18 +178,18 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
177 |
$colors = 'auto';
|
178 |
}
|
179 |
|
180 |
-
$colors = json_encode($colors);
|
181 |
|
182 |
$chameleon = apply_filters( 'ecwid_chameleon_settings', array( 'colors' => $colors ) );
|
183 |
|
184 |
-
if ( !is_array($chameleon ) ) {
|
185 |
$chameleon = array(
|
186 |
'colors' => $colors,
|
187 |
);
|
188 |
}
|
189 |
|
190 |
-
if ( !isset( $chameleon['colors'] ) ) {
|
191 |
-
$chameleon['colors'] = json_encode($colors);
|
192 |
}
|
193 |
|
194 |
$store_page_data['chameleon-colors'] = $chameleon['colors'];
|
@@ -201,20 +202,20 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
201 |
$chameleon_config_js .= 'window.ec.config.chameleon.colors = ' . $chameleon['colors'] . ';' . PHP_EOL;
|
202 |
}
|
203 |
|
204 |
-
if( count($config_js) || !empty($chameleon_config_js) ) {
|
205 |
$result .= '<script data-cfasync="false" type="text/javascript">' . PHP_EOL;
|
206 |
$result .= 'window.ec = window.ec || Object();' . PHP_EOL;
|
207 |
-
|
208 |
-
if( count($config_js) ) {
|
209 |
$result .= 'window.ec.storefront = window.ec.storefront || Object();' . PHP_EOL;
|
210 |
-
$result .= implode(PHP_EOL, $config_js) . PHP_EOL;
|
211 |
}
|
212 |
-
|
213 |
$result .= $chameleon_config_js;
|
214 |
$result .= '</script>' . PHP_EOL;
|
215 |
}
|
216 |
|
217 |
-
if( isset($is_need_open_filter_page) && class_exists('Ecwid_Gutenberg_Block_Filters_Page') ) {
|
218 |
$result .= Ecwid_Gutenberg_Block_Filters_Page::get_script_for_open_filters_page();
|
219 |
}
|
220 |
|
@@ -231,10 +232,10 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
231 |
}
|
232 |
|
233 |
$attributes = Ecwid_Product_Browser::get_attributes();
|
234 |
-
|
235 |
-
$to_remove
|
236 |
'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
237 |
-
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar'
|
238 |
);
|
239 |
foreach ( $to_remove as $name ) {
|
240 |
unset( $attributes[ $name ] );
|
@@ -244,7 +245,7 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
244 |
'name' => 'show_description_under_image',
|
245 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
246 |
'default' => false,
|
247 |
-
'type' => 'boolean'
|
248 |
);
|
249 |
|
250 |
foreach ( $attributes as $key => $attribute ) {
|
@@ -255,13 +256,13 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
255 |
$default = $settings->$name;
|
256 |
}
|
257 |
|
258 |
-
if( $name == 'storefront_view' && isset($settings->enable_catalog_on_one_page) && $settings->enable_catalog_on_one_page ) {
|
259 |
$default = 'EXPAND_CATEGORIES';
|
260 |
}
|
261 |
|
262 |
$prop_to_default_exceptions = array(
|
263 |
'product_list_category_image_aspect_ratio' => 'product_list_image_aspect_ratio',
|
264 |
-
'product_list_category_image_size' => 'product_list_image_size'
|
265 |
);
|
266 |
|
267 |
if ( array_key_exists( $name, $prop_to_default_exceptions ) ) {
|
@@ -272,9 +273,9 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
272 |
}
|
273 |
|
274 |
if ( $default !== null ) {
|
275 |
-
$attributes[$key]['profile_default'] = $attributes[ $key ]['default'] = $default;
|
276 |
}
|
277 |
-
}
|
278 |
|
279 |
$categories = ecwid_get_categories_for_selector();
|
280 |
|
@@ -282,13 +283,13 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
282 |
$attributes['default_category_id']['values'] = array(
|
283 |
array(
|
284 |
'value' => '0',
|
285 |
-
'title' => __( 'Store root category', 'ecwid-shopping-cart' )
|
286 |
-
)
|
287 |
);
|
288 |
foreach ( $categories as $category ) {
|
289 |
$attributes['default_category_id']['values'][] = array(
|
290 |
'value' => $category->id,
|
291 |
-
'title' => $category->name
|
292 |
);
|
293 |
}
|
294 |
|
@@ -300,33 +301,36 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
300 |
if ( $cats && $cats->total == 0 ) {
|
301 |
unset( $attributes['default_category_id'] );
|
302 |
}
|
303 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
|
305 |
-
$attributes['widgets'] = array( 'type' => 'string', 'default' => '', 'name' => 'widgets' );
|
306 |
-
|
307 |
return $attributes;
|
308 |
}
|
309 |
|
310 |
protected function _is_new_product_list() {
|
311 |
$api = new Ecwid_Api_V3();
|
312 |
|
313 |
-
return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
|
314 |
}
|
315 |
|
316 |
protected function _is_new_details_page() {
|
317 |
$api = new Ecwid_Api_V3();
|
318 |
|
319 |
-
return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_DETAILS_PAGE );
|
320 |
}
|
321 |
|
322 |
protected function _is_enabled_product_subtitles() {
|
323 |
$api = new Ecwid_Api_V3();
|
324 |
|
325 |
-
return $api->is_store_feature_available(Ecwid_Api_V3::FEATURE_PRODUCT_SUBTITLES);
|
326 |
}
|
327 |
|
328 |
-
public function get_icon_path()
|
329 |
-
{
|
330 |
return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
|
331 |
C15.98,15.88,15.69,15.58,15.32,15.58z M15.45,0H4.55C2.04,0,0,2.04,0,4.55v10.91C0,17.97,2.04,20,4.55,20h10.91c2.51,0,4.55-2.04,4.55-4.55V4.55
|
332 |
C20,2.04,17.96,0,15.45,0z M12.97,4.94C13.54,4.94,14,5.4,14,5.96s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03
|
@@ -344,4 +348,4 @@ class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
|
344 |
S4.96,15.5,4.6,15.5z';
|
345 |
}
|
346 |
|
347 |
-
}
|
3 |
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
|
5 |
class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
protected $_name = 'store';
|
8 |
|
9 |
public function get_block_name() {
|
12 |
|
13 |
public function get_params() {
|
14 |
|
15 |
+
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
|
16 |
|
17 |
$params = array(
|
18 |
+
'attributes' => $this->get_attributes_for_editor(),
|
19 |
+
'isNewProductList' => $this->_is_new_product_list(),
|
20 |
+
'isNewDetailsPage' => $this->_is_new_details_page(),
|
21 |
'isEnabledProductSubtitles' => $this->_is_enabled_product_subtitles(),
|
22 |
+
'storeBlockTitle' => _x( 'Store', 'gutenberg-store-block-stub', 'ecwid-shopping-cart' ),
|
23 |
+
'shortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
|
24 |
+
'title' => __( 'Store Home Page', 'ecwid-shopping-cart' ),
|
25 |
+
'icon' => self::get_icon_path(),
|
26 |
+
'isDemoStore' => ecwid_is_demo_store(),
|
27 |
+
'customizeMinicartText' =>
|
28 |
sprintf(
|
29 |
__(
|
30 |
'You can enable an extra shopping bag icon widget that will appear on your site pages. Open “<a href="%1$s">Appearance → Customize → %2$s</a>” menu to enable it.',
|
31 |
'ecwid-shopping-cart'
|
32 |
),
|
33 |
+
'customize.php?autofocus[section]=' . Ecwid_Customizer::SECTION_MINICART . '&return=' . rawurlencode(
|
34 |
+
remove_query_arg( wp_removable_query_args(), $request_uri )
|
35 |
),
|
36 |
Ecwid_Config::get_brand()
|
37 |
),
|
38 |
);
|
39 |
+
|
40 |
$params = array_merge(
|
41 |
$params,
|
42 |
$this->_get_common_block_params()
|
43 |
);
|
44 |
+
|
45 |
return $params;
|
46 |
}
|
47 |
|
48 |
public function render_callback( $params ) {
|
49 |
+
|
50 |
$print_js_refresh_config = false;
|
51 |
+
$is_wp_customize = isset( $_REQUEST['wp_customize'] ) && $_REQUEST['wp_customize'] == 'on';
|
52 |
+
$is_get_request = isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] == 'GET';
|
53 |
|
54 |
+
if ( ! $is_get_request && ! $is_wp_customize ) {
|
55 |
return '';
|
56 |
}
|
57 |
|
58 |
+
$result = '[ecwid';
|
59 |
+
|
60 |
$params['widgets'] = 'productbrowser';
|
61 |
+
if ( isset( $params['show_categories'] ) ) {
|
62 |
$params['widgets'] .= ' categories';
|
63 |
}
|
64 |
+
if ( isset( $params['show_search'] ) ) {
|
65 |
$params['widgets'] .= ' search';
|
66 |
}
|
67 |
|
68 |
+
foreach ( $params as $key => $value ) {
|
69 |
+
if ( is_object( $value ) || is_array( $value ) ) {
|
70 |
+
$value = json_encode( $value );
|
71 |
}
|
72 |
|
73 |
$result .= " $key='$value'";
|
80 |
$attributes = $this->get_attributes_for_editor();
|
81 |
|
82 |
$store_page_data = array();
|
83 |
+
|
84 |
foreach ( $attributes as $key => $attribute ) {
|
85 |
|
86 |
$name = $attribute['name'];
|
87 |
+
if ( ! isset( $params[ $name ] ) ) {
|
88 |
+
$store_page_data[ $name ] = $attribute['default'];
|
89 |
+
}
|
90 |
+
|
91 |
$value = null;
|
92 |
|
93 |
+
if ( isset( $params[ $name ] ) ) {
|
94 |
+
$value = $params[ $name ];
|
95 |
}
|
96 |
|
97 |
if ( $name == 'show_description_under_image' ) {
|
98 |
|
99 |
+
$layout = ( isset( $params['product_details_layout'] ) ) ? $params['product_details_layout'] : null;
|
100 |
if ( is_null( $layout ) ) {
|
101 |
$layout = $attributes['product_details_layout']['default'];
|
102 |
}
|
105 |
if ( in_array( $layout, $applicableLayouts ) ) {
|
106 |
if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT' ) {
|
107 |
$name = 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar';
|
108 |
+
} elseif ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT' ) {
|
109 |
$name = 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar';
|
110 |
}
|
111 |
|
112 |
$attribute['is_storefront_api'] = true;
|
113 |
|
114 |
+
$api = new Ecwid_Api_V3();
|
115 |
$settings = $api->get_store_profile();
|
116 |
|
117 |
+
if ( $settings ) {
|
118 |
+
$design_settings = $settings->designSettings;
|
119 |
+
$value = isset( $params['show_description_under_image'] ) ? ! $params['show_description_under_image'] : $design_settings->$name;
|
120 |
$attribute['profile_default'] = $design_settings->$name;
|
121 |
}
|
122 |
}
|
123 |
+
}//end if
|
124 |
|
125 |
+
if ( $name == 'storefront_view' && ! isset( $params['default_category_id'] ) ) {
|
126 |
|
127 |
+
if ( $value !== 'FILTERS_PAGE' ) {
|
128 |
+
$attribute['type'] = 'boolean';
|
129 |
$attribute['is_storefront_api'] = true;
|
130 |
|
131 |
+
foreach ( $attribute['values'] as $item ) {
|
132 |
+
if ( $item['value'] == $value ) {
|
133 |
$selected_attribute = $item;
|
134 |
+
|
135 |
+
$name = $selected_attribute['config_name'];
|
136 |
$value = $selected_attribute['config_value'];
|
137 |
|
138 |
break;
|
140 |
}
|
141 |
} else {
|
142 |
$is_need_open_filter_page = true;
|
143 |
+
$config_js[] = 'window.ec.storefront.show_breadcrumbs=false';
|
144 |
}
|
145 |
+
}//end if
|
146 |
|
147 |
+
if ( isset( $attribute['is_storefront_api'] ) && $attribute['is_storefront_api'] && strpos( $name, 'chameleon' ) === false ) {
|
148 |
|
149 |
if ( is_null( $value ) ) {
|
150 |
$value = $attribute['default'];
|
151 |
}
|
152 |
+
|
153 |
+
$profile_default = isset( $attribute['profile_default'] )
|
154 |
+
? $attribute['profile_default']
|
155 |
: $attribute['default'];
|
156 |
$is_profile_default = $profile_default === $value;
|
157 |
|
158 |
+
if ( ! $is_profile_default ) {
|
159 |
+
if ( @$attribute['type'] == 'boolean' ) {
|
160 |
+
$config_js[] = 'window.ec.storefront.' . $name . '=' . ( $value === true ? 'true' : 'false' ) . ';';
|
161 |
} else {
|
162 |
$config_js[] = 'window.ec.storefront.' . $name . "='" . $value . "';";
|
163 |
}
|
164 |
+
$store_page_data[ $name ] = $value;
|
165 |
}
|
166 |
}
|
167 |
+
}//end foreach
|
168 |
|
169 |
$colors = array();
|
170 |
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
|
171 |
+
$color = ( isset( $params[ 'chameleon_color_' . $kind ] ) ) ? $params[ 'chameleon_color_' . $kind ] : false;
|
172 |
if ( $color ) {
|
173 |
+
$colors[ 'color-' . $kind ] = $color;
|
174 |
}
|
175 |
}
|
176 |
|
178 |
$colors = 'auto';
|
179 |
}
|
180 |
|
181 |
+
$colors = json_encode( $colors );
|
182 |
|
183 |
$chameleon = apply_filters( 'ecwid_chameleon_settings', array( 'colors' => $colors ) );
|
184 |
|
185 |
+
if ( ! is_array( $chameleon ) ) {
|
186 |
$chameleon = array(
|
187 |
'colors' => $colors,
|
188 |
);
|
189 |
}
|
190 |
|
191 |
+
if ( ! isset( $chameleon['colors'] ) ) {
|
192 |
+
$chameleon['colors'] = json_encode( $colors );
|
193 |
}
|
194 |
|
195 |
$store_page_data['chameleon-colors'] = $chameleon['colors'];
|
202 |
$chameleon_config_js .= 'window.ec.config.chameleon.colors = ' . $chameleon['colors'] . ';' . PHP_EOL;
|
203 |
}
|
204 |
|
205 |
+
if ( count( $config_js ) || ! empty( $chameleon_config_js ) ) {
|
206 |
$result .= '<script data-cfasync="false" type="text/javascript">' . PHP_EOL;
|
207 |
$result .= 'window.ec = window.ec || Object();' . PHP_EOL;
|
208 |
+
|
209 |
+
if ( count( $config_js ) ) {
|
210 |
$result .= 'window.ec.storefront = window.ec.storefront || Object();' . PHP_EOL;
|
211 |
+
$result .= implode( PHP_EOL, $config_js ) . PHP_EOL;
|
212 |
}
|
213 |
+
|
214 |
$result .= $chameleon_config_js;
|
215 |
$result .= '</script>' . PHP_EOL;
|
216 |
}
|
217 |
|
218 |
+
if ( isset( $is_need_open_filter_page ) && class_exists( 'Ecwid_Gutenberg_Block_Filters_Page' ) ) {
|
219 |
$result .= Ecwid_Gutenberg_Block_Filters_Page::get_script_for_open_filters_page();
|
220 |
}
|
221 |
|
232 |
}
|
233 |
|
234 |
$attributes = Ecwid_Product_Browser::get_attributes();
|
235 |
+
|
236 |
+
$to_remove = array(
|
237 |
'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
238 |
+
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar',
|
239 |
);
|
240 |
foreach ( $to_remove as $name ) {
|
241 |
unset( $attributes[ $name ] );
|
245 |
'name' => 'show_description_under_image',
|
246 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
247 |
'default' => false,
|
248 |
+
'type' => 'boolean',
|
249 |
);
|
250 |
|
251 |
foreach ( $attributes as $key => $attribute ) {
|
256 |
$default = $settings->$name;
|
257 |
}
|
258 |
|
259 |
+
if ( $name == 'storefront_view' && isset( $settings->enable_catalog_on_one_page ) && $settings->enable_catalog_on_one_page ) {
|
260 |
$default = 'EXPAND_CATEGORIES';
|
261 |
}
|
262 |
|
263 |
$prop_to_default_exceptions = array(
|
264 |
'product_list_category_image_aspect_ratio' => 'product_list_image_aspect_ratio',
|
265 |
+
'product_list_category_image_size' => 'product_list_image_size',
|
266 |
);
|
267 |
|
268 |
if ( array_key_exists( $name, $prop_to_default_exceptions ) ) {
|
273 |
}
|
274 |
|
275 |
if ( $default !== null ) {
|
276 |
+
$attributes[ $key ]['profile_default'] = $attributes[ $key ]['default'] = $default;
|
277 |
}
|
278 |
+
}//end foreach
|
279 |
|
280 |
$categories = ecwid_get_categories_for_selector();
|
281 |
|
283 |
$attributes['default_category_id']['values'] = array(
|
284 |
array(
|
285 |
'value' => '0',
|
286 |
+
'title' => __( 'Store root category', 'ecwid-shopping-cart' ),
|
287 |
+
),
|
288 |
);
|
289 |
foreach ( $categories as $category ) {
|
290 |
$attributes['default_category_id']['values'][] = array(
|
291 |
'value' => $category->id,
|
292 |
+
'title' => $category->name,
|
293 |
);
|
294 |
}
|
295 |
|
301 |
if ( $cats && $cats->total == 0 ) {
|
302 |
unset( $attributes['default_category_id'] );
|
303 |
}
|
304 |
+
}//end if
|
305 |
+
|
306 |
+
$attributes['widgets'] = array(
|
307 |
+
'type' => 'string',
|
308 |
+
'default' => '',
|
309 |
+
'name' => 'widgets',
|
310 |
+
);
|
311 |
|
|
|
|
|
312 |
return $attributes;
|
313 |
}
|
314 |
|
315 |
protected function _is_new_product_list() {
|
316 |
$api = new Ecwid_Api_V3();
|
317 |
|
318 |
+
return ecwid_is_demo_store() || ! Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
|
319 |
}
|
320 |
|
321 |
protected function _is_new_details_page() {
|
322 |
$api = new Ecwid_Api_V3();
|
323 |
|
324 |
+
return ecwid_is_demo_store() || ! Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_DETAILS_PAGE );
|
325 |
}
|
326 |
|
327 |
protected function _is_enabled_product_subtitles() {
|
328 |
$api = new Ecwid_Api_V3();
|
329 |
|
330 |
+
return $api->is_store_feature_available( Ecwid_Api_V3::FEATURE_PRODUCT_SUBTITLES );
|
331 |
}
|
332 |
|
333 |
+
public function get_icon_path() {
|
|
|
334 |
return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
|
335 |
C15.98,15.88,15.69,15.58,15.32,15.58z M15.45,0H4.55C2.04,0,0,2.04,0,4.55v10.91C0,17.97,2.04,20,4.55,20h10.91c2.51,0,4.55-2.04,4.55-4.55V4.55
|
336 |
C20,2.04,17.96,0,15.45,0z M12.97,4.94C13.54,4.94,14,5.4,14,5.96s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03
|
348 |
S4.96,15.5,4.6,15.5z';
|
349 |
}
|
350 |
|
351 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg.php
CHANGED
@@ -1,108 +1,107 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-product-browser.php';
|
4 |
|
5 |
class Ecwid_Gutenberg {
|
6 |
-
|
7 |
-
const STORE_BLOCK
|
8 |
-
const PRODUCT_BLOCK
|
9 |
-
const BUYNOW_BLOCK
|
10 |
-
const PRODUCT_PAGE_BLOCK
|
11 |
-
const CATEGORIES_BLOCK
|
12 |
const CATEGORY_PAGE_BLOCK = 'ec-store/category-page';
|
13 |
-
const CART_PAGE_BLOCK
|
14 |
-
const FILTERS_PAGE_BLOCK
|
15 |
-
const SEARCH_BLOCK
|
16 |
-
const MINICART_BLOCK
|
17 |
|
18 |
public $_blocks = array();
|
19 |
-
|
20 |
public function __construct() {
|
21 |
|
22 |
-
if ( isset( $_GET['classic-editor'] ) )
|
23 |
-
|
|
|
|
|
24 |
$blocks = self::get_block_names();
|
25 |
-
|
26 |
foreach ( $blocks as $block => $block_name ) {
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
add_action( 'admin_init', array( $this, 'init_scripts' ) );
|
38 |
|
39 |
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
|
40 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
41 |
|
42 |
-
add_action(
|
43 |
-
add_action(
|
44 |
-
|
45 |
-
$version = get_bloginfo('version');
|
46 |
|
47 |
-
|
|
|
|
|
48 |
add_filter( 'block_categories_all', array( $this, 'block_categories' ) );
|
49 |
} else {
|
50 |
add_filter( 'block_categories', array( $this, 'block_categories' ) );
|
51 |
}
|
52 |
-
|
53 |
}
|
54 |
|
55 |
-
public function init_scripts()
|
56 |
-
|
57 |
-
wp_register_script( 'ecwid-gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), get_option('ecwid_plugin_version') );
|
58 |
|
59 |
wp_set_script_translations( 'ecwid-gutenberg-store', 'ecwid-shopping-cart', ECWID_PLUGIN_DIR . '/languages' );
|
60 |
}
|
61 |
-
|
62 |
-
public function admin_enqueue_scripts()
|
63 |
-
{
|
64 |
wp_enqueue_script( 'gutenberg-store' );
|
65 |
EcwidPlatform::enqueue_style( 'store-popup' );
|
66 |
}
|
67 |
-
|
68 |
public function block_categories( $categories ) {
|
69 |
-
|
70 |
-
$store_block = new Ecwid_Gutenberg_Block_Store();
|
71 |
|
72 |
-
|
|
|
|
|
73 |
'slug' => 'ec-store',
|
74 |
'title' => sprintf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ),
|
75 |
-
'icon' => '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#555d66" d="' . $store_block->get_icon_path() . '"/><path d="M19 13H5v-2h14v2z" /></svg>'
|
76 |
);
|
77 |
|
78 |
-
$is_store_page
|
79 |
$installed_within_one_weeks = time() - get_option( 'ecwid_installation_date' ) < WEEK_IN_SECONDS;
|
80 |
|
81 |
-
if( $is_store_page || (
|
82 |
-
return array_merge( array($ec_category), $categories );
|
83 |
}
|
84 |
|
85 |
-
return array_merge( $categories, array($ec_category) );
|
86 |
}
|
87 |
-
|
88 |
public function on_save_post( $post, $request, $creating ) {
|
89 |
-
if (strpos( $post->post_content, '<!-- wp:' . self::STORE_BLOCK ) !== false ) {
|
90 |
Ecwid_Store_Page::add_store_page( $post->ID );
|
91 |
}
|
92 |
}
|
93 |
-
|
94 |
public function enqueue_block_editor_assets() {
|
95 |
wp_enqueue_script( 'ecwid-gutenberg-store' );
|
96 |
-
wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css', array(), get_option('ecwid_plugin_version') );
|
97 |
-
|
98 |
$locale_data = '';
|
99 |
if ( function_exists( 'gutenberg_get_jed_locale_data' ) ) {
|
100 |
$locale_data = gutenberg_get_jed_locale_data( 'ecwid-shopping-cart' );
|
101 |
-
}
|
102 |
$locale_data = wp_get_jed_locale_data( 'ecwid-shopping-cart' );
|
103 |
}
|
104 |
-
|
105 |
-
|
106 |
if ( $locale_data ) {
|
107 |
wp_add_inline_script(
|
108 |
'ecwid-gutenberg-store',
|
@@ -110,119 +109,122 @@ class Ecwid_Gutenberg {
|
|
110 |
'before'
|
111 |
);
|
112 |
}
|
113 |
-
|
114 |
$store_block = new Ecwid_Gutenberg_Block_Store();
|
115 |
-
|
116 |
$api = new Ecwid_Api_V3();
|
117 |
-
wp_localize_script(
|
|
|
|
|
118 |
$store_block->get_params()
|
119 |
-
|
120 |
-
|
121 |
$blockParams = array();
|
122 |
foreach ( $this->_blocks as $block ) {
|
123 |
-
$blockParams[$block->get_block_name()] = $block->get_params();
|
124 |
}
|
125 |
-
|
126 |
$minicart_block = new Ecwid_Gutenberg_Block_Minicart();
|
127 |
-
$is_demo_store
|
128 |
-
wp_localize_script(
|
|
|
|
|
129 |
array(
|
130 |
-
'blockParams'
|
131 |
-
'minicartAttributes'
|
132 |
-
'ecwid_pb_defaults'
|
133 |
-
'storeImageUrl'
|
134 |
-
'storeBlock'
|
135 |
-
'productBlockTitle'
|
136 |
'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
|
137 |
-
'productBlock'
|
138 |
-
'storeId'
|
139 |
-
'chooseProduct'
|
140 |
-
'editAppearance'
|
141 |
-
'yourStoreWill'
|
142 |
-
'storeIdLabel'
|
143 |
-
'yourProductLabel'
|
144 |
-
'isDemoStore'
|
145 |
-
'isApiAvailable'
|
146 |
-
'products'
|
147 |
-
'hasCategories'
|
148 |
-
'imagesUrl'
|
149 |
-
'isWidgetsScreen'
|
150 |
)
|
151 |
);
|
152 |
|
153 |
}
|
154 |
-
|
155 |
protected function _get_products_data() {
|
156 |
|
157 |
$blocks = self::get_blocks_on_page();
|
158 |
|
159 |
$productIds = array();
|
160 |
-
|
161 |
-
$product_block
|
162 |
-
$buynow_block
|
163 |
$product_page_block = new Ecwid_Gutenberg_Block_Product_Page();
|
164 |
foreach ( $blocks as $block ) {
|
165 |
-
if (
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
$buynow_block->get_block_name(),
|
171 |
-
)
|
172 |
)
|
173 |
-
|
|
|
174 |
) {
|
175 |
$productIds[] = $block['attrs']['id'];
|
176 |
}
|
177 |
-
|
178 |
if ( $block['blockName'] == $product_page_block->get_block_name() && @$block['attrs']['default_product_id'] ) {
|
179 |
$productIds[] = $block['attrs']['default_product_id'];
|
180 |
}
|
181 |
}
|
182 |
-
|
183 |
if ( empty( $productIds ) ) {
|
184 |
return array();
|
185 |
}
|
186 |
-
|
187 |
$result = array();
|
188 |
foreach ( $productIds as $id ) {
|
189 |
$product = Ecwid_Product::get_by_id( $id );
|
190 |
-
|
191 |
-
$result[$id] = array(
|
192 |
-
'name'
|
193 |
-
'imageUrl' => $product->thumbnailUrl
|
194 |
);
|
195 |
}
|
196 |
-
|
197 |
return $result;
|
198 |
}
|
199 |
-
|
200 |
public static function get_block_names( $return_with_pb_only = false ) {
|
201 |
// cuz no late static binding sadly
|
202 |
$blocks_with_productbrowser = array(
|
203 |
-
'store'
|
204 |
-
'product-page'
|
205 |
'category-page' => self::CATEGORY_PAGE_BLOCK,
|
206 |
-
'filters-page'
|
207 |
-
'cart-page'
|
208 |
);
|
209 |
|
210 |
$blocks_without_productbrowser = array(
|
211 |
-
'product'
|
212 |
-
'buynow'
|
213 |
'categories' => self::CATEGORIES_BLOCK,
|
214 |
-
'search'
|
215 |
-
'minicart'
|
216 |
-
'cart-page'
|
217 |
);
|
218 |
|
219 |
-
if( $return_with_pb_only == true ) {
|
220 |
return $blocks_with_productbrowser;
|
221 |
}
|
222 |
|
223 |
-
return array_merge($blocks_with_productbrowser, $blocks_without_productbrowser);
|
224 |
}
|
225 |
-
|
226 |
/**
|
227 |
* @param $post
|
228 |
*
|
@@ -230,44 +232,45 @@ class Ecwid_Gutenberg {
|
|
230 |
*/
|
231 |
public static function get_blocks_on_page() {
|
232 |
$post = get_post();
|
233 |
-
|
234 |
-
if (
|
235 |
-
|
|
|
|
|
236 |
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
237 |
$blocks = gutenberg_parse_blocks( $post->post_content );
|
238 |
} else {
|
239 |
$blocks = parse_blocks( $post->post_content );
|
240 |
}
|
241 |
-
|
242 |
if ( empty( $blocks ) ) {
|
243 |
return array();
|
244 |
}
|
245 |
|
246 |
$result = array();
|
247 |
-
|
248 |
$ecwid_blocks = self::get_block_names();
|
249 |
foreach ( $blocks as $block ) {
|
250 |
if ( in_array( $block['blockName'], $ecwid_blocks ) ) {
|
251 |
-
$result[$block['blockName']] = $block;
|
252 |
}
|
253 |
}
|
254 |
|
255 |
return $result;
|
256 |
}
|
257 |
|
258 |
-
protected function _get_version_for_assets( $asset_file_path )
|
259 |
-
|
260 |
-
if ( isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'localhost' ) {
|
261 |
return filemtime( ECWID_PLUGIN_DIR . '/' . $asset_file_path );
|
262 |
}
|
263 |
-
|
264 |
return get_option( 'ecwid_plugin_version' );
|
265 |
}
|
266 |
-
|
267 |
public static function get_store_block_data_from_current_page() {
|
268 |
-
|
269 |
$blocks = self::get_blocks_on_page();
|
270 |
-
|
271 |
$store_block = null;
|
272 |
foreach ( $blocks as $block ) {
|
273 |
if ( $block['blockName'] == self::STORE_BLOCK ) {
|
@@ -275,18 +278,20 @@ class Ecwid_Gutenberg {
|
|
275 |
break;
|
276 |
}
|
277 |
}
|
278 |
-
|
279 |
-
if (
|
280 |
-
|
|
|
|
|
281 |
return $store_block['atts'];
|
282 |
}
|
283 |
|
284 |
public static function content_has_productbrowser( $content ) {
|
285 |
-
|
286 |
-
$blocks_with_productbrowser =
|
287 |
|
288 |
foreach ( $blocks_with_productbrowser as $block_name ) {
|
289 |
-
if( strpos( $content, $block_name ) !== false ) {
|
290 |
return true;
|
291 |
}
|
292 |
}
|
@@ -295,4 +300,4 @@ class Ecwid_Gutenberg {
|
|
295 |
}
|
296 |
}
|
297 |
|
298 |
-
$ecwid_gutenberg = new Ecwid_Gutenberg();
|
1 |
+
<?php
|
2 |
|
3 |
require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-product-browser.php';
|
4 |
|
5 |
class Ecwid_Gutenberg {
|
6 |
+
|
7 |
+
const STORE_BLOCK = 'ecwid/store-block';
|
8 |
+
const PRODUCT_BLOCK = 'ecwid/product-block';
|
9 |
+
const BUYNOW_BLOCK = 'ec-store/buynow';
|
10 |
+
const PRODUCT_PAGE_BLOCK = 'ec-store/product-page';
|
11 |
+
const CATEGORIES_BLOCK = 'ec-store/categories';
|
12 |
const CATEGORY_PAGE_BLOCK = 'ec-store/category-page';
|
13 |
+
const CART_PAGE_BLOCK = 'ec-store/cart';
|
14 |
+
const FILTERS_PAGE_BLOCK = 'ec-store/filters';
|
15 |
+
const SEARCH_BLOCK = 'ec-store/search';
|
16 |
+
const MINICART_BLOCK = 'ec-store/minicart';
|
17 |
|
18 |
public $_blocks = array();
|
19 |
+
|
20 |
public function __construct() {
|
21 |
|
22 |
+
if ( isset( $_GET['classic-editor'] ) ) {
|
23 |
+
return;
|
24 |
+
}
|
25 |
+
|
26 |
$blocks = self::get_block_names();
|
27 |
+
|
28 |
foreach ( $blocks as $block => $block_name ) {
|
29 |
+
require_once dirname( __FILE__ ) . "/class-ecwid-gutenberg-block-$block.php";
|
30 |
+
$className = 'Ecwid_Gutenberg_Block_' . str_replace( '-', '_', ucfirst( $block ) );
|
31 |
+
|
32 |
+
$this->_blocks[] = new $className();
|
33 |
+
}
|
34 |
+
|
35 |
+
foreach ( $this->_blocks as $block ) {
|
36 |
+
$block->register();
|
37 |
+
}
|
38 |
|
39 |
add_action( 'admin_init', array( $this, 'init_scripts' ) );
|
40 |
|
41 |
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
|
42 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
43 |
|
44 |
+
add_action( 'rest_insert_post', array( $this, 'on_save_post' ), 10, 3 );
|
45 |
+
add_action( 'rest_insert_page', array( $this, 'on_save_post' ), 10, 3 );
|
|
|
|
|
46 |
|
47 |
+
$version = get_bloginfo( 'version' );
|
48 |
+
|
49 |
+
if ( strpos( $version, '5.8' ) === 0 || version_compare( $version, '5.8' ) >= 0 ) {
|
50 |
add_filter( 'block_categories_all', array( $this, 'block_categories' ) );
|
51 |
} else {
|
52 |
add_filter( 'block_categories', array( $this, 'block_categories' ) );
|
53 |
}
|
54 |
+
|
55 |
}
|
56 |
|
57 |
+
public function init_scripts() {
|
58 |
+
wp_register_script( 'ecwid-gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), get_option( 'ecwid_plugin_version' ) );
|
|
|
59 |
|
60 |
wp_set_script_translations( 'ecwid-gutenberg-store', 'ecwid-shopping-cart', ECWID_PLUGIN_DIR . '/languages' );
|
61 |
}
|
62 |
+
|
63 |
+
public function admin_enqueue_scripts() {
|
|
|
64 |
wp_enqueue_script( 'gutenberg-store' );
|
65 |
EcwidPlatform::enqueue_style( 'store-popup' );
|
66 |
}
|
67 |
+
|
68 |
public function block_categories( $categories ) {
|
|
|
|
|
69 |
|
70 |
+
$store_block = new Ecwid_Gutenberg_Block_Store();
|
71 |
+
|
72 |
+
$ec_category = array(
|
73 |
'slug' => 'ec-store',
|
74 |
'title' => sprintf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ),
|
75 |
+
'icon' => '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#555d66" d="' . $store_block->get_icon_path() . '"/><path d="M19 13H5v-2h14v2z" /></svg>',
|
76 |
);
|
77 |
|
78 |
+
$is_store_page = Ecwid_Store_Page::is_store_page();
|
79 |
$installed_within_one_weeks = time() - get_option( 'ecwid_installation_date' ) < WEEK_IN_SECONDS;
|
80 |
|
81 |
+
if ( $is_store_page || ( ! $is_store_page && $installed_within_one_weeks ) ) {
|
82 |
+
return array_merge( array( $ec_category ), $categories );
|
83 |
}
|
84 |
|
85 |
+
return array_merge( $categories, array( $ec_category ) );
|
86 |
}
|
87 |
+
|
88 |
public function on_save_post( $post, $request, $creating ) {
|
89 |
+
if ( strpos( $post->post_content, '<!-- wp:' . self::STORE_BLOCK ) !== false ) {
|
90 |
Ecwid_Store_Page::add_store_page( $post->ID );
|
91 |
}
|
92 |
}
|
93 |
+
|
94 |
public function enqueue_block_editor_assets() {
|
95 |
wp_enqueue_script( 'ecwid-gutenberg-store' );
|
96 |
+
wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css', array(), get_option( 'ecwid_plugin_version' ) );
|
97 |
+
|
98 |
$locale_data = '';
|
99 |
if ( function_exists( 'gutenberg_get_jed_locale_data' ) ) {
|
100 |
$locale_data = gutenberg_get_jed_locale_data( 'ecwid-shopping-cart' );
|
101 |
+
} elseif ( function_exists( 'wp_get_jed_locale_data' ) ) {
|
102 |
$locale_data = wp_get_jed_locale_data( 'ecwid-shopping-cart' );
|
103 |
}
|
104 |
+
|
|
|
105 |
if ( $locale_data ) {
|
106 |
wp_add_inline_script(
|
107 |
'ecwid-gutenberg-store',
|
109 |
'before'
|
110 |
);
|
111 |
}
|
112 |
+
|
113 |
$store_block = new Ecwid_Gutenberg_Block_Store();
|
114 |
+
|
115 |
$api = new Ecwid_Api_V3();
|
116 |
+
wp_localize_script(
|
117 |
+
'ecwid-gutenberg-store',
|
118 |
+
'EcwidGutenbergStoreBlockParams',
|
119 |
$store_block->get_params()
|
120 |
+
);
|
121 |
+
|
122 |
$blockParams = array();
|
123 |
foreach ( $this->_blocks as $block ) {
|
124 |
+
$blockParams[ $block->get_block_name() ] = $block->get_params();
|
125 |
}
|
126 |
+
|
127 |
$minicart_block = new Ecwid_Gutenberg_Block_Minicart();
|
128 |
+
$is_demo_store = ecwid_is_demo_store();
|
129 |
+
wp_localize_script(
|
130 |
+
'ecwid-gutenberg-store',
|
131 |
+
'EcwidGutenbergParams',
|
132 |
array(
|
133 |
+
'blockParams' => $blockParams,
|
134 |
+
'minicartAttributes' => $minicart_block->get_attributes_for_editor(),
|
135 |
+
'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
|
136 |
+
'storeImageUrl' => site_url( '?file=ecwid_store_svg.svg' ),
|
137 |
+
'storeBlock' => self::STORE_BLOCK,
|
138 |
+
'productBlockTitle' => sprintf( __( '%s product', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ),
|
139 |
'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
|
140 |
+
'productBlock' => self::PRODUCT_BLOCK,
|
141 |
+
'storeId' => get_ecwid_store_id(),
|
142 |
+
'chooseProduct' => __( 'Choose product', 'ecwid-shopping-cart' ),
|
143 |
+
'editAppearance' => __( 'Edit Appearance', 'ecwid-shopping-cart' ),
|
144 |
+
'yourStoreWill' => __( 'Your store will be shown here', 'ecwid-shopping-cart' ),
|
145 |
+
'storeIdLabel' => __( 'Store ID', 'ecwid-shopping-cart' ),
|
146 |
+
'yourProductLabel' => __( 'Your product', 'ecwid-shopping-cart' ),
|
147 |
+
'isDemoStore' => $is_demo_store,
|
148 |
+
'isApiAvailable' => Ecwid_Api_V3::is_available(),
|
149 |
+
'products' => $this->_get_products_data(),
|
150 |
+
'hasCategories' => $api->has_public_categories(),
|
151 |
+
'imagesUrl' => ECWID_PLUGIN_URL . 'images/gutenberg/',
|
152 |
+
'isWidgetsScreen' => get_current_screen()->id == 'widgets',
|
153 |
)
|
154 |
);
|
155 |
|
156 |
}
|
157 |
+
|
158 |
protected function _get_products_data() {
|
159 |
|
160 |
$blocks = self::get_blocks_on_page();
|
161 |
|
162 |
$productIds = array();
|
163 |
+
|
164 |
+
$product_block = new Ecwid_Gutenberg_Block_Product();
|
165 |
+
$buynow_block = new Ecwid_Gutenberg_Block_Buynow();
|
166 |
$product_page_block = new Ecwid_Gutenberg_Block_Product_Page();
|
167 |
foreach ( $blocks as $block ) {
|
168 |
+
if ( in_array(
|
169 |
+
$block['blockName'],
|
170 |
+
array(
|
171 |
+
$product_block->get_block_name(),
|
172 |
+
$buynow_block->get_block_name(),
|
|
|
|
|
173 |
)
|
174 |
+
)
|
175 |
+
&& @$block['attrs']['id']
|
176 |
) {
|
177 |
$productIds[] = $block['attrs']['id'];
|
178 |
}
|
179 |
+
|
180 |
if ( $block['blockName'] == $product_page_block->get_block_name() && @$block['attrs']['default_product_id'] ) {
|
181 |
$productIds[] = $block['attrs']['default_product_id'];
|
182 |
}
|
183 |
}
|
184 |
+
|
185 |
if ( empty( $productIds ) ) {
|
186 |
return array();
|
187 |
}
|
188 |
+
|
189 |
$result = array();
|
190 |
foreach ( $productIds as $id ) {
|
191 |
$product = Ecwid_Product::get_by_id( $id );
|
192 |
+
|
193 |
+
$result[ $id ] = array(
|
194 |
+
'name' => $product->name,
|
195 |
+
'imageUrl' => $product->thumbnailUrl,
|
196 |
);
|
197 |
}
|
198 |
+
|
199 |
return $result;
|
200 |
}
|
201 |
+
|
202 |
public static function get_block_names( $return_with_pb_only = false ) {
|
203 |
// cuz no late static binding sadly
|
204 |
$blocks_with_productbrowser = array(
|
205 |
+
'store' => self::STORE_BLOCK,
|
206 |
+
'product-page' => self::PRODUCT_PAGE_BLOCK,
|
207 |
'category-page' => self::CATEGORY_PAGE_BLOCK,
|
208 |
+
'filters-page' => self::FILTERS_PAGE_BLOCK,
|
209 |
+
'cart-page' => self::CART_PAGE_BLOCK,
|
210 |
);
|
211 |
|
212 |
$blocks_without_productbrowser = array(
|
213 |
+
'product' => self::PRODUCT_BLOCK,
|
214 |
+
'buynow' => self::BUYNOW_BLOCK,
|
215 |
'categories' => self::CATEGORIES_BLOCK,
|
216 |
+
'search' => self::SEARCH_BLOCK,
|
217 |
+
'minicart' => self::MINICART_BLOCK,
|
218 |
+
'cart-page' => self::CART_PAGE_BLOCK,
|
219 |
);
|
220 |
|
221 |
+
if ( $return_with_pb_only == true ) {
|
222 |
return $blocks_with_productbrowser;
|
223 |
}
|
224 |
|
225 |
+
return array_merge( $blocks_with_productbrowser, $blocks_without_productbrowser );
|
226 |
}
|
227 |
+
|
228 |
/**
|
229 |
* @param $post
|
230 |
*
|
232 |
*/
|
233 |
public static function get_blocks_on_page() {
|
234 |
$post = get_post();
|
235 |
+
|
236 |
+
if ( ! $post ) {
|
237 |
+
return array();
|
238 |
+
}
|
239 |
+
|
240 |
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
241 |
$blocks = gutenberg_parse_blocks( $post->post_content );
|
242 |
} else {
|
243 |
$blocks = parse_blocks( $post->post_content );
|
244 |
}
|
245 |
+
|
246 |
if ( empty( $blocks ) ) {
|
247 |
return array();
|
248 |
}
|
249 |
|
250 |
$result = array();
|
251 |
+
|
252 |
$ecwid_blocks = self::get_block_names();
|
253 |
foreach ( $blocks as $block ) {
|
254 |
if ( in_array( $block['blockName'], $ecwid_blocks ) ) {
|
255 |
+
$result[ $block['blockName'] ] = $block;
|
256 |
}
|
257 |
}
|
258 |
|
259 |
return $result;
|
260 |
}
|
261 |
|
262 |
+
protected function _get_version_for_assets( $asset_file_path ) {
|
263 |
+
if ( isset( $_SERVER['HTTP_HOST'] ) && $_SERVER['HTTP_HOST'] == 'localhost' ) {
|
|
|
264 |
return filemtime( ECWID_PLUGIN_DIR . '/' . $asset_file_path );
|
265 |
}
|
266 |
+
|
267 |
return get_option( 'ecwid_plugin_version' );
|
268 |
}
|
269 |
+
|
270 |
public static function get_store_block_data_from_current_page() {
|
271 |
+
|
272 |
$blocks = self::get_blocks_on_page();
|
273 |
+
|
274 |
$store_block = null;
|
275 |
foreach ( $blocks as $block ) {
|
276 |
if ( $block['blockName'] == self::STORE_BLOCK ) {
|
278 |
break;
|
279 |
}
|
280 |
}
|
281 |
+
|
282 |
+
if ( ! $store_block ) {
|
283 |
+
return array();
|
284 |
+
}
|
285 |
+
|
286 |
return $store_block['atts'];
|
287 |
}
|
288 |
|
289 |
public static function content_has_productbrowser( $content ) {
|
290 |
+
|
291 |
+
$blocks_with_productbrowser = self::get_block_names( true );
|
292 |
|
293 |
foreach ( $blocks_with_productbrowser as $block_name ) {
|
294 |
+
if ( strpos( $content, $block_name ) !== false ) {
|
295 |
return true;
|
296 |
}
|
297 |
}
|
300 |
}
|
301 |
}
|
302 |
|
303 |
+
$ecwid_gutenberg = new Ecwid_Gutenberg();
|
includes/integrations/class-ecwid-integration-aiosp.php
CHANGED
@@ -1,100 +1,173 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Ecwid_Integration_All_In_One_SEO_Pack
|
4 |
-
|
5 |
-
|
6 |
protected $sitemap = array();
|
7 |
|
8 |
-
public
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
return;
|
12 |
}
|
13 |
|
14 |
add_action( 'wp', array( $this, 'disable_seo_if_needed' ) );
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
-
|
22 |
-
{
|
23 |
-
$post_type = (string)$post->post_type;
|
24 |
|
25 |
-
if(
|
26 |
-
return
|
27 |
}
|
28 |
|
29 |
-
if(
|
30 |
-
|
31 |
}
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
|
49 |
-
$
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
$
|
54 |
-
|
55 |
-
if( $
|
56 |
-
|
57 |
}
|
58 |
|
59 |
-
if (
|
60 |
-
return;
|
61 |
}
|
62 |
|
63 |
-
$
|
64 |
-
add_filter( 'aioseop_title', '__return_null' );
|
65 |
-
add_filter( 'aioseop_description', '__return_null' );
|
66 |
-
add_filter( 'aioseop_disable_schema', '__return_true' );
|
67 |
}
|
68 |
|
69 |
// Hook that new sitemap type to aiosp sitemap
|
70 |
-
public function aiosp_hook_sitemap_extra( $params )
|
71 |
-
|
72 |
-
return array_merge($params, array('ecwid'));
|
73 |
}
|
74 |
|
75 |
// Hook that adds content to aiosp sitemap
|
76 |
-
public function aiosp_hook_sitemap_content()
|
77 |
-
{
|
78 |
-
|
79 |
$this->sitemap = array();
|
80 |
|
81 |
-
ecwid_build_sitemap( array($this, 'sitemap_callback') );
|
82 |
|
83 |
-
$sitemap
|
84 |
$this->sitemap = null;
|
85 |
|
86 |
return $sitemap;
|
87 |
}
|
88 |
|
89 |
// A callback for the streaming sitemap builder
|
90 |
-
public function sitemap_callback($url, $priority, $frequency)
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
97 |
}
|
98 |
}
|
99 |
|
100 |
-
$ecwid_integration_aiosp = new Ecwid_Integration_All_In_One_SEO_Pack();
|
1 |
<?php
|
2 |
|
3 |
+
class Ecwid_Integration_All_In_One_SEO_Pack {
|
4 |
+
|
5 |
+
/** Store intermediate sitemap generation results here */
|
6 |
protected $sitemap = array();
|
7 |
|
8 |
+
public $sitemap_url = 'ecstore-sitemap.xml';
|
9 |
+
public $plugin_version;
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
if ( ! Ecwid_Api_V3::is_available() ) {
|
13 |
return;
|
14 |
}
|
15 |
|
16 |
add_action( 'wp', array( $this, 'disable_seo_if_needed' ) );
|
17 |
|
18 |
+
$plugin_data = get_file_data( WP_PLUGIN_DIR . '/all-in-one-seo-pack/all_in_one_seo_pack.php', array( 'version' => 'Version' ), 'plugin' );
|
19 |
+
$this->plugin_version = $plugin_data['version'];
|
20 |
+
|
21 |
+
if ( version_compare( $this->plugin_version, '4.0.0', '>=' ) ) {
|
22 |
+
add_filter( 'aioseo_sitemap_indexes', array( $this, 'add_sitemap_to_indexes' ) );
|
23 |
+
add_action( 'init', array( $this, 'is_sitemap_page' ) );
|
24 |
+
} else {
|
25 |
+
add_filter( 'aiosp_sitemap_extra', array( $this, 'aiosp_hook_sitemap_extra' ) );
|
26 |
+
add_filter( 'aiosp_sitemap_custom_ecwid', array( $this, 'aiosp_hook_sitemap_content' ) );
|
27 |
+
add_filter( 'aiosp_sitemap_prio_item_filter', array( $this, 'aiosp_hook_sitemap_prio_item_filter' ), 10, 3 );
|
28 |
+
}
|
29 |
}
|
30 |
|
31 |
+
// Disable titles, descriptions and canonical link on ecwid _escaped_fragment_ pages
|
32 |
+
public function disable_seo_if_needed() {
|
|
|
33 |
|
34 |
+
if ( ! Ecwid_Store_Page::is_store_page() ) {
|
35 |
+
return;
|
36 |
}
|
37 |
|
38 |
+
if ( Ecwid_Store_Page::is_store_page_with_default_category() && Ecwid_Store_Page::is_store_home_page() ) {
|
39 |
+
add_filter( 'ecwid_static_page_field_canonicalurl', '__return_false' );
|
40 |
}
|
41 |
|
42 |
+
if ( ! Ecwid_Store_Page::is_store_home_page() ) {
|
43 |
+
add_filter( 'aioseo_facebook_tags', '__return_empty_array' );
|
44 |
+
add_filter( 'aioseo_twitter_tags', '__return_empty_array' );
|
45 |
+
|
46 |
+
if ( version_compare( $this->plugin_version, '4.0.0', '>=' ) ) {
|
47 |
+
if ( class_exists( 'Ecwid_Static_Page' ) ) {
|
48 |
+
add_filter( 'aioseo_title', 'Ecwid_Static_Page::get_title' );
|
49 |
+
}
|
50 |
+
|
51 |
+
add_filter( 'aioseo_description', '__return_null' );
|
52 |
+
add_filter( 'aioseo_canonical_url', '__return_null' );
|
53 |
+
} else {
|
54 |
+
global $aioseop_options;
|
55 |
+
$aioseop_options['aiosp_can'] = false;
|
56 |
+
|
57 |
+
add_filter( 'aioseop_title', '__return_null' );
|
58 |
+
add_filter( 'aioseop_description', '__return_null' );
|
59 |
+
add_filter( 'aioseop_canonical_url', '__return_null' );
|
60 |
+
}
|
61 |
+
|
62 |
+
add_filter( 'aioseo_schema_disable', '__return_true' );
|
63 |
+
}//end if
|
64 |
}
|
65 |
|
66 |
+
public function add_sitemap_to_indexes( $indexes ) {
|
67 |
+
$indexes[] = array(
|
68 |
+
'loc' => home_url( $this->sitemap_url ),
|
69 |
+
'lastmod' => '',
|
70 |
+
);
|
71 |
+
return $indexes;
|
72 |
+
}
|
73 |
|
74 |
+
// phpcs:disable
|
75 |
+
public function is_sitemap_page() {
|
76 |
+
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
|
77 |
+
|
78 |
+
if ( strpos( $request_uri, $this->sitemap_url ) !== false ) {
|
79 |
+
echo $this->do_sitemap();
|
80 |
+
exit;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
// phpcs:enable
|
84 |
+
|
85 |
+
public function do_sitemap() {
|
86 |
+
$charset = get_option( 'blog_charset' );
|
87 |
+
header( "Content-Type: text/xml; charset=$charset", true );
|
88 |
+
header( 'X-Robots-Tag: noindex, follow', true );
|
89 |
+
header( 'HTTP/1.1 200 OK' );
|
90 |
+
|
91 |
+
$this->sitemap = '<?xml version="1.0" encoding="UTF-8"?>';
|
92 |
+
$this->sitemap .= '<?xml-stylesheet type="text/xsl" href="default.xsl?sitemap=ecstore"?>';
|
93 |
+
$this->sitemap .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1">';
|
94 |
+
|
95 |
+
ecwid_build_sitemap( array( $this, 'get_sitemap_items_callback' ) );
|
96 |
|
97 |
+
$this->sitemap .= '</urlset>';
|
98 |
+
|
99 |
+
return $this->sitemap;
|
100 |
+
}
|
101 |
+
|
102 |
+
// A callback for the streaming sitemap builder
|
103 |
+
// phpcs:disable
|
104 |
+
public function get_sitemap_items_callback( $url, $priority, $frequency, $obj ) {
|
105 |
+
$url = htmlspecialchars( $url );
|
106 |
+
$imageCode = '';
|
107 |
+
$image = @$obj->originalImageUrl;
|
108 |
+
if ( $image ) {
|
109 |
+
$image = htmlspecialchars( $image );
|
110 |
+
$title = htmlspecialchars( $obj->name );
|
111 |
+
$imageCode = <<<XML
|
112 |
+
<image:image>
|
113 |
+
<image:title>$title</image:title>
|
114 |
+
<image:loc>$image</image:loc>
|
115 |
+
</image:image>
|
116 |
+
XML;
|
117 |
}
|
118 |
|
119 |
+
$this->sitemap .= <<<XML
|
120 |
+
<url>
|
121 |
+
<loc>$url</loc>
|
122 |
+
<changefreq>$frequency</changefreq>
|
123 |
+
<priority>$priority</priority> $imageCode
|
124 |
+
</url>
|
125 |
+
XML;
|
126 |
+
}
|
127 |
+
// phpcs:enable
|
128 |
|
129 |
+
public function aiosp_hook_sitemap_prio_item_filter( $pr_info, $post, $args ) {
|
130 |
+
$post_type = (string) $post->post_type;
|
131 |
+
|
132 |
+
if ( 'ec-product' === $post_type ) {
|
133 |
+
return false;
|
134 |
}
|
135 |
|
136 |
+
if ( 'attachment' === $post_type && strpos( $pr_info['loc'], Ecwid_Store_Page::get_store_url() ) === 0 ) {
|
137 |
+
return false;
|
138 |
}
|
139 |
|
140 |
+
return $pr_info;
|
|
|
|
|
|
|
141 |
}
|
142 |
|
143 |
// Hook that new sitemap type to aiosp sitemap
|
144 |
+
public function aiosp_hook_sitemap_extra( $params ) {
|
145 |
+
return array_merge( $params, array( 'ecwid' ) );
|
|
|
146 |
}
|
147 |
|
148 |
// Hook that adds content to aiosp sitemap
|
149 |
+
public function aiosp_hook_sitemap_content() {
|
|
|
|
|
150 |
$this->sitemap = array();
|
151 |
|
152 |
+
ecwid_build_sitemap( array( $this, 'sitemap_callback' ) );
|
153 |
|
154 |
+
$sitemap = $this->sitemap;
|
155 |
$this->sitemap = null;
|
156 |
|
157 |
return $sitemap;
|
158 |
}
|
159 |
|
160 |
// A callback for the streaming sitemap builder
|
161 |
+
public function sitemap_callback( $url, $priority, $frequency, $item ) {
|
162 |
+
array_push(
|
163 |
+
$this->sitemap,
|
164 |
+
array(
|
165 |
+
'loc' => $url,
|
166 |
+
'priority' => $priority,
|
167 |
+
'changefreq' => $frequency,
|
168 |
+
)
|
169 |
+
);
|
170 |
}
|
171 |
}
|
172 |
|
173 |
+
$ecwid_integration_aiosp = new Ecwid_Integration_All_In_One_SEO_Pack();
|
includes/integrations/class-ecwid-integration-wpseo.php
CHANGED
@@ -1,83 +1,80 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Ecwid_Integration_WordPress_SEO_By_Yoast
|
4 |
-
|
5 |
-
|
6 |
protected $sitemap = array();
|
7 |
-
protected $
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
{
|
12 |
-
if ( !Ecwid_Api_V3::is_available() ) {
|
13 |
return;
|
14 |
}
|
15 |
-
|
16 |
add_action( 'wp', array( $this, 'disable_seo_on_escaped_fragment' ) );
|
17 |
add_action( 'template_redirect', array( $this, 'disable_rewrite_titles' ) );
|
18 |
|
19 |
-
if( ecwid_is_store_page_available() ) {
|
20 |
|
21 |
add_filter( 'wpseo_title', 'ecwid_seo_title' );
|
22 |
-
remove_filter( 'wp_title', 'ecwid_seo_title'
|
23 |
-
|
24 |
add_filter( 'ecwid_set_mainpage_metadesc', array( $this, 'ecwid_set_mainpage_metadesc_hook' ) );
|
25 |
|
26 |
add_filter( 'wpseo_output_twitter_card', '__return_false' );
|
27 |
|
28 |
add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
|
29 |
-
add_filter( '
|
30 |
}
|
31 |
|
32 |
add_filter( 'ecwid_title_separator', array( $this, 'get_title_separator' ) );
|
33 |
-
add_action( 'init', array($this, 'clear_ecwid_sitemap_index') );
|
34 |
-
|
35 |
-
add_action( 'template_redirect', array($this, 'force_clear_metatags') );
|
36 |
}
|
37 |
|
38 |
public function ecwid_set_mainpage_metadesc_hook( $set_metadesc ) {
|
39 |
$post_id = get_the_ID();
|
40 |
|
41 |
-
if( class_exists('WPSEO_Meta') ) {
|
42 |
$wpseo_metadesc = WPSEO_Meta::get_value( 'metadesc', $post_id );
|
43 |
}
|
44 |
|
45 |
-
if( empty($wpseo_metadesc) ) {
|
46 |
return true;
|
47 |
}
|
48 |
-
|
49 |
return $set_metadesc;
|
50 |
}
|
51 |
|
52 |
// Disable titles, descriptions and canonical link on ecwid _escaped_fragment_ pages
|
53 |
-
public function disable_seo_on_escaped_fragment()
|
54 |
-
|
55 |
-
add_filter( 'wpseo_canonical', array($this, 'clear_canonical') );
|
56 |
|
57 |
$is_store_page = Ecwid_Store_Page::is_store_page();
|
58 |
-
$is_home_page
|
59 |
|
60 |
-
if( $is_store_page &&
|
61 |
add_filter( 'wpseo_metadesc', '__return_false' );
|
62 |
add_filter( 'wpseo_json_ld_output', '__return_false' );
|
63 |
|
64 |
-
foreach ( $this->
|
65 |
add_filter( 'wpseo_opengraph_' . $name, '__return_false' );
|
66 |
}
|
67 |
}
|
68 |
|
69 |
-
$is_escaped_fragment = array_key_exists('_escaped_fragment_', $_GET);
|
70 |
-
$is_seo_pb_url
|
71 |
|
72 |
$no_canonical_or_meta = $is_store_page && ( $is_escaped_fragment || $is_seo_pb_url );
|
73 |
-
if (
|
74 |
return;
|
75 |
}
|
76 |
|
77 |
global $wpseo_front;
|
78 |
// Canonical
|
79 |
|
80 |
-
if (empty($wpseo_front) && class_exists('WPSEO_Frontend')) {
|
81 |
$wpseo_front = WPSEO_Frontend::get_instance();
|
82 |
}
|
83 |
|
@@ -90,10 +87,10 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
|
|
90 |
|
91 |
if ( Ecwid_Store_Page::is_store_page() ) {
|
92 |
|
93 |
-
$is_home_page
|
94 |
$is_store_page_with_default_category = Ecwid_Store_Page::is_store_page_with_default_category();
|
95 |
|
96 |
-
if(
|
97 |
return false;
|
98 |
}
|
99 |
}
|
@@ -101,81 +98,79 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
|
|
101 |
return $canonical;
|
102 |
}
|
103 |
|
104 |
-
public function disable_rewrite_titles()
|
105 |
-
{
|
106 |
global $wpseo_front;
|
107 |
|
108 |
-
// Newer versions of
|
109 |
remove_action( 'template_redirect', array( $wpseo_front, 'force_rewrite_output_buffer' ), 99999 );
|
110 |
}
|
111 |
|
112 |
public function force_clear_metatags() {
|
113 |
$is_store_page = Ecwid_Store_Page::is_store_page();
|
114 |
-
$is_home_page
|
115 |
|
116 |
-
if( $is_store_page &&
|
117 |
ob_start();
|
118 |
-
add_action('shutdown', array($this, 'clear_output_metatags'), 0);
|
119 |
}
|
120 |
}
|
121 |
|
122 |
public function clear_output_metatags() {
|
123 |
$output = ob_get_contents();
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
}
|
138 |
|
139 |
-
|
140 |
}
|
141 |
|
142 |
public function clear_ecwid_sitemap_index() {
|
143 |
|
144 |
-
$request_uri = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'])) : '';
|
145 |
|
146 |
-
if( strpos( $request_uri, 'sitemap_index.xml' ) !== false ) {
|
147 |
ob_start();
|
148 |
-
add_action('shutdown', array($this, 'sitemap_clear'), 0);
|
149 |
}
|
150 |
}
|
151 |
|
152 |
-
public function sitemap_clear()
|
153 |
-
{
|
154 |
$output = ob_get_contents();
|
155 |
-
|
156 |
|
157 |
-
|
158 |
-
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
$dom->parentNode->removeChild($dom);
|
165 |
-
|
166 |
-
|
167 |
|
168 |
-
|
169 |
} else {
|
170 |
echo $output;
|
171 |
}
|
172 |
}
|
173 |
|
174 |
// Hook that new sitemap type to sitemap
|
175 |
-
public function wpseo_hook_sitemap_index(
|
176 |
-
|
177 |
-
|
178 |
-
$sitemap_url = $this->_get_base_url( '
|
179 |
return <<<XML
|
180 |
<sitemap>
|
181 |
<loc>$sitemap_url</loc>
|
@@ -185,33 +180,29 @@ XML;
|
|
185 |
}
|
186 |
|
187 |
// Hook that adds content to sitemap
|
188 |
-
public function wpseo_hook_do_sitemap()
|
189 |
-
{
|
190 |
-
|
191 |
$this->sitemap = <<<XML
|
192 |
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
193 |
XML;
|
194 |
|
195 |
-
|
196 |
-
ecwid_build_sitemap( array($this, 'sitemap_callback') );
|
197 |
|
198 |
$this->sitemap .= '</urlset>';
|
199 |
|
200 |
-
$sitemap
|
201 |
$this->sitemap = null;
|
202 |
|
203 |
-
$GLOBALS['wpseo_sitemaps']->set_sitemap($sitemap);
|
204 |
}
|
205 |
|
206 |
// A callback for the streaming sitemap builder
|
207 |
-
public function sitemap_callback($url, $priority, $frequency, $obj)
|
208 |
-
|
209 |
-
$url = htmlspecialchars($url);
|
210 |
$imageCode = '';
|
211 |
-
$image
|
212 |
-
if ($image) {
|
213 |
-
$image
|
214 |
-
$title
|
215 |
$imageCode = <<<XML
|
216 |
<image:image>
|
217 |
<image:title>$title</image:title>
|
@@ -219,7 +210,7 @@ XML;
|
|
219 |
|
220 |
</image:image>
|
221 |
XML;
|
222 |
-
|
223 |
|
224 |
$this->sitemap .= <<<XML
|
225 |
<url>
|
@@ -232,20 +223,19 @@ XML;
|
|
232 |
XML;
|
233 |
}
|
234 |
|
235 |
-
public function get_title_separator($separator)
|
236 |
-
|
237 |
-
if (class_exists('WPSEO_Option_Titles')) {
|
238 |
$separator = wpseo_replace_vars( '%%sep%%', array() );
|
239 |
}
|
240 |
|
241 |
return $separator;
|
242 |
}
|
243 |
-
|
244 |
protected function _get_base_url( $page ) {
|
245 |
if ( class_exists( 'WPSEO_Sitemaps_Router' ) && method_exists( 'WPSEO_Sitemaps_Router', 'get_base_url' ) ) {
|
246 |
return WPSEO_Sitemaps_Router::get_base_url( $page );
|
247 |
} else {
|
248 |
-
return wpseo_xml_sitemaps_base_url
|
249 |
}
|
250 |
}
|
251 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Ecwid_Integration_WordPress_SEO_By_Yoast {
|
4 |
+
|
5 |
+
/** Store intermediate sitemap generation results here */
|
6 |
protected $sitemap = array();
|
7 |
+
protected $og_drop = array( 'title', 'desc', 'type', 'url', 'site_name' );
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
if ( ! Ecwid_Api_V3::is_available() ) {
|
|
|
|
|
11 |
return;
|
12 |
}
|
13 |
+
|
14 |
add_action( 'wp', array( $this, 'disable_seo_on_escaped_fragment' ) );
|
15 |
add_action( 'template_redirect', array( $this, 'disable_rewrite_titles' ) );
|
16 |
|
17 |
+
if ( ecwid_is_store_page_available() ) {
|
18 |
|
19 |
add_filter( 'wpseo_title', 'ecwid_seo_title' );
|
20 |
+
remove_filter( 'wp_title', 'ecwid_seo_title', 10000, 3 );
|
21 |
+
|
22 |
add_filter( 'ecwid_set_mainpage_metadesc', array( $this, 'ecwid_set_mainpage_metadesc_hook' ) );
|
23 |
|
24 |
add_filter( 'wpseo_output_twitter_card', '__return_false' );
|
25 |
|
26 |
add_filter( 'wpseo_sitemap_index', array( $this, 'wpseo_hook_sitemap_index' ) );
|
27 |
+
add_filter( 'wpseo_do_sitemap_ecstore', array( $this, 'wpseo_hook_do_sitemap' ) );
|
28 |
}
|
29 |
|
30 |
add_filter( 'ecwid_title_separator', array( $this, 'get_title_separator' ) );
|
31 |
+
add_action( 'init', array( $this, 'clear_ecwid_sitemap_index' ) );
|
32 |
+
|
33 |
+
add_action( 'template_redirect', array( $this, 'force_clear_metatags' ) );
|
34 |
}
|
35 |
|
36 |
public function ecwid_set_mainpage_metadesc_hook( $set_metadesc ) {
|
37 |
$post_id = get_the_ID();
|
38 |
|
39 |
+
if ( class_exists( 'WPSEO_Meta' ) ) {
|
40 |
$wpseo_metadesc = WPSEO_Meta::get_value( 'metadesc', $post_id );
|
41 |
}
|
42 |
|
43 |
+
if ( empty( $wpseo_metadesc ) ) {
|
44 |
return true;
|
45 |
}
|
46 |
+
|
47 |
return $set_metadesc;
|
48 |
}
|
49 |
|
50 |
// Disable titles, descriptions and canonical link on ecwid _escaped_fragment_ pages
|
51 |
+
public function disable_seo_on_escaped_fragment() {
|
52 |
+
add_filter( 'wpseo_canonical', array( $this, 'clear_canonical' ) );
|
|
|
53 |
|
54 |
$is_store_page = Ecwid_Store_Page::is_store_page();
|
55 |
+
$is_home_page = Ecwid_Store_Page::is_store_home_page();
|
56 |
|
57 |
+
if ( $is_store_page && ! $is_home_page ) {
|
58 |
add_filter( 'wpseo_metadesc', '__return_false' );
|
59 |
add_filter( 'wpseo_json_ld_output', '__return_false' );
|
60 |
|
61 |
+
foreach ( $this->og_drop as $name ) {
|
62 |
add_filter( 'wpseo_opengraph_' . $name, '__return_false' );
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
$is_escaped_fragment = array_key_exists( '_escaped_fragment_', $_GET );
|
67 |
+
$is_seo_pb_url = Ecwid_Seo_Links::is_product_browser_url();
|
68 |
|
69 |
$no_canonical_or_meta = $is_store_page && ( $is_escaped_fragment || $is_seo_pb_url );
|
70 |
+
if ( ! $no_canonical_or_meta ) {
|
71 |
return;
|
72 |
}
|
73 |
|
74 |
global $wpseo_front;
|
75 |
// Canonical
|
76 |
|
77 |
+
if ( empty( $wpseo_front ) && class_exists( 'WPSEO_Frontend' ) ) {
|
78 |
$wpseo_front = WPSEO_Frontend::get_instance();
|
79 |
}
|
80 |
|
87 |
|
88 |
if ( Ecwid_Store_Page::is_store_page() ) {
|
89 |
|
90 |
+
$is_home_page = Ecwid_Store_Page::is_store_home_page();
|
91 |
$is_store_page_with_default_category = Ecwid_Store_Page::is_store_page_with_default_category();
|
92 |
|
93 |
+
if ( ! $is_home_page || $is_store_page_with_default_category ) {
|
94 |
return false;
|
95 |
}
|
96 |
}
|
98 |
return $canonical;
|
99 |
}
|
100 |
|
101 |
+
public function disable_rewrite_titles() {
|
|
|
102 |
global $wpseo_front;
|
103 |
|
104 |
+
// Newer versions of WordPress SEO assign their rewrite on this stage
|
105 |
remove_action( 'template_redirect', array( $wpseo_front, 'force_rewrite_output_buffer' ), 99999 );
|
106 |
}
|
107 |
|
108 |
public function force_clear_metatags() {
|
109 |
$is_store_page = Ecwid_Store_Page::is_store_page();
|
110 |
+
$is_home_page = Ecwid_Store_Page::is_store_home_page();
|
111 |
|
112 |
+
if ( $is_store_page && ! $is_home_page ) {
|
113 |
ob_start();
|
114 |
+
add_action( 'shutdown', array( $this, 'clear_output_metatags' ), 0 );
|
115 |
}
|
116 |
}
|
117 |
|
118 |
public function clear_output_metatags() {
|
119 |
$output = ob_get_contents();
|
120 |
+
ob_end_clean();
|
121 |
+
|
122 |
+
if ( substr_count( $output, '"og:image"' ) > 1 ) {
|
123 |
+
|
124 |
+
$og_tags = array( '', ':width', ':height', ':type' );
|
125 |
+
foreach ( $og_tags as $og_tag ) {
|
126 |
+
$output = preg_replace(
|
127 |
+
'/<meta property="og:image' . $og_tag . '" content=".*?" \/>[[:space:]]*/',
|
128 |
+
'',
|
129 |
+
$output,
|
130 |
+
1
|
131 |
+
);
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
+
echo $output;
|
136 |
}
|
137 |
|
138 |
public function clear_ecwid_sitemap_index() {
|
139 |
|
140 |
+
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
|
141 |
|
142 |
+
if ( strpos( $request_uri, 'sitemap_index.xml' ) !== false ) {
|
143 |
ob_start();
|
144 |
+
add_action( 'shutdown', array( $this, 'sitemap_clear' ), 0 );
|
145 |
}
|
146 |
}
|
147 |
|
148 |
+
public function sitemap_clear() {
|
|
|
149 |
$output = ob_get_contents();
|
150 |
+
ob_end_clean();
|
151 |
|
152 |
+
libxml_use_internal_errors( true );
|
153 |
+
$xml = simplexml_load_string( $output );
|
154 |
|
155 |
+
if ( false !== $xml ) {
|
156 |
+
foreach ( $xml->sitemap as $sitemap ) {
|
157 |
+
if ( strpos( (string) $sitemap->loc, 'ec-product' ) !== false ) {
|
158 |
+
$dom = dom_import_simplexml( $sitemap );
|
159 |
+
$dom->parentNode->removeChild( $dom );
|
160 |
+
}
|
161 |
+
}
|
162 |
|
163 |
+
echo $xml->asXML();
|
164 |
} else {
|
165 |
echo $output;
|
166 |
}
|
167 |
}
|
168 |
|
169 |
// Hook that new sitemap type to sitemap
|
170 |
+
public function wpseo_hook_sitemap_index() {
|
171 |
+
$now = date( 'c', time() );
|
172 |
+
|
173 |
+
$sitemap_url = $this->_get_base_url( 'ecstore-sitemap.xml' );
|
174 |
return <<<XML
|
175 |
<sitemap>
|
176 |
<loc>$sitemap_url</loc>
|
180 |
}
|
181 |
|
182 |
// Hook that adds content to sitemap
|
183 |
+
public function wpseo_hook_do_sitemap() {
|
|
|
|
|
184 |
$this->sitemap = <<<XML
|
185 |
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
186 |
XML;
|
187 |
|
188 |
+
ecwid_build_sitemap( array( $this, 'sitemap_callback' ) );
|
|
|
189 |
|
190 |
$this->sitemap .= '</urlset>';
|
191 |
|
192 |
+
$sitemap = $this->sitemap;
|
193 |
$this->sitemap = null;
|
194 |
|
195 |
+
$GLOBALS['wpseo_sitemaps']->set_sitemap( $sitemap );
|
196 |
}
|
197 |
|
198 |
// A callback for the streaming sitemap builder
|
199 |
+
public function sitemap_callback( $url, $priority, $frequency, $obj ) {
|
200 |
+
$url = htmlspecialchars( $url );
|
|
|
201 |
$imageCode = '';
|
202 |
+
$image = @$obj->originalImageUrl;
|
203 |
+
if ( $image ) {
|
204 |
+
$image = htmlspecialchars( $image );
|
205 |
+
$title = htmlspecialchars( $obj->name );
|
206 |
$imageCode = <<<XML
|
207 |
<image:image>
|
208 |
<image:title>$title</image:title>
|
210 |
|
211 |
</image:image>
|
212 |
XML;
|
213 |
+
}
|
214 |
|
215 |
$this->sitemap .= <<<XML
|
216 |
<url>
|
223 |
XML;
|
224 |
}
|
225 |
|
226 |
+
public function get_title_separator( $separator ) {
|
227 |
+
if ( class_exists( 'WPSEO_Option_Titles' ) ) {
|
|
|
228 |
$separator = wpseo_replace_vars( '%%sep%%', array() );
|
229 |
}
|
230 |
|
231 |
return $separator;
|
232 |
}
|
233 |
+
|
234 |
protected function _get_base_url( $page ) {
|
235 |
if ( class_exists( 'WPSEO_Sitemaps_Router' ) && method_exists( 'WPSEO_Sitemaps_Router', 'get_base_url' ) ) {
|
236 |
return WPSEO_Sitemaps_Router::get_base_url( $page );
|
237 |
} else {
|
238 |
+
return wpseo_xml_sitemaps_base_url( $page );
|
239 |
}
|
240 |
}
|
241 |
}
|
js/gutenberg/blocks.build.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",function(){return c});var n,l,c={ecwid:wp.element.createElement("svg",{class:"ec-store-icon",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 215 215","enable-background":"new 0 0 215 215"},wp.element.createElement("g",{fill:"#0087cd"},wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M160.68,163.34c-3.67,0-6.65,2.98-6.65,6.66c0,3.68,2.98,6.66,6.65,6.66 c3.68,0,6.66-2.98,6.66-6.66C167.34,166.32,164.36,163.34,160.68,163.34z"}),wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M53.46,162.51c-3.67,0-6.65,2.98-6.65,6.66c0,3.68,2.98,6.66,6.65,6.66 c3.68,0,6.66-2.98,6.66-6.66C60.12,165.49,57.14,162.51,53.46,162.51z"}),wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M166.12,0H48.88C21.89,0,0,21.89,0,48.89v117.23c0,27,21.89,48.88,48.88,48.88 h117.24c27,0,48.88-21.88,48.88-48.88V48.88C215,21.89,193.11,0,166.12,0z M134.43,57.85c5.36,0,9.7,4.34,9.7,9.7 c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C124.73,62.19,129.07,57.85,134.43,57.85z M134.43,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S129.07,85.25,134.43,85.25z M107.09,57.85 c5.36,0,9.7,4.34,9.7,9.7c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C97.39,62.19,101.73,57.85,107.09,57.85z M107.09,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S101.73,85.25,107.09,85.25z M79.75,57.85 c5.36,0,9.7,4.34,9.7,9.7c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C70.05,62.19,74.39,57.85,79.75,57.85z M79.75,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S74.39,85.25,79.75,85.25z M53.46,187.72 c-10.24,0-18.55-8.31-18.55-18.55c0-10.25,8.31-18.56,18.55-18.56c10.25,0,18.56,8.31,18.56,18.56 C72.03,179.41,63.71,187.72,53.46,187.72z M160.68,188.55c-10.24,0-18.55-8.31-18.55-18.55c0-10.25,8.31-18.56,18.55-18.56 c10.25,0,18.56,8.31,18.56,18.56C179.24,180.24,170.93,188.55,160.68,188.55z M193.27,37.66l-19.18,71.44 c-5.12,19.07-21.28,31.04-41.03,31.04h-12.65c-4.18,0-10.23-2.26-12.74-4.62c-0.42-0.39-1.08-0.39-1.5,0 c-2.51,2.36-8.56,4.62-12.74,4.62h-13.9c-19.12,0-33.61-10.9-39.41-29.12L23.81,59.86c-0.32-1.02-0.15-2.1,0.49-2.97 c0.63-0.86,1.6-1.36,2.69-1.36l3.12,0.01c7.52,0.03,14.11,4.86,16.38,12.02l11.98,37.62c3.24,10.19,13.61,17.04,24.3,17.04 l4.65-0.01c4.8,0,8.18-2.46,10.22-4.66c1.06-1.15,2.54-1.82,4.11-1.82l10.44,0.01c1.48,0,2.92,0.59,3.91,1.68 c1.98,2.17,5.49,4.79,10.33,4.79l4.43,0.01c11.04,0,21.75-7.45,24.62-18.11l15.53-57.84c2.03-7.53,8.88-12.78,16.67-12.78l2.74,0 c0.26,0,0.52,0.04,0.76,0.14C192.93,34.37,193.7,36.08,193.27,37.66z"}))),store:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"2",transform:"translate(0 3)"},wp.element.createElement("path",{d:"M20 7L20 17C20 18.1045695 19.1045695 19 18 19L4 19C2.8954305 19 2 18.1045695 2 17L2 7 2 7M1 0L21 0 21.5808632 3.48517907C21.8145004 4.88700236 20.8935617 6.22128765 19.5 6.5L18.9764235 6.60471529C17.7961226 6.84077548 16.5971903 6.29508301 16 5.25L16 5.25 16 5.25 15.7442084 5.69763529C15.2840087 6.50298484 14.4275622 7 13.5 7 12.5724378 7 11.7159913 6.50298484 11.2557916 5.69763529L11 5.25 11 5.25 10.7442084 5.69763529C10.2840087 6.50298484 9.42756224 7 8.5 7 7.57243776 7 6.71599134 6.50298484 6.25579159 5.69763529L6 5.25 6 5.25C5.40280971 6.29508301 4.20387741 6.84077548 3.02357646 6.60471529L2.5 6.5C1.10643827 6.22128765.185499607 4.88700236.419136822 3.48517907L1 0 1 0z"}),wp.element.createElement("polygon",{points:"7 11 15 11 15 19 7 19"}))),product:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd","stroke-linecap":"round","stroke-linejoin":"round"},wp.element.createElement("path",{stroke:"currentColor","stroke-width":"2",d:"M5.5638852,7 L18.4361148,7 C19.3276335,7 19.6509198,7.09282561 19.9768457,7.2671327 C20.3027716,7.4414398 20.5585602,7.69722837 20.7328673,8.0231543 C20.9071744,8.34908022 21,8.67236646 21,9.5638852 L21,20.4361148 C21,21.3276335 20.9071744,21.6509198 20.7328673,21.9768457 C20.5585602,22.3027716 20.3027716,22.5585602 19.9768457,22.7328673 C19.6509198,22.9071744 19.3276335,23 18.4361148,23 L5.5638852,23 C4.67236646,23 4.34908022,22.9071744 4.0231543,22.7328673 C3.69722837,22.5585602 3.4414398,22.3027716 3.2671327,21.9768457 C3.09282561,21.6509198 3,21.3276335 3,20.4361148 L3,9.5638852 C3,8.67236646 3.09282561,8.34908022 3.2671327,8.0231543 C3.4414398,7.69722837 3.69722837,7.4414398 4.0231543,7.2671327 C4.34908022,7.09282561 4.67236646,7 5.5638852,7 Z"}),wp.element.createElement("path",{stroke:"currentColor","stroke-width":"2",d:"M8,10 L8,6 C8,3.790861 9.790861,2 12,2 C14.209139,2 16,3.790861 16,6 L16,10 L16,10"}))),aspect169:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"9",y:"14",width:"22",height:"12",rx:"2"}))),aspect916:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"}," ",wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"14",y:"9",width:"12",height:"22",rx:"2"}))),aspect11:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"12",width:"16",height:"16",rx:"2"}))),aspect34:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"10",width:"16",height:"20",rx:"2"}))),aspect43:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"10",y:"12",width:"20",height:"16",rx:"2"}))),textalignleft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textaligncenter:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"16",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"12",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"22",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignright:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignjustify:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",zoomAndPan:"1.5",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),productLayout3Columns:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",transform:"translate(13.000000, 19.500000) rotate(-270.000000) translate(-13.000000, -19.500000) ",x:"3.5",y:"16.5",width:"19",height:"6",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"10",width:"5",height:"19"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"10",width:"5",height:"8"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"19",width:"5",height:"10"}))),productLayout2ColumnsLeft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"17",y:"10",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"10",width:"5",height:"5"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"17",width:"5",height:"12"}))),productLayout2ColumnsRight:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"12"})))),productLayout2ColumnsBottom:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"12",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"12"}),wp.element.createElement("rect",{x:"0",y:"14",width:"20",height:"5"})))),galleryLayoutHorizontal:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.000000, 20.500000) rotate(-180.000000) translate(-20.000000, -20.500000) translate(10.000000, 11.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"14",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"6"})))),galleryLayoutVertical:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(19.500000, 20.000000) rotate(-270.000000) translate(-19.500000, -20.000000) translate(9.500000, 10.500000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"-1.13686838e-13",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"-1.13686838e-13",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"13",width:"5",height:"6"})))),galleryLayoutFeed:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.500000, 12.500000) rotate(-270.000000) translate(-20.500000, -12.500000) translate(14.000000, 3.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})),wp.element.createElement("g",{transform:"translate(20.500000, 27.500000) rotate(-270.000000) translate(-20.500000, -27.500000) translate(14.000000, 18.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})))),cart:wp.element.createElement("svg",(n={class:"ec-store-icon-color"},o(n,"class","ec-store-icon-color"),o(n,"width","24px"),o(n,"height","24px"),o(n,"viewBox","0 0 24 24"),o(n,"version","1.1"),n),wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -415.000000)"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(352.000000, 415.000000)"},wp.element.createElement("path",{d:"M4.5269723,4 L2,4 C1.44771525,4 1,3.55228475 1,3 C1,2.44771525 1.44771525,2 2,2 L5.33333333,2 C5.80393835,2 6.21086155,2.32812702 6.31061146,2.788039 L7.22413999,7 L21,7 C21.6640252,7 22.143636,7.63527258 21.9617572,8.27390353 L19.968471,15.272927 C19.8460922,15.7026358 19.4535094,15.9990234 19.0067139,15.9990234 L7.93579102,15.9990234 C7.465186,15.9990234 7.0582628,15.6708964 6.95851289,15.2109844 L4.5269723,4 Z M7.65791824,9 L8.74215205,13.9990234 L18.2517453,13.9990234 L19.6754416,9 L7.65791824,9 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"9",cy:"20",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"18",cy:"20",r:"2"}))))),search:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",transform:"translate(1.667 1.667)"},wp.element.createElement("line",{x1:"10.667",x2:"14.667",y1:"10.667",y2:"14.667"}),wp.element.createElement("circle",{cx:"6",cy:"6",r:"6","stroke-linejoin":"round"}))),categories:wp.element.createElement("svg",(l={class:"ec-store-icon-color"},o(l,"class","ec-store-icon-color"),o(l,"width","24px"),o(l,"height","24px"),o(l,"viewBox","0 0 24 24"),o(l,"version","1.1"),l),wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -416.000000)"},wp.element.createElement("g",{id:"categories-icon",transform:"translate(234.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Triangle",points:"3 2 5.5 7 0.5 7"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 6 8 4 23 4 23 6"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 13 8 11 23 11 23 13"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 20 8 18 23 18 23 20"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"currentColor","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"11",width:"2",height:"2"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"currentColor","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"18",width:"2",height:"2",rx:"1"}))))),category:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4.5638852 2L7.4361148 2C8.32763354 2 8.65091978 2.09282561 8.9768457 2.2671327 9.30277163 2.4414398 9.5585602 2.69722837 9.7328673 3.0231543 9.90717439 3.34908022 10 3.67236646 10 4.5638852L10 7.4361148C10 8.32763354 9.90717439 8.65091978 9.7328673 8.9768457 9.5585602 9.30277163 9.30277163 9.5585602 8.9768457 9.7328673 8.65091978 9.90717439 8.32763354 10 7.4361148 10L4.5638852 10C3.67236646 10 3.34908022 9.90717439 3.0231543 9.7328673 2.69722837 9.5585602 2.4414398 9.30277163 2.2671327 8.9768457 2.09282561 8.65091978 2 8.32763354 2 7.4361148L2 4.5638852C2 3.67236646 2.09282561 3.34908022 2.2671327 3.0231543 2.4414398 2.69722837 2.69722837 2.4414398 3.0231543 2.2671327 3.34908022 2.09282561 3.67236646 2 4.5638852 2zM4.5638852 14L7.4361148 14C8.32763354 14 8.65091978 14.0928256 8.9768457 14.2671327 9.30277163 14.4414398 9.5585602 14.6972284 9.7328673 15.0231543 9.90717439 15.3490802 10 15.6723665 10 16.5638852L10 19.4361148C10 20.3276335 9.90717439 20.6509198 9.7328673 20.9768457 9.5585602 21.3027716 9.30277163 21.5585602 8.9768457 21.7328673 8.65091978 21.9071744 8.32763354 22 7.4361148 22L4.5638852 22C3.67236646 22 3.34908022 21.9071744 3.0231543 21.7328673 2.69722837 21.5585602 2.4414398 21.3027716 2.2671327 20.9768457 2.09282561 20.6509198 2 20.3276335 2 19.4361148L2 16.5638852C2 15.6723665 2.09282561 15.3490802 2.2671327 15.0231543 2.4414398 14.6972284 2.69722837 14.4414398 3.0231543 14.2671327 3.34908022 14.0928256 3.67236646 14 4.5638852 14zM16.5638852 2L19.4361148 2C20.3276335 2 20.6509198 2.09282561 20.9768457 2.2671327 21.3027716 2.4414398 21.5585602 2.69722837 21.7328673 3.0231543 21.9071744 3.34908022 22 3.67236646 22 4.5638852L22 7.4361148C22 8.32763354 21.9071744 8.65091978 21.7328673 8.9768457 21.5585602 9.30277163 21.3027716 9.5585602 20.9768457 9.7328673 20.6509198 9.90717439 20.3276335 10 19.4361148 10L16.5638852 10C15.6723665 10 15.3490802 9.90717439 15.0231543 9.7328673 14.6972284 9.5585602 14.4414398 9.30277163 14.2671327 8.9768457 14.0928256 8.65091978 14 8.32763354 14 7.4361148L14 4.5638852C14 3.67236646 14.0928256 3.34908022 14.2671327 3.0231543 14.4414398 2.69722837 14.6972284 2.4414398 15.0231543 2.2671327 15.3490802 2.09282561 15.6723665 2 16.5638852 2zM16.5638852 14L19.4361148 14C20.3276335 14 20.6509198 14.0928256 20.9768457 14.2671327 21.3027716 14.4414398 21.5585602 14.6972284 21.7328673 15.0231543 21.9071744 15.3490802 22 15.6723665 22 16.5638852L22 19.4361148C22 20.3276335 21.9071744 20.6509198 21.7328673 20.9768457 21.5585602 21.3027716 21.3027716 21.5585602 20.9768457 21.7328673 20.6509198 21.9071744 20.3276335 22 19.4361148 22L16.5638852 22C15.6723665 22 15.3490802 21.9071744 15.0231543 21.7328673 14.6972284 21.5585602 14.4414398 21.3027716 14.2671327 20.9768457 14.0928256 20.6509198 14 20.3276335 14 19.4361148L14 16.5638852C14 15.6723665 14.0928256 15.3490802 14.2671327 15.0231543 14.4414398 14.6972284 14.6972284 14.4414398 15.0231543 14.2671327 15.3490802 14.0928256 15.6723665 14 16.5638852 14z"})),button:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-345.000000, -280.000000)","fill-rule":"nonzero"},wp.element.createElement("g",{id:"button-icon",transform:"translate(345.000000, 280.000000)"},wp.element.createElement("path",{d:"M4,8 L4,16 L20,16 L20,8 L4,8 Z M4,6 L20,6 C21.1045695,6 22,6.8954305 22,8 L22,16 C22,17.1045695 21.1045695,18 20,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,8 C2,6.8954305 2.8954305,6 4,6 Z",id:"Rectangle-5"}),wp.element.createElement("path",{d:"M13.8320367,9.8101295 C14.2137832,9.41102047 14.8467917,9.3969454 15.2459008,9.77869195 C15.6450098,10.1604385 15.6590849,10.793447 15.2773383,11.192556 L12.2122748,14.3970238 C11.8300377,14.7966458 11.1960253,14.8101668 10.7970986,14.427204 L9.5128579,13.1943549 C9.11444327,12.8118837 9.10151859,12.1788506 9.48398981,11.780436 C9.86646103,11.3820214 10.4994941,11.3690967 10.8979087,11.7515679 L11.4594438,12.290632 L13.8320367,9.8101295 Z",id:"Line-6"}))))),productPreview:wp.element.createElement("svg",{width:"72px",height:"72px",viewBox:"0 0 72 72",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets",transform:"translate(-625.000000, -811.000000)",fill:"#AAAAAA"},wp.element.createElement("g",{id:"Group-2",transform:"translate(571.000000, 756.000000)"},wp.element.createElement("g",{id:"product-preview",transform:"translate(54.000000, 55.000000)"},wp.element.createElement("path",{d:"M6,25 L6,69 L66,69 L66,25 L6,25 Z M4,23 L68,23 L68,71 L4,71 L4,23 Z",id:"Rectangle-2-Copy-2","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M36.5,23.5 L65.836706,23.5 L67.2237665,22.8226349 L55.0328393,7.34740904 L39.8812213,0.895706316 L40.7501329,7.5 L17.0403124,7.5 L5.04031242,22.5 L6.32093727,22.5 L17.5209373,8.5 L36.5,8.5 L36.5,23.5 Z M42.9573255,16.6099474 L41.1011835,2.50206036 L54.4056315,8.16722056 L66.5284549,23.5566573 L42.9573255,16.6099474 Z",id:"Combined-Shape",stroke:"#AAAAAA"}),wp.element.createElement("path",{d:"M29.8056641,41.53125 C29.9375,38.2060547 32.2080078,35.6865234 36.4560547,35.6865234 C40.3232422,35.6865234 42.9306641,37.9863281 42.9306641,41.1210938 C42.9306641,43.3916016 41.7880859,44.9882812 39.8544922,46.1455078 C37.9648438,47.2587891 37.4228516,48.0351562 37.4228516,49.5439453 L37.4228516,50.4375 L34.390625,50.4375 L34.3759766,49.265625 C34.3027344,47.2001953 35.1962891,45.8818359 37.203125,44.6806641 C38.9755859,43.6113281 39.6054688,42.7617188 39.6054688,41.2529297 C39.6054688,39.5976562 38.3017578,38.3818359 36.2949219,38.3818359 C34.2734375,38.3818359 32.9697266,39.5976562 32.8378906,41.53125 L29.8056641,41.53125 Z M35.9287109,57.2197266 C34.859375,57.2197266 34.0097656,56.3994141 34.0097656,55.3300781 C34.0097656,54.2607422 34.859375,53.4404297 35.9287109,53.4404297 C37.0273438,53.4404297 37.8623047,54.2607422 37.8623047,55.3300781 C37.8623047,56.3994141 37.0273438,57.2197266 35.9287109,57.2197266 Z",id:"?"})))))),filters:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd","stroke-linecap":"round"},wp.element.createElement("line",{x1:"2",x2:"22",y1:"7",y2:"7",stroke:"currentColor","stroke-width":"2"}),wp.element.createElement("line",{x1:"6",x2:"18",y1:"13",y2:"13",stroke:"currentColor","stroke-width":"2"}),wp.element.createElement("line",{x1:"11",x2:"13",y1:"19",y2:"19",stroke:"currentColor","stroke-width":"2"}))),cartPage:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -500.000000)"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(470.000000, 500.000000)"},wp.element.createElement("g",{id:"Group-6",transform:"translate(2.000000, 3.000000)"},wp.element.createElement("path",{d:"M2.5269723,1 L0,1 C-0.55228475,1 -1,0.55228475 -1,-1.11022302e-16 C-1,-0.55228475 -0.55228475,-1 0,-1 L3.33333333,-1 C3.80393835,-1 4.21086155,-0.671872981 4.31061146,-0.211960997 L6.74215205,10.9990234 L16.2517453,10.9990234 L17.6754416,6 L17.0067139,6 C16.4544291,6 16.0067139,5.55228475 16.0067139,5 C16.0067139,4.44771525 16.4544291,4 17.0067139,4 L19,4 C19.6640252,4 20.143636,4.63527258 19.9617572,5.27390353 L17.968471,12.272927 C17.8460922,12.7026358 17.4535094,12.9990234 17.0067139,12.9990234 L5.93579102,12.9990234 C5.465186,12.9990234 5.0582628,12.6708964 4.95851289,12.2109844 L2.5269723,1 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M13.6266547,1.30878828 C14.0084012,0.909679249 14.6414097,0.895604177 15.0405188,1.27735072 C15.4396278,1.65909727 15.4537029,2.29210579 15.0719563,2.69121482 L11.0068929,6.89568259 C10.6246557,7.29530459 9.99064332,7.30882561 9.59171662,6.92586281 L7.61584318,5.00113813 C7.21742856,4.61866691 7.20450388,3.98563386 7.5869751,3.58721924 C7.96944632,3.18880462 8.60247937,3.17587994 9.00089399,3.55835116 L10.2540618,4.78929076 L13.6266547,1.30878828 Z",id:"Line-6","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"7",cy:"17",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"16",cy:"17",r:"2"})))))),latestProducts:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -416.000000)","fill-rule":"nonzero"},wp.element.createElement("g",{transform:"translate(470.000000, 416.000000)"},wp.element.createElement("path",{d:"M5,17 L5,20 L9,20 L9,17 L5,17 Z M3,15 L11,15 L11,22 L3,22 L3,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M5,8 L5,11 L9,11 L9,8 L5,8 Z M3,6 L11,6 L11,13 L3,13 L3,6 Z",id:"Rectangle-2-Copy"}),wp.element.createElement("path",{d:"M15,17 L15,20 L19,20 L19,17 L15,17 Z M13,15 L21,15 L21,22 L13,22 L13,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M15,8 L15,11 L19,11 L19,8 L15,8 Z M13,6 L21,6 L21,13 L13,13 L13,6 Z",id:"Rectangle-2-Copy-3"})))))}},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=t.attributes,n=function(e,t,n,l){return wp.element.createElement(g,{label:n},wp.element.createElement(u,{className:"ec-store-inspector-button-group"},l.map(function(n){return wp.element.createElement(w,{isPrimary:r[t]===n.value,onClick:function(){return e.setAttributes(o({},t,n.value))}},n.title)})))},l=function(e,t,r){return wp.element.createElement(_,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})},c=function(e,t,r,n){return wp.element.createElement(g,{label:r},wp.element.createElement("select",{className:"ec-store-control-select",onChange:function(r){e.setAttributes(o({},t,r.target.value))}},n.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))},a=function(e,t,r){return wp.element.createElement(g,{label:r},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(r){e.setAttributes(o({},t,r.target.value))}}))},i=function(e,t,r,n){return wp.element.createElement(g,{label:r},wp.element.createElement(h,{controls:n.map(function(r){return{icon:p.a[r.icon],title:r.title,isActive:e.attributes[t]===r.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(o({},t,r.value))}}})}))},s=function(t,r,n,l){var a="DEFAULT_CATEGORY_ID"==t.attributes[r],i=e.default_category_id,s="";i.values&&i.values.length>1&&(s=c(t,i.name,i.title,i.values));var p=l.map(function(e){return{value:e.value,label:wp.element.createElement("div",null,wp.element.createElement("span",{className:"ec-store-inspector-radio__title"},e.title),wp.element.createElement("p",null,e.description),"DEFAULT_CATEGORY_ID"==e.value&&a&&[s])}});return wp.element.createElement(g,null,wp.element.createElement(b,{label:n,className:"ec-store-inspector-radio",options:p,selected:t.attributes[r],onChange:function(e){return t.setAttributes(o({},r,e))}}))};return{buttonGroup:function(r){var o=e[r];return n(t,o.name,o.title,o.values)},toggle:function(r){var o=e[r];return l(t,o.name,o.title)},select:function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e[r];return c(t,n.name,o||n.title,n.values)},textbox:function(r){var o=e[r];return builtTextbox(t,o.name,o.title)},toolbar:function(r){var o=e[r];return i(t,o.name,o.title,o.values)},color:function(r){return wp.element.createElement(m.a,{props:t,name:r,title:e[r].title})},defaultCategoryId:function(r){var o=e[r];return o.values&&o.values.length>1?c(t,o.name,o.title,o.values):a(t,o.name,o.title)},radioButtonWithDescription:function(r){var o=e[r];return s(t,o.name,o.title,o.values)}}}function l(e){return wp.element.createElement("div",{className:"ec-store-inspector-subheader-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},e))}function c(e,t){for(var r=e.props,o=t.split(" "),n=r.clientId,l="#ec-store-block-"+n,c=jQuery(l).data("ec-store-block-stored-properties"),a=!1,i={},s=0;s<o.length;s++){var p=o[s];c&&r.attributes[p]==c[p]||(a=!0),i[p]=r.attributes[p]}return jQuery(l).data("ec-store-block-stored-properties",i),a}function a(e){var t=e.props,r=e.attributes,o=t.clientId,n=t.attributes.show_categories,l=t.attributes.show_search,a="undefined"===typeof e.render||e.render,i="ec-store-block-"+o,s="";t.attributes.default_category_id?s="defaultCategoryId="+t.attributes.default_category_id:t.attributes.default_product_id&&(s="defaultProductId="+t.attributes.default_product_id);var p="ec-store-generic-block ec-store-dynamic-block";a&&document.getElementById(i)&&document.getElementById(i).getAttribute("data-ec-store-rendered")||(p+=" ec-store-block"),n&&(p+=" ec-store-with-categories"),l&&(p+=" ec-store-with-search");var m=c(e,"default_product_id default_category_id show_search show_categories");return a&&m&&(document.getElementById(i)&&document.getElementById(i).removeAttribute("data-ec-store-rendered"),"undefined"!=typeof EcwidGutenberg&&setTimeout(function(){EcwidGutenberg.refresh()})),window.ec=window.ec||{},window.ec.storefront=window.ec.storefront||{},window.ec.config=window.ec.config||{},window.ec.config.chameleon=window.ec.config.chameleon||{},window.ec.config.chameleon.colors=[],Object.keys(r).map(function(e){var o=r[e],n="undefined"!==typeof t.attributes[e]?t.attributes[e]:r.default;-1!==e.indexOf("chameleon")?n&&(window.ec.config.chameleon.colors["color-"+e.substr(16)]=n):"undefined"!=typeof n&&(window.ec.storefront[o.name]=n)}),"undefined"!=typeof Ecwid&&Ecwid.refreshConfig&&Ecwid.refreshConfig(),wp.element.createElement("div",{className:p,"data-ec-store-widget":"productbrowser","data-ec-store-id":o,"data-ec-store-args":s,"data-ec-store-with-search":l,"data-ec-store-with-categories":n,id:i},wp.element.createElement("div",{className:"ec-store-block-header"},e.icon,e.title),wp.element.createElement("div",{className:"ec-store-block-content"},e.children),e.showDemoButton&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},__("Set up your store","ecwid-shopping-cart"))))}function i(e){var t=EcwidGutenbergParams.imagesUrl+e.src,r="";return""!=e.className&&(r=e.className),wp.element.createElement("img",{src:t,className:r})}function s(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return wp.element.createElement("div",{className:e},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block ec-store-product-filter"},wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"}),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))};switch(e.state){case"EXPAND_CATEGORIES":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #1","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #2","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"SHOW_ROOT_CATEGORIES":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Featured Products","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-m_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_bag"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"DEFAULT_CATEGORY_ID":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #1","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_bag"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"FILTERS_PAGE":return t();case"SEARCH_FILTERS_PAGE":return t("ec-store-block-filters-page");default:return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""!=e&&(e=wp.element.createElement("h5",null,e)),wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Categories","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-sneaker"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-bag"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-shirt"}))),wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Featured Products","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}()}}r.d(t,"a",function(){return n}),r.d(t,"c",function(){return l}),r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a}),r.d(t,"e",function(){return s});var p=r(0),m=r(6),d=wp.components,u=d.ButtonGroup,w=d.Button,g=d.BaseControl,h=d.Toolbar,_=d.ToggleControl,b=d.RadioControl,__=wp.i18n.__},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(r(3),r(7),r(10),r(13),r(16),r(19),r(22),r(25),r(28),r(31),r(0));wp.blocks.updateCategory("ec-store",{icon:o.a.ecwid})},function(e,t,r){"use strict";var o=r(4),n=(r.n(o),r(5)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=(p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl),u=(p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ecwid/store-block"]);i("ecwid/store-block",{title:__("Store Home Page","ecwid-shopping-cart"),icon:l.a.store,category:"ec-store",attributes:u.attributes,description:__("Add storefront (product listing)","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}if(Object.keys(e.attributes).length<=1)for(var r in u.attributes)u.attributes.hasOwnProperty(r)&&(e.attributes[r]=u.attributes[r].default);var o=e.attributes;e.setAttributes({widgets:""});var n=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),a=t(__("Display cart icon","ecwid-shopping-cart"),u.customizeMinicartText),i=(t("",__('To improve the look and feel of your product page and manage its appearance here, please enable the \u201cNext-gen look and feel of the product page on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),u.isNewProductList),p=u.isNewDetailsPage,w=u.isEnabledProductSubtitles,g=u.attributes.default_category_id&&u.attributes.default_category_id.values&&u.attributes.default_category_id.values.length>0;g&&"DEFAULT_CATEGORY_ID"==o.storefront_view||e.setAttributes({default_category_id:""});var h=Object(c.a)(u.attributes,e);return g||e.setAttributes({storefront_view:"COLLAPSE_CATEGORIES"}),[wp.element.createElement(c.d,{props:e,attributes:o,icon:l.a.store,title:__("Store Home Page","ecwid-shopping-cart"),showDemoButton:u.isDemoStore},wp.element.createElement(c.e,{state:o.storefront_view})),wp.element.createElement(s,null,g&&wp.element.createElement(m,{title:__("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[h.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==o.product_list_category_title_behavior&&[h.buttonGroup("product_list_category_image_size"),h.toolbar("product_list_category_image_aspect_ratio")]],!i&&n),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[h.toggle("product_list_show_product_images"),o.product_list_show_product_images&&[h.buttonGroup("product_list_image_size"),h.toolbar("product_list_image_aspect_ratio")],h.toolbar("product_list_product_info_layout"),h.select("product_list_title_behavior"),w&&h.select("product_list_subtitles_behavior"),h.select("product_list_price_behavior"),h.select("product_list_sku_behavior"),h.select("product_list_buybutton_behavior"),h.toggle("product_list_show_additional_image_on_hover"),h.toggle("product_list_show_frame")],!i&&n),wp.element.createElement(m,{title:__("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[h.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===o.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===o.product_details_layout)&&h.toggle("show_description_under_image"),h.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),h.toggle("product_details_show_product_name"),w&&h.toggle("product_details_show_subtitle"),h.toggle("product_details_show_breadcrumbs"),h.toggle("product_details_show_product_sku"),h.toggle("product_details_show_product_price"),h.toggle("product_details_show_qty"),h.toggle("product_details_show_number_of_items_in_stock"),h.toggle("product_details_show_in_stock_label"),h.toggle("product_details_show_wholesale_prices"),h.toggle("product_details_show_share_buttons")],!p&&n),g&&wp.element.createElement(m,{title:__("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},h.radioButtonWithDescription("storefront_view")),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},h.toggle("show_categories"),h.toggle("show_search"),h.toggle("show_breadcrumbs"),i&&h.toggle("show_footer_menu"),h.toggle("show_signin_link"),h.toggle("product_list_show_sort_viewas_options"),a),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},h.color("chameleon_color_button"),h.color("chameleon_color_foreground"),h.color("chameleon_color_price"),h.color("chameleon_color_link"),h.color("chameleon_color_background")))]},save:function(e){var t=["productbrowser"];e.attributes.show_categories&&(t[t.length]="categories"),e.attributes.show_search&&(t[t.length]="search");var r={widgets:t.join(" "),default_category_id:"undefined"!==typeof e.attributes.default_category_id?e.attributes.default_category_id:""};return new wp.shortcode({tag:u.shortcodeName,attrs:r,type:"single"}).string()},deprecated:[{attributes:{widgets:{type:"string"},categories_per_row:{type:"integer"},grid:{type:"string"},list:{type:"integer"},table:{type:"integer"},default_category_id:{type:"integer"},default_product_id:{type:"integer"},category_view:{type:"string"},search_view:{type:"string"},minicart_layout:{type:"string"}},save:function(e){return null}},{attributes:{widgets:{type:"string",default:"productbrowser"},default_category_id:{type:"integer",default:0}},migrate:function(e){return{widgets:e.widgets,default_category_id:e.default_category_id}},save:function(e){for(var t={},r=["widgets","default_category_id"],o=0;o<r.length;o++)t[r[o]]=e.attributes[r[o]];return t.default_product_id=0,new wp.shortcode({tag:u.shortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],transforms:{from:[{type:"shortcode",tag:["ecwid","ec_store"],attributes:{default_category_id:{type:"integer",shortcode:function(e){return e.default_category_id}},show_categories:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("categories")}},show_search:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("search")}}},priority:10}]}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e){function t(e){l(function(t){return{manual:"manual",color:e}}),m.setAttributes(o({},s,e))}var r=e.manual,n=e.color,l=e.setState,s=arguments[0].name,m=arguments[0].props,d=arguments[0].title,u=null===r&&null!==m.attributes[s]&&""!==m.attributes[s]||"manual"===r;u?null!==n&&m.setAttributes(o({},s,n)):m.setAttributes(o({},s,null));var w=m.attributes[s],g=wp.element.createElement("span",null,d,null!==w&&wp.element.createElement(i,{colorValue:m.attributes[s]}));return wp.element.createElement(c,{label:g,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return l(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!u},__("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:u},__("Set manually","ecwid-shopping-cart"))),u&&wp.element.createElement(a,{value:w,colors:p,onChange:t}))}r.d(t,"a",function(){return m});var l=wp.components,c=l.BaseControl,a=l.ColorPalette,i=l.ColorIndicator,s=wp.compose.withState,__=wp.i18n.__,p=[{name:__("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:__("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:__("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:__("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:__("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:__("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:__("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:__("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:__("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:__("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:__("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],m=s({manual:null,color:null})(n)},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=r(8),l=(r.n(n),r(9)),c=(r.n(l),r(0)),a=r(1),i=wp.i18n,__=i.__,_x=i._x,s=wp.blocks.registerBlockType,p=wp.blockEditor.InspectorControls,m=wp.components,d=m.PanelBody,u=m.ToggleControl,w=(wp.compose.withState,wp.element.Fragment,EcwidGutenbergParams.blockParams["ecwid/product-block"]);s("ecwid/product-block",{title:__("Product Card Small","ecwid-shopping-cart"),icon:c.a.product,category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:__("Display product with a buy button","ecwid-shopping-cart"),alignWide:!1,supports:{customClassName:!1,className:!1,html:!1,align:!0,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){function t(e,t,r){return wp.element.createElement(u,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var n=e.attributes;console.log(e);var l=function(e){var t={id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement(a.d,{props:e,attributes:n,icon:c.a.product,title:__("Product Card Small","ecwid-shopping-cart"),showDemoButton:w.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block ec-store-product-block-small"},EcwidGutenbergParams.products&&n.id&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[n.id].imageUrl})),!n.id&&wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),!n.id&&wp.element.createElement("div",{className:"ec-store-stub-sample"}),!n.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct)),EcwidGutenbergParams.products&&n.id&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("div",{className:"ec-store-product-title"},EcwidGutenbergParams.products[n.id].name)))),wp.element.createElement(p,null,n.id&&wp.element.createElement(d,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Change","ecwid-shopping-cart")))),!n.id&&wp.element.createElement(d,null,wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(d,{title:_x("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",__("Picture","ecwid-shopping-cart")),t(e,"show_title",__("Title","ecwid-shopping-cart")),t(e,"show_price",__("Price","ecwid-shopping-cart")),t(e,"show_options",__("Options","ecwid-shopping-cart")),t(e,"show_qty",__("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",__("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(d,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",__("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",__("Add border","ecwid-shopping-cart")),t(e,"center_align",__("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=r(11),l=(r.n(n),r(12)),c=(r.n(l),r(0)),a=r(1),i=wp.i18n,__=i.__,s=(i._x,wp.blocks),p=(s.BlockControls,s.registerBlockType),m=wp.blockEditor.InspectorControls,d=wp.components,u=d.PanelBody,w=d.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ec-store/buynow",{title:__("Buy Now Button","ecwid-shopping-cart"),icon:c.a.button,category:"ec-store",attributes:{id:{type:"integer"},show_price_on_button:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:__("Display a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,align:!0,alignWide:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){function t(e,t,r){return wp.element.createElement(w,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var n=e.attributes,l=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement(a.d,{props:e,attributes:n,icon:c.a.button,title:__("Buy Now Button","ecwid-shopping-cart")},wp.element.createElement("div",{className:"ec-store-block-cart-page"},wp.element.createElement(a.b,{src:"buy-now-preview.png",className:"ec-store-block-buynow-preview"})),!n.id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(m,null,n.id&&wp.element.createElement(u,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Change","ecwid-shopping-cart")))),!n.id&&wp.element.createElement(u,null,wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(u,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",__("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"center_align",__("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(14),n=(r.n(o),r(15)),l=(r.n(n),r(0)),c=wp.i18n,__=c.__;c._x;(0,wp.blocks.registerBlockType)("ec-store/search",{title:__("Product Search Box","ecwid-shopping-cart"),icon:l.a.search,category:"ec-store",description:__("Display search box","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){return e.attributes,[wp.element.createElement("div",{className:"ec-store-block ec-store-block-search"},wp.element.createElement("div",{class:"image"}))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(17),n=(r.n(o),r(18)),l=(r.n(n),r(0)),c=r(1);if(!EcwidGutenbergParams.isDemoStore){var a=wp.editor.InspectorControls,i=wp.components.PanelBody,s=wp.i18n,__=s.__,p=(s._x,wp.blocks.registerBlockType),m=EcwidGutenbergParams.blockParams["ec-store/categories"];p("ec-store/categories",{title:__("Store Categories Menu","ecwid-shopping-cart"),icon:l.a.categories,category:"ec-store",description:__("Display categories navigation bar","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){var t=(e.attributes,wp.element.createElement("div",{className:"ec-store-block ec-store-block-categories"},wp.element.createElement("div",{className:"ec-store-block-header"},wp.element.createElement("div",null,__("Categories","ecwid-shopping-cart")),wp.element.createElement(c.b,{src:"categories-menu-preview.png",className:"ec-store-categories-menu"})))),r=__('The block is hidden because you don\'t have categories in your store. <a target="_blank" href="admin.php?page=ec-store-admin-category-id-0-mode-edit">Add categories.</a>',"ecwid-shopping-cart");return[t,wp.element.createElement(a,null,wp.element.createElement(i,null,wp.element.createElement("div",{style:{height:"10px"}}),!m.has_categories&&wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}})))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(20),n=(r.n(o),r(21)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blockEditor.InspectorControls),s=wp.components,p=s.PanelBody;s.BaseControl;(0,wp.blocks.registerBlockType)("ec-store/minicart",{title:__("Shopping Cart Icon","ecwid-shopping-cart"),icon:l.a.cart,category:"ec-store",description:__("Display shopping bag link and summary","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable,align:!0,alignWide:!1},attributes:EcwidGutenbergParams.minicartAttributes,example:{},edit:function(e){function t(e,t,o){var n=EcwidGutenbergParams.minicartAttributes[t];return"undefined"===typeof o&&(o=n.type),r.select(t)}var r=(e.attributes,Object(c.a)(EcwidGutenbergParams.minicartAttributes,e));return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-minicart"},wp.element.createElement("div",{className:"image"})),wp.element.createElement(i,null,wp.element.createElement(p,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!0},t(e,"layout","select"),t(e,"icon","select"),t(e,"fixed_shape","select")))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(23),n=(r.n(o),r(24)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,l.a,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=p.BaseControl,u=EcwidGutenbergParams.blockParams["ec-store/category-page"];i("ec-store/category-page",{title:__("Store Category Page","ecwid-shopping-cart"),icon:l.a.category,category:"ec-store",attributes:EcwidGutenbergStoreBlockParams.attributes,description:__("Display category page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var o=wp.element.createElement(c.d,{props:e,attributes:r,icon:l.a.category,title:__("Store Category Page","ecwid-shopping-cart"),showDemoButton:u.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-sneaker"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-bag"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-shirt"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-hat"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-watch"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-glasses"})))),n=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),a=t(__("Display cart icon","ecwid-shopping-cart"),u.customizeMinicartText),i=u.isNewProductList,p=u.isNewDetailsPage,w=Object(c.a)(u.attributes,e);return[o,wp.element.createElement(s,null,wp.element.createElement(m,null,!EcwidGutenbergParams.hasCategories&&wp.element.createElement("div",{style:{margin:"10px"}},wp.element.createElement("a",{href:"admin.php?page=ec-store-admin-category-id-0-mode-edit",target:"_blank",class:"button button-primary"},__("Add categories","ecwid-shopping-cart"))),EcwidGutenbergParams.hasCategories&&[!e.attributes.default_category_id&&w.select("default_category_id",__("Select category","ecwid-shopping-cart")),e.attributes.default_category_id&&w.select("default_category_id",__("Selected category","ecwid-shopping-cart"))]),wp.element.createElement(m,{title:__("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[w.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[w.buttonGroup("product_list_category_image_size"),w.toolbar("product_list_category_image_aspect_ratio")]],!i&&n),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[w.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[w.buttonGroup("product_list_image_size"),w.toolbar("product_list_image_aspect_ratio")],w.toolbar("product_list_product_info_layout"),w.select("product_list_title_behavior"),w.select("product_list_price_behavior"),w.select("product_list_sku_behavior"),w.select("product_list_buybutton_behavior"),w.toggle("product_list_show_additional_image_on_hover"),w.toggle("product_list_show_frame")],!i&&n),wp.element.createElement(m,{title:__("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!p&&productDetailsMigrationWarning),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},w.toggle("show_categories"),w.toggle("show_search"),w.toggle("show_breadcrumbs"),i&&w.toggle("show_footer_menu"),w.toggle("show_signin_link"),w.toggle("product_list_show_sort_viewas_options"),a),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(26),n=(r.n(o),r(27)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=p.BaseControl,u=(wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/product-page"]);i("ec-store/product-page",{title:__("Product Card Large","ecwid-shopping-cart"),icon:l.a.product,category:"ec-store",attributes:u.attributes,description:__("Display product page with description and a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e){ecwid_open_product_popup({saveCallback:n,props:e})}function r(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var o=e.attributes,n=function(e){var t={default_product_id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)},a=wp.element.createElement(c.d,{props:e,attributes:o,icon:l.a.product,title:__("Product Card Large","ecwid-shopping-cart")},wp.element.createElement(c.b,{src:"product-page-preview.png",className:"ec-store-product-page-preview"}),!o.default_product_id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:n,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),i=r("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),p=(r("",__('To improve the look and feel of your product page and manage your its appearance here, please enable the \u201cNext-gen look and feel of the product page on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),u.isNewDetailsPage),w=Object(c.a)(u.attributes,e);return[a,wp.element.createElement(s,null,o.default_product_id>0&&wp.element.createElement(m,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.default_product_id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.default_product_id].name),wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},__("Change","ecwid-shopping-cart")))),!o.default_product_id&&wp.element.createElement(m,null,wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(m,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===o.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===o.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!p&&i),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(29),n=(r.n(o),r(30)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=(p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl),u=(p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/filters-page"]);i("ec-store/filters-page",{title:__("Product Search and filters","ecwid-shopping-cart"),icon:l.a.filters,category:"ec-store",attributes:u.attributes,description:__("Display search page with filters on a side","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes,o=wp.element.createElement(c.d,{props:e,attributes:r,icon:l.a.filters,title:__("Search and Filters","ecwid-shopping-cart")},wp.element.createElement(c.e,{state:"SEARCH_FILTERS_PAGE"})),n=t("",__('You can enable filters in the store settings: (\u201c<a target="_blank" href="admin.php?page=ec-store-admin-product-filters-mode-main">Settings \u2192 Product Filters</a>\u201d).',"ecwid-shopping-cart")),a=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),i=u.isNewProductList,p=Object(c.a)(u.attributes,e);return[o,wp.element.createElement(s,null,wp.element.createElement(m,{title:__("Filters","ecwid-shopping-cart"),initialOpen:!1},!u.filtersEnabled&&n,u.filtersEnabled&&[p.select("product_filters_position_search_page")]),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[p.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[p.buttonGroup("product_list_image_size"),p.toolbar("product_list_image_aspect_ratio")],p.toolbar("product_list_product_info_layout"),p.select("product_list_title_behavior"),p.select("product_list_price_behavior"),p.select("product_list_sku_behavior"),p.select("product_list_buybutton_behavior"),p.toggle("product_list_show_additional_image_on_hover"),p.toggle("product_list_show_frame")],!i&&a),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},p.toggle("show_categories"),p.toggle("show_breadcrumbs"),i&&p.toggle("show_footer_menu"),p.toggle("show_signin_link"),p.toggle("product_list_show_sort_viewas_options")),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},p.color("chameleon_color_button"),p.color("chameleon_color_foreground"),p.color("chameleon_color_price"),p.color("chameleon_color_link"),p.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(32),n=(r.n(o),r(33)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=(wp.blockEditor.InspectorControls,wp.components),p=(s.PanelBody,s.PanelRow,s.ToggleControl,s.ButtonGroup,s.Button,s.BaseControl,s.Toolbar,s.ColorPalette,s.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/cart-page"]);i("ec-store/cart-page",{title:__("Cart and Checkout","ecwid-shopping-cart"),icon:l.a.cartPage,category:"ec-store",attributes:p.attributes,description:__("Display shopping cart and checkout page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){var t=e.attributes;return[wp.element.createElement(c.d,{props:e,attributes:t,icon:l.a.cartPage,title:__("Cart and Checkout","ecwid-shopping-cart")},wp.element.createElement("div",{className:"ec-store-block-cart-page"},wp.element.createElement(c.b,{src:"cart-page-preview.png"})))]},save:function(e){return null}})},function(e,t){},function(e,t){}]);
|
1 |
+
!function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",function(){return c});var n,l,c={ecwid:wp.element.createElement("svg",{class:"ec-store-icon",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 215 215","enable-background":"new 0 0 215 215"},wp.element.createElement("g",{fill:"#0087cd"},wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M160.68,163.34c-3.67,0-6.65,2.98-6.65,6.66c0,3.68,2.98,6.66,6.65,6.66 c3.68,0,6.66-2.98,6.66-6.66C167.34,166.32,164.36,163.34,160.68,163.34z"}),wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M53.46,162.51c-3.67,0-6.65,2.98-6.65,6.66c0,3.68,2.98,6.66,6.65,6.66 c3.68,0,6.66-2.98,6.66-6.66C60.12,165.49,57.14,162.51,53.46,162.51z"}),wp.element.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M166.12,0H48.88C21.89,0,0,21.89,0,48.89v117.23c0,27,21.89,48.88,48.88,48.88 h117.24c27,0,48.88-21.88,48.88-48.88V48.88C215,21.89,193.11,0,166.12,0z M134.43,57.85c5.36,0,9.7,4.34,9.7,9.7 c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C124.73,62.19,129.07,57.85,134.43,57.85z M134.43,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S129.07,85.25,134.43,85.25z M107.09,57.85 c5.36,0,9.7,4.34,9.7,9.7c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C97.39,62.19,101.73,57.85,107.09,57.85z M107.09,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S101.73,85.25,107.09,85.25z M79.75,57.85 c5.36,0,9.7,4.34,9.7,9.7c0,5.36-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7C70.05,62.19,74.39,57.85,79.75,57.85z M79.75,85.25 c5.36,0,9.7,4.34,9.7,9.7s-4.34,9.7-9.7,9.7c-5.36,0-9.7-4.34-9.7-9.7S74.39,85.25,79.75,85.25z M53.46,187.72 c-10.24,0-18.55-8.31-18.55-18.55c0-10.25,8.31-18.56,18.55-18.56c10.25,0,18.56,8.31,18.56,18.56 C72.03,179.41,63.71,187.72,53.46,187.72z M160.68,188.55c-10.24,0-18.55-8.31-18.55-18.55c0-10.25,8.31-18.56,18.55-18.56 c10.25,0,18.56,8.31,18.56,18.56C179.24,180.24,170.93,188.55,160.68,188.55z M193.27,37.66l-19.18,71.44 c-5.12,19.07-21.28,31.04-41.03,31.04h-12.65c-4.18,0-10.23-2.26-12.74-4.62c-0.42-0.39-1.08-0.39-1.5,0 c-2.51,2.36-8.56,4.62-12.74,4.62h-13.9c-19.12,0-33.61-10.9-39.41-29.12L23.81,59.86c-0.32-1.02-0.15-2.1,0.49-2.97 c0.63-0.86,1.6-1.36,2.69-1.36l3.12,0.01c7.52,0.03,14.11,4.86,16.38,12.02l11.98,37.62c3.24,10.19,13.61,17.04,24.3,17.04 l4.65-0.01c4.8,0,8.18-2.46,10.22-4.66c1.06-1.15,2.54-1.82,4.11-1.82l10.44,0.01c1.48,0,2.92,0.59,3.91,1.68 c1.98,2.17,5.49,4.79,10.33,4.79l4.43,0.01c11.04,0,21.75-7.45,24.62-18.11l15.53-57.84c2.03-7.53,8.88-12.78,16.67-12.78l2.74,0 c0.26,0,0.52,0.04,0.76,0.14C192.93,34.37,193.7,36.08,193.27,37.66z"}))),store:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"2",transform:"translate(0 3)"},wp.element.createElement("path",{d:"M20 7L20 17C20 18.1045695 19.1045695 19 18 19L4 19C2.8954305 19 2 18.1045695 2 17L2 7 2 7M1 0L21 0 21.5808632 3.48517907C21.8145004 4.88700236 20.8935617 6.22128765 19.5 6.5L18.9764235 6.60471529C17.7961226 6.84077548 16.5971903 6.29508301 16 5.25L16 5.25 16 5.25 15.7442084 5.69763529C15.2840087 6.50298484 14.4275622 7 13.5 7 12.5724378 7 11.7159913 6.50298484 11.2557916 5.69763529L11 5.25 11 5.25 10.7442084 5.69763529C10.2840087 6.50298484 9.42756224 7 8.5 7 7.57243776 7 6.71599134 6.50298484 6.25579159 5.69763529L6 5.25 6 5.25C5.40280971 6.29508301 4.20387741 6.84077548 3.02357646 6.60471529L2.5 6.5C1.10643827 6.22128765.185499607 4.88700236.419136822 3.48517907L1 0 1 0z"}),wp.element.createElement("polygon",{points:"7 11 15 11 15 19 7 19"}))),product:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd","stroke-linecap":"round","stroke-linejoin":"round"},wp.element.createElement("path",{stroke:"currentColor","stroke-width":"2",d:"M5.5638852,7 L18.4361148,7 C19.3276335,7 19.6509198,7.09282561 19.9768457,7.2671327 C20.3027716,7.4414398 20.5585602,7.69722837 20.7328673,8.0231543 C20.9071744,8.34908022 21,8.67236646 21,9.5638852 L21,20.4361148 C21,21.3276335 20.9071744,21.6509198 20.7328673,21.9768457 C20.5585602,22.3027716 20.3027716,22.5585602 19.9768457,22.7328673 C19.6509198,22.9071744 19.3276335,23 18.4361148,23 L5.5638852,23 C4.67236646,23 4.34908022,22.9071744 4.0231543,22.7328673 C3.69722837,22.5585602 3.4414398,22.3027716 3.2671327,21.9768457 C3.09282561,21.6509198 3,21.3276335 3,20.4361148 L3,9.5638852 C3,8.67236646 3.09282561,8.34908022 3.2671327,8.0231543 C3.4414398,7.69722837 3.69722837,7.4414398 4.0231543,7.2671327 C4.34908022,7.09282561 4.67236646,7 5.5638852,7 Z"}),wp.element.createElement("path",{stroke:"currentColor","stroke-width":"2",d:"M8,10 L8,6 C8,3.790861 9.790861,2 12,2 C14.209139,2 16,3.790861 16,6 L16,10 L16,10"}))),aspect169:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"9",y:"14",width:"22",height:"12",rx:"2"}))),aspect916:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"}," ",wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"14",y:"9",width:"12",height:"22",rx:"2"}))),aspect11:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"12",width:"16",height:"16",rx:"2"}))),aspect34:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"10",width:"16",height:"20",rx:"2"}))),aspect43:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"10",y:"12",width:"20",height:"16",rx:"2"}))),textalignleft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textaligncenter:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"16",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"12",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"22",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignright:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignjustify:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",zoomAndPan:"1.5",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),productLayout3Columns:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",transform:"translate(13.000000, 19.500000) rotate(-270.000000) translate(-13.000000, -19.500000) ",x:"3.5",y:"16.5",width:"19",height:"6",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"10",width:"5",height:"19"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"10",width:"5",height:"8"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"19",width:"5",height:"10"}))),productLayout2ColumnsLeft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"17",y:"10",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"10",width:"5",height:"5"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"17",width:"5",height:"12"}))),productLayout2ColumnsRight:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"12"})))),productLayout2ColumnsBottom:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"12",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"12"}),wp.element.createElement("rect",{x:"0",y:"14",width:"20",height:"5"})))),galleryLayoutHorizontal:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.000000, 20.500000) rotate(-180.000000) translate(-20.000000, -20.500000) translate(10.000000, 11.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"14",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"6"})))),galleryLayoutVertical:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(19.500000, 20.000000) rotate(-270.000000) translate(-19.500000, -20.000000) translate(9.500000, 10.500000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"-1.13686838e-13",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"-1.13686838e-13",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"13",width:"5",height:"6"})))),galleryLayoutFeed:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.500000, 12.500000) rotate(-270.000000) translate(-20.500000, -12.500000) translate(14.000000, 3.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})),wp.element.createElement("g",{transform:"translate(20.500000, 27.500000) rotate(-270.000000) translate(-20.500000, -27.500000) translate(14.000000, 18.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})))),cart:wp.element.createElement("svg",(n={class:"ec-store-icon-color"},o(n,"class","ec-store-icon-color"),o(n,"width","24px"),o(n,"height","24px"),o(n,"viewBox","0 0 24 24"),o(n,"version","1.1"),n),wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -415.000000)"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(352.000000, 415.000000)"},wp.element.createElement("path",{d:"M4.5269723,4 L2,4 C1.44771525,4 1,3.55228475 1,3 C1,2.44771525 1.44771525,2 2,2 L5.33333333,2 C5.80393835,2 6.21086155,2.32812702 6.31061146,2.788039 L7.22413999,7 L21,7 C21.6640252,7 22.143636,7.63527258 21.9617572,8.27390353 L19.968471,15.272927 C19.8460922,15.7026358 19.4535094,15.9990234 19.0067139,15.9990234 L7.93579102,15.9990234 C7.465186,15.9990234 7.0582628,15.6708964 6.95851289,15.2109844 L4.5269723,4 Z M7.65791824,9 L8.74215205,13.9990234 L18.2517453,13.9990234 L19.6754416,9 L7.65791824,9 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"9",cy:"20",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"18",cy:"20",r:"2"}))))),search:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",transform:"translate(1.667 1.667)"},wp.element.createElement("line",{x1:"10.667",x2:"14.667",y1:"10.667",y2:"14.667"}),wp.element.createElement("circle",{cx:"6",cy:"6",r:"6","stroke-linejoin":"round"}))),categories:wp.element.createElement("svg",(l={class:"ec-store-icon-color"},o(l,"class","ec-store-icon-color"),o(l,"width","24px"),o(l,"height","24px"),o(l,"viewBox","0 0 24 24"),o(l,"version","1.1"),l),wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -416.000000)"},wp.element.createElement("g",{id:"categories-icon",transform:"translate(234.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Triangle",points:"3 2 5.5 7 0.5 7"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 6 8 4 23 4 23 6"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 13 8 11 23 11 23 13"}),wp.element.createElement("polygon",{id:"Line","fill-rule":"nonzero",points:"8 20 8 18 23 18 23 20"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"currentColor","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"11",width:"2",height:"2"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"currentColor","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"18",width:"2",height:"2",rx:"1"}))))),category:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4.5638852 2L7.4361148 2C8.32763354 2 8.65091978 2.09282561 8.9768457 2.2671327 9.30277163 2.4414398 9.5585602 2.69722837 9.7328673 3.0231543 9.90717439 3.34908022 10 3.67236646 10 4.5638852L10 7.4361148C10 8.32763354 9.90717439 8.65091978 9.7328673 8.9768457 9.5585602 9.30277163 9.30277163 9.5585602 8.9768457 9.7328673 8.65091978 9.90717439 8.32763354 10 7.4361148 10L4.5638852 10C3.67236646 10 3.34908022 9.90717439 3.0231543 9.7328673 2.69722837 9.5585602 2.4414398 9.30277163 2.2671327 8.9768457 2.09282561 8.65091978 2 8.32763354 2 7.4361148L2 4.5638852C2 3.67236646 2.09282561 3.34908022 2.2671327 3.0231543 2.4414398 2.69722837 2.69722837 2.4414398 3.0231543 2.2671327 3.34908022 2.09282561 3.67236646 2 4.5638852 2zM4.5638852 14L7.4361148 14C8.32763354 14 8.65091978 14.0928256 8.9768457 14.2671327 9.30277163 14.4414398 9.5585602 14.6972284 9.7328673 15.0231543 9.90717439 15.3490802 10 15.6723665 10 16.5638852L10 19.4361148C10 20.3276335 9.90717439 20.6509198 9.7328673 20.9768457 9.5585602 21.3027716 9.30277163 21.5585602 8.9768457 21.7328673 8.65091978 21.9071744 8.32763354 22 7.4361148 22L4.5638852 22C3.67236646 22 3.34908022 21.9071744 3.0231543 21.7328673 2.69722837 21.5585602 2.4414398 21.3027716 2.2671327 20.9768457 2.09282561 20.6509198 2 20.3276335 2 19.4361148L2 16.5638852C2 15.6723665 2.09282561 15.3490802 2.2671327 15.0231543 2.4414398 14.6972284 2.69722837 14.4414398 3.0231543 14.2671327 3.34908022 14.0928256 3.67236646 14 4.5638852 14zM16.5638852 2L19.4361148 2C20.3276335 2 20.6509198 2.09282561 20.9768457 2.2671327 21.3027716 2.4414398 21.5585602 2.69722837 21.7328673 3.0231543 21.9071744 3.34908022 22 3.67236646 22 4.5638852L22 7.4361148C22 8.32763354 21.9071744 8.65091978 21.7328673 8.9768457 21.5585602 9.30277163 21.3027716 9.5585602 20.9768457 9.7328673 20.6509198 9.90717439 20.3276335 10 19.4361148 10L16.5638852 10C15.6723665 10 15.3490802 9.90717439 15.0231543 9.7328673 14.6972284 9.5585602 14.4414398 9.30277163 14.2671327 8.9768457 14.0928256 8.65091978 14 8.32763354 14 7.4361148L14 4.5638852C14 3.67236646 14.0928256 3.34908022 14.2671327 3.0231543 14.4414398 2.69722837 14.6972284 2.4414398 15.0231543 2.2671327 15.3490802 2.09282561 15.6723665 2 16.5638852 2zM16.5638852 14L19.4361148 14C20.3276335 14 20.6509198 14.0928256 20.9768457 14.2671327 21.3027716 14.4414398 21.5585602 14.6972284 21.7328673 15.0231543 21.9071744 15.3490802 22 15.6723665 22 16.5638852L22 19.4361148C22 20.3276335 21.9071744 20.6509198 21.7328673 20.9768457 21.5585602 21.3027716 21.3027716 21.5585602 20.9768457 21.7328673 20.6509198 21.9071744 20.3276335 22 19.4361148 22L16.5638852 22C15.6723665 22 15.3490802 21.9071744 15.0231543 21.7328673 14.6972284 21.5585602 14.4414398 21.3027716 14.2671327 20.9768457 14.0928256 20.6509198 14 20.3276335 14 19.4361148L14 16.5638852C14 15.6723665 14.0928256 15.3490802 14.2671327 15.0231543 14.4414398 14.6972284 14.6972284 14.4414398 15.0231543 14.2671327 15.3490802 14.0928256 15.6723665 14 16.5638852 14z"})),button:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-345.000000, -280.000000)","fill-rule":"nonzero"},wp.element.createElement("g",{id:"button-icon",transform:"translate(345.000000, 280.000000)"},wp.element.createElement("path",{d:"M4,8 L4,16 L20,16 L20,8 L4,8 Z M4,6 L20,6 C21.1045695,6 22,6.8954305 22,8 L22,16 C22,17.1045695 21.1045695,18 20,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,8 C2,6.8954305 2.8954305,6 4,6 Z",id:"Rectangle-5"}),wp.element.createElement("path",{d:"M13.8320367,9.8101295 C14.2137832,9.41102047 14.8467917,9.3969454 15.2459008,9.77869195 C15.6450098,10.1604385 15.6590849,10.793447 15.2773383,11.192556 L12.2122748,14.3970238 C11.8300377,14.7966458 11.1960253,14.8101668 10.7970986,14.427204 L9.5128579,13.1943549 C9.11444327,12.8118837 9.10151859,12.1788506 9.48398981,11.780436 C9.86646103,11.3820214 10.4994941,11.3690967 10.8979087,11.7515679 L11.4594438,12.290632 L13.8320367,9.8101295 Z",id:"Line-6"}))))),productPreview:wp.element.createElement("svg",{width:"72px",height:"72px",viewBox:"0 0 72 72",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets",transform:"translate(-625.000000, -811.000000)",fill:"#AAAAAA"},wp.element.createElement("g",{id:"Group-2",transform:"translate(571.000000, 756.000000)"},wp.element.createElement("g",{id:"product-preview",transform:"translate(54.000000, 55.000000)"},wp.element.createElement("path",{d:"M6,25 L6,69 L66,69 L66,25 L6,25 Z M4,23 L68,23 L68,71 L4,71 L4,23 Z",id:"Rectangle-2-Copy-2","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M36.5,23.5 L65.836706,23.5 L67.2237665,22.8226349 L55.0328393,7.34740904 L39.8812213,0.895706316 L40.7501329,7.5 L17.0403124,7.5 L5.04031242,22.5 L6.32093727,22.5 L17.5209373,8.5 L36.5,8.5 L36.5,23.5 Z M42.9573255,16.6099474 L41.1011835,2.50206036 L54.4056315,8.16722056 L66.5284549,23.5566573 L42.9573255,16.6099474 Z",id:"Combined-Shape",stroke:"#AAAAAA"}),wp.element.createElement("path",{d:"M29.8056641,41.53125 C29.9375,38.2060547 32.2080078,35.6865234 36.4560547,35.6865234 C40.3232422,35.6865234 42.9306641,37.9863281 42.9306641,41.1210938 C42.9306641,43.3916016 41.7880859,44.9882812 39.8544922,46.1455078 C37.9648438,47.2587891 37.4228516,48.0351562 37.4228516,49.5439453 L37.4228516,50.4375 L34.390625,50.4375 L34.3759766,49.265625 C34.3027344,47.2001953 35.1962891,45.8818359 37.203125,44.6806641 C38.9755859,43.6113281 39.6054688,42.7617188 39.6054688,41.2529297 C39.6054688,39.5976562 38.3017578,38.3818359 36.2949219,38.3818359 C34.2734375,38.3818359 32.9697266,39.5976562 32.8378906,41.53125 L29.8056641,41.53125 Z M35.9287109,57.2197266 C34.859375,57.2197266 34.0097656,56.3994141 34.0097656,55.3300781 C34.0097656,54.2607422 34.859375,53.4404297 35.9287109,53.4404297 C37.0273438,53.4404297 37.8623047,54.2607422 37.8623047,55.3300781 C37.8623047,56.3994141 37.0273438,57.2197266 35.9287109,57.2197266 Z",id:"?"})))))),filters:wp.element.createElement("svg",{class:"ec-store-icon-color",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wp.element.createElement("g",{fill:"none","fill-rule":"evenodd","stroke-linecap":"round"},wp.element.createElement("line",{x1:"2",x2:"22",y1:"7",y2:"7",stroke:"currentColor","stroke-width":"2"}),wp.element.createElement("line",{x1:"6",x2:"18",y1:"13",y2:"13",stroke:"currentColor","stroke-width":"2"}),wp.element.createElement("line",{x1:"11",x2:"13",y1:"19",y2:"19",stroke:"currentColor","stroke-width":"2"}))),cartPage:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -500.000000)"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(470.000000, 500.000000)"},wp.element.createElement("g",{id:"Group-6",transform:"translate(2.000000, 3.000000)"},wp.element.createElement("path",{d:"M2.5269723,1 L0,1 C-0.55228475,1 -1,0.55228475 -1,-1.11022302e-16 C-1,-0.55228475 -0.55228475,-1 0,-1 L3.33333333,-1 C3.80393835,-1 4.21086155,-0.671872981 4.31061146,-0.211960997 L6.74215205,10.9990234 L16.2517453,10.9990234 L17.6754416,6 L17.0067139,6 C16.4544291,6 16.0067139,5.55228475 16.0067139,5 C16.0067139,4.44771525 16.4544291,4 17.0067139,4 L19,4 C19.6640252,4 20.143636,4.63527258 19.9617572,5.27390353 L17.968471,12.272927 C17.8460922,12.7026358 17.4535094,12.9990234 17.0067139,12.9990234 L5.93579102,12.9990234 C5.465186,12.9990234 5.0582628,12.6708964 4.95851289,12.2109844 L2.5269723,1 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M13.6266547,1.30878828 C14.0084012,0.909679249 14.6414097,0.895604177 15.0405188,1.27735072 C15.4396278,1.65909727 15.4537029,2.29210579 15.0719563,2.69121482 L11.0068929,6.89568259 C10.6246557,7.29530459 9.99064332,7.30882561 9.59171662,6.92586281 L7.61584318,5.00113813 C7.21742856,4.61866691 7.20450388,3.98563386 7.5869751,3.58721924 C7.96944632,3.18880462 8.60247937,3.17587994 9.00089399,3.55835116 L10.2540618,4.78929076 L13.6266547,1.30878828 Z",id:"Line-6","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"7",cy:"17",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"16",cy:"17",r:"2"})))))),latestProducts:wp.element.createElement("svg",{class:"ec-store-icon-color",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -416.000000)","fill-rule":"nonzero"},wp.element.createElement("g",{transform:"translate(470.000000, 416.000000)"},wp.element.createElement("path",{d:"M5,17 L5,20 L9,20 L9,17 L5,17 Z M3,15 L11,15 L11,22 L3,22 L3,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M5,8 L5,11 L9,11 L9,8 L5,8 Z M3,6 L11,6 L11,13 L3,13 L3,6 Z",id:"Rectangle-2-Copy"}),wp.element.createElement("path",{d:"M15,17 L15,20 L19,20 L19,17 L15,17 Z M13,15 L21,15 L21,22 L13,22 L13,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M15,8 L15,11 L19,11 L19,8 L15,8 Z M13,6 L21,6 L21,13 L13,13 L13,6 Z",id:"Rectangle-2-Copy-3"})))))}},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=t.attributes,n=function(e,t,n,l){return wp.element.createElement(g,{label:n},wp.element.createElement(u,{className:"ec-store-inspector-button-group"},l.map(function(n){return wp.element.createElement(w,{isPrimary:r[t]===n.value,onClick:function(){return e.setAttributes(o({},t,n.value))}},n.title)})))},l=function(e,t,r){return wp.element.createElement(_,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})},c=function(e,t,r,n){return wp.element.createElement(g,{label:r},wp.element.createElement("select",{className:"ec-store-control-select",onChange:function(r){e.setAttributes(o({},t,r.target.value))}},n.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))},a=function(e,t,r){return wp.element.createElement(g,{label:r},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(r){e.setAttributes(o({},t,r.target.value))}}))},i=function(e,t,r,n){return wp.element.createElement(g,{label:r},wp.element.createElement(h,{controls:n.map(function(r){return{icon:p.a[r.icon],title:r.title,isActive:e.attributes[t]===r.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(o({},t,r.value))}}})}))},s=function(t,r,n,l){var a="DEFAULT_CATEGORY_ID"==t.attributes[r],i=e.default_category_id,s="";i.values&&i.values.length>1&&(s=c(t,i.name,i.title,i.values));var p=l.map(function(e){return{value:e.value,label:wp.element.createElement("div",null,wp.element.createElement("span",{className:"ec-store-inspector-radio__title"},e.title),wp.element.createElement("p",null,e.description),"DEFAULT_CATEGORY_ID"==e.value&&a&&[s])}});return wp.element.createElement(g,null,wp.element.createElement(b,{label:n,className:"ec-store-inspector-radio",options:p,selected:t.attributes[r],onChange:function(e){return t.setAttributes(o({},r,e))}}))};return{buttonGroup:function(r){var o=e[r];return n(t,o.name,o.title,o.values)},toggle:function(r){var o=e[r];return l(t,o.name,o.title)},select:function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e[r];return c(t,n.name,o||n.title,n.values)},textbox:function(r){var o=e[r];return builtTextbox(t,o.name,o.title)},toolbar:function(r){var o=e[r];return i(t,o.name,o.title,o.values)},color:function(r){return wp.element.createElement(m.a,{props:t,name:r,title:e[r].title})},defaultCategoryId:function(r){var o=e[r];return o.values&&o.values.length>1?c(t,o.name,o.title,o.values):a(t,o.name,o.title)},radioButtonWithDescription:function(r){var o=e[r];return s(t,o.name,o.title,o.values)}}}function l(e){return wp.element.createElement("div",{className:"ec-store-inspector-subheader-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},e))}function c(e,t){for(var r=e.props,o=t.split(" "),n=r.clientId,l="#ec-store-block-"+n,c=jQuery(l).data("ec-store-block-stored-properties"),a=!1,i={},s=0;s<o.length;s++){var p=o[s];c&&r.attributes[p]==c[p]||(a=!0),i[p]=r.attributes[p]}return jQuery(l).data("ec-store-block-stored-properties",i),a}function a(e){var t=e.props,r=e.attributes,o=t.clientId,n=t.attributes.show_categories,l=t.attributes.show_search,a="undefined"===typeof e.render||e.render,i="ec-store-block-"+o,s="";t.attributes.default_category_id?s="defaultCategoryId="+t.attributes.default_category_id:t.attributes.default_product_id&&(s="defaultProductId="+t.attributes.default_product_id);var p="ec-store-generic-block ec-store-dynamic-block";a&&document.getElementById(i)&&document.getElementById(i).getAttribute("data-ec-store-rendered")||(p+=" ec-store-block"),n&&(p+=" ec-store-with-categories"),l&&(p+=" ec-store-with-search");var m=c(e,"default_product_id default_category_id show_search show_categories");return a&&m&&(document.getElementById(i)&&document.getElementById(i).removeAttribute("data-ec-store-rendered"),"undefined"!=typeof EcwidGutenberg&&setTimeout(function(){EcwidGutenberg.refresh()})),window.ec=window.ec||{},window.ec.storefront=window.ec.storefront||{},window.ec.config=window.ec.config||{},window.ec.config.chameleon=window.ec.config.chameleon||{},window.ec.config.chameleon.colors=[],Object.keys(r).map(function(e){var o=r[e],n="undefined"!==typeof t.attributes[e]?t.attributes[e]:r.default;-1!==e.indexOf("chameleon")?n&&(window.ec.config.chameleon.colors["color-"+e.substr(16)]=n):"undefined"!=typeof n&&(window.ec.storefront[o.name]=n)}),"undefined"!=typeof Ecwid&&Ecwid.refreshConfig&&Ecwid.refreshConfig(),wp.element.createElement("div",{className:p,"data-ec-store-widget":"productbrowser","data-ec-store-id":o,"data-ec-store-args":s,"data-ec-store-with-search":l,"data-ec-store-with-categories":n,id:i},wp.element.createElement("div",{className:"ec-store-block-header"},e.icon,e.title),wp.element.createElement("div",{className:"ec-store-block-content"},e.children),e.showDemoButton&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},__("Set up your store","ecwid-shopping-cart"))))}function i(e){var t=EcwidGutenbergParams.imagesUrl+e.src,r="";return""!=e.className&&(r=e.className),wp.element.createElement("img",{src:t,className:r})}function s(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return wp.element.createElement("div",{className:e},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block ec-store-product-filter"},wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"}),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))};switch(e.state){case"EXPAND_CATEGORIES":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #1","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #2","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"SHOW_ROOT_CATEGORIES":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Featured Products","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-m_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_bag"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"DEFAULT_CATEGORY_ID":return function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Category #1","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_watch"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_bag"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}();case"FILTERS_PAGE":return t();case"SEARCH_FILTERS_PAGE":return t("ec-store-block-filters-page");default:return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return""!=e&&(e=wp.element.createElement("h5",null,e)),wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Categories","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-sneaker"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-bag"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-shirt"}))),wp.element.createElement("div",{className:"ec-store-block-subheader"},__("Featured Products","ecwid-shopping-cart")),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-g_sneaker"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-p_shirt"}),wp.element.createElement("div",{className:"ec-store-stub-sample"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-product-b_hat"}),wp.element.createElement("div",{className:"ec-store-stub-sample"}))))}()}}r.d(t,"a",function(){return n}),r.d(t,"c",function(){return l}),r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a}),r.d(t,"e",function(){return s});var p=r(0),m=r(6),d=wp.components,u=d.ButtonGroup,w=d.Button,g=d.BaseControl,h=d.Toolbar,_=d.ToggleControl,b=d.RadioControl,__=wp.i18n.__},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(r(3),r(7),r(10),r(13),r(16),r(19),r(22),r(25),r(28),r(31),r(0));wp.blocks.updateCategory("ec-store",{icon:o.a.ecwid})},function(e,t,r){"use strict";var o=r(4),n=(r.n(o),r(5)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=(p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl),u=(p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ecwid/store-block"]);i("ecwid/store-block",{title:__("Store Home Page","ecwid-shopping-cart"),icon:l.a.store,category:"ec-store",attributes:u.attributes,description:__("Add storefront (product listing)","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}if(Object.keys(e.attributes).length<=1)for(var r in u.attributes)u.attributes.hasOwnProperty(r)&&(e.attributes[r]=u.attributes[r].default);var o=e.attributes;e.setAttributes({widgets:""});var n=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),a=t(__("Display cart icon","ecwid-shopping-cart"),u.customizeMinicartText),i=(t("",__('To improve the look and feel of your product page and manage its appearance here, please enable the \u201cNext-gen look and feel of the product page on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),u.isNewProductList),p=u.isNewDetailsPage,w=u.isEnabledProductSubtitles,g=u.attributes.default_category_id&&u.attributes.default_category_id.values&&u.attributes.default_category_id.values.length>0;g&&"DEFAULT_CATEGORY_ID"==o.storefront_view||e.setAttributes({default_category_id:""});var h=Object(c.a)(u.attributes,e);return g||e.setAttributes({storefront_view:"COLLAPSE_CATEGORIES"}),[wp.element.createElement(c.d,{props:e,attributes:o,icon:l.a.store,title:__("Store Home Page","ecwid-shopping-cart"),showDemoButton:u.isDemoStore},wp.element.createElement(c.e,{state:o.storefront_view})),wp.element.createElement(s,null,g&&wp.element.createElement(m,{title:__("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[h.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==o.product_list_category_title_behavior&&[h.buttonGroup("product_list_category_image_size"),h.toolbar("product_list_category_image_aspect_ratio")]],!i&&n),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[h.toggle("product_list_show_product_images"),o.product_list_show_product_images&&[h.buttonGroup("product_list_image_size"),h.toolbar("product_list_image_aspect_ratio")],h.toolbar("product_list_product_info_layout"),h.select("product_list_title_behavior"),w&&h.select("product_list_subtitles_behavior"),h.select("product_list_price_behavior"),h.select("product_list_sku_behavior"),h.select("product_list_buybutton_behavior"),h.toggle("product_list_show_additional_image_on_hover"),h.toggle("product_list_show_frame")],!i&&n),wp.element.createElement(m,{title:__("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[h.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===o.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===o.product_details_layout)&&h.toggle("show_description_under_image"),h.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),h.toggle("product_details_show_product_name"),w&&h.toggle("product_details_show_subtitle"),h.toggle("product_details_show_breadcrumbs"),h.toggle("product_details_show_product_sku"),h.toggle("product_details_show_product_price"),h.toggle("product_details_show_qty"),h.toggle("product_details_show_number_of_items_in_stock"),h.toggle("product_details_show_in_stock_label"),h.toggle("product_details_show_wholesale_prices"),h.toggle("product_details_show_share_buttons")],!p&&n),g&&wp.element.createElement(m,{title:__("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},h.radioButtonWithDescription("storefront_view")),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},h.toggle("show_categories"),h.toggle("show_search"),h.toggle("show_breadcrumbs"),i&&h.toggle("show_footer_menu"),h.toggle("show_signin_link"),h.toggle("product_list_show_sort_viewas_options"),a),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},h.color("chameleon_color_button"),h.color("chameleon_color_foreground"),h.color("chameleon_color_price"),h.color("chameleon_color_link"),h.color("chameleon_color_background")))]},save:function(e){var t=["productbrowser"];e.attributes.show_categories&&(t[t.length]="categories"),e.attributes.show_search&&(t[t.length]="search");var r={widgets:t.join(" "),default_category_id:"undefined"!==typeof e.attributes.default_category_id?e.attributes.default_category_id:""};return new wp.shortcode({tag:u.shortcodeName,attrs:r,type:"single"}).string()},deprecated:[{attributes:{widgets:{type:"string"},categories_per_row:{type:"integer"},grid:{type:"string"},list:{type:"integer"},table:{type:"integer"},default_category_id:{type:"integer"},default_product_id:{type:"integer"},category_view:{type:"string"},search_view:{type:"string"},minicart_layout:{type:"string"}},save:function(e){return null}},{attributes:{widgets:{type:"string",default:"productbrowser"},default_category_id:{type:"integer",default:0}},migrate:function(e){return{widgets:e.widgets,default_category_id:e.default_category_id}},save:function(e){for(var t={},r=["widgets","default_category_id"],o=0;o<r.length;o++)t[r[o]]=e.attributes[r[o]];return t.default_product_id=0,new wp.shortcode({tag:u.shortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],transforms:{from:[{type:"shortcode",tag:["ecwid","ec_store"],attributes:{default_category_id:{type:"integer",shortcode:function(e){return e.default_category_id}},show_categories:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("categories")}},show_search:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("search")}}},priority:10}]}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e){function t(e){l(function(t){return{manual:"manual",color:e}}),m.setAttributes(o({},s,e))}var r=e.manual,n=e.color,l=e.setState,s=arguments[0].name,m=arguments[0].props,d=arguments[0].title,u=null===r&&null!==m.attributes[s]&&""!==m.attributes[s]||"manual"===r;u?null!==n&&m.setAttributes(o({},s,n)):m.setAttributes(o({},s,null));var w=m.attributes[s],g=wp.element.createElement("span",null,d,null!==w&&wp.element.createElement(i,{colorValue:m.attributes[s]}));return wp.element.createElement(c,{label:g,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return l(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!u},__("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:u},__("Set manually","ecwid-shopping-cart"))),u&&wp.element.createElement(a,{value:w,colors:p,onChange:t}))}r.d(t,"a",function(){return m});var l=wp.components,c=l.BaseControl,a=l.ColorPalette,i=l.ColorIndicator,s=wp.compose.withState,__=wp.i18n.__,p=[{name:__("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:__("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:__("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:__("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:__("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:__("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:__("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:__("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:__("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:__("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:__("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],m=s({manual:null,color:null})(n)},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=r(8),l=(r.n(n),r(9)),c=(r.n(l),r(0)),a=r(1),i=wp.i18n,__=i.__,_x=i._x,s=wp.blocks.registerBlockType,p=wp.blockEditor.InspectorControls,m=wp.components,d=m.PanelBody,u=m.ToggleControl,w=(wp.compose.withState,wp.element.Fragment,EcwidGutenbergParams.blockParams["ecwid/product-block"]);s("ecwid/product-block",{title:__("Product Card Small","ecwid-shopping-cart"),icon:c.a.product,category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:__("Display product with a buy button","ecwid-shopping-cart"),alignWide:!1,supports:{customClassName:!1,className:!1,html:!1,align:!0,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){function t(e,t,r){return wp.element.createElement(u,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var n=e.attributes;console.log(e);var l=function(e){var t={id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement(a.d,{props:e,attributes:n,icon:c.a.product,title:__("Product Card Small","ecwid-shopping-cart"),showDemoButton:w.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block ec-store-product-block-small"},EcwidGutenbergParams.products&&n.id&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[n.id].imageUrl})),!n.id&&wp.element.createElement("div",{className:"ec-store-product ec-store-product-y_sneaker"}),!n.id&&wp.element.createElement("div",{className:"ec-store-stub-sample"}),!n.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct)),EcwidGutenbergParams.products&&n.id&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("div",{className:"ec-store-product-title"},EcwidGutenbergParams.products[n.id].name)))),wp.element.createElement(p,null,n.id&&wp.element.createElement(d,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Change","ecwid-shopping-cart")))),!n.id&&wp.element.createElement(d,null,wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(d,{title:_x("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",__("Picture","ecwid-shopping-cart")),t(e,"show_title",__("Title","ecwid-shopping-cart")),t(e,"show_price",__("Price","ecwid-shopping-cart")),t(e,"show_options",__("Options","ecwid-shopping-cart")),t(e,"show_qty",__("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",__("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(d,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",__("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",__("Add border","ecwid-shopping-cart")),t(e,"center_align",__("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var n=r(11),l=(r.n(n),r(12)),c=(r.n(l),r(0)),a=r(1),i=wp.i18n,__=i.__,s=(i._x,wp.blocks),p=(s.BlockControls,s.registerBlockType),m=wp.blockEditor.InspectorControls,d=wp.components,u=d.PanelBody,w=d.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ec-store/buynow",{title:__("Buy Now Button","ecwid-shopping-cart"),icon:c.a.button,category:"ec-store",attributes:{id:{type:"integer"},show_price_on_button:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:__("Display a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,align:!0,alignWide:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){function t(e,t,r){return wp.element.createElement(w,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(o({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var n=e.attributes,l=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement(a.d,{props:e,attributes:n,icon:c.a.button,title:__("Buy Now Button","ecwid-shopping-cart")},wp.element.createElement("div",{className:"ec-store-block-cart-page"},wp.element.createElement(a.b,{src:"buy-now-preview.png",className:"ec-store-block-buynow-preview"})),!n.id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(m,null,n.id&&wp.element.createElement(u,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Change","ecwid-shopping-cart")))),!n.id&&wp.element.createElement(u,null,wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(u,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",__("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"center_align",__("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(14),n=(r.n(o),r(15)),l=(r.n(n),r(0)),c=wp.i18n,__=c.__;c._x;(0,wp.blocks.registerBlockType)("ec-store/search",{title:__("Product Search Box","ecwid-shopping-cart"),icon:l.a.search,category:"ec-store",description:__("Display search box","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){return e.attributes,[wp.element.createElement("div",{className:"ec-store-block ec-store-block-search"},wp.element.createElement("div",{class:"image"}))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(17),n=(r.n(o),r(18)),l=(r.n(n),r(0)),c=r(1);if(!EcwidGutenbergParams.isDemoStore){var a=wp.editor.InspectorControls,i=wp.components.PanelBody,s=wp.i18n,__=s.__,p=(s._x,wp.blocks.registerBlockType),m=EcwidGutenbergParams.blockParams["ec-store/categories"];p("ec-store/categories",{title:__("Store Categories Menu","ecwid-shopping-cart"),icon:l.a.categories,category:"ec-store",description:__("Display categories navigation bar","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable},example:{},edit:function(e){var t=(e.attributes,wp.element.createElement("div",{className:"ec-store-block ec-store-block-categories"},wp.element.createElement("div",{className:"ec-store-block-header"},wp.element.createElement("div",null,__("Categories","ecwid-shopping-cart")),wp.element.createElement(c.b,{src:"categories-menu-preview.png",className:"ec-store-categories-menu"})))),r=__('The block is hidden because you don\'t have categories in your store. <a target="_blank" href="admin.php?page=ec-store-admin-category-id-0-mode-edit">Add categories.</a>',"ecwid-shopping-cart");return[t,wp.element.createElement(a,null,wp.element.createElement(i,null,wp.element.createElement("div",{style:{height:"10px"}}),!m.has_categories&&wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}})))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(20),n=(r.n(o),r(21)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blockEditor.InspectorControls),s=wp.components,p=s.PanelBody;s.BaseControl;(0,wp.blocks.registerBlockType)("ec-store/minicart",{title:__("Shopping Cart Icon","ecwid-shopping-cart"),icon:l.a.cart,category:"ec-store",description:__("Display shopping bag link and summary","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,inserter:EcwidGutenbergParams.isApiAvailable,isPrivate:!EcwidGutenbergParams.isApiAvailable,align:!0,alignWide:!1},attributes:EcwidGutenbergParams.minicartAttributes,example:{},edit:function(e){function t(e,t,o){var n=EcwidGutenbergParams.minicartAttributes[t];return"undefined"===typeof o&&(o=n.type),r.select(t)}var r=(e.attributes,Object(c.a)(EcwidGutenbergParams.minicartAttributes,e));return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-minicart"},wp.element.createElement("div",{className:"image"})),wp.element.createElement(i,null,wp.element.createElement(p,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!0},t(e,"layout","select"),t(e,"icon","select"),t(e,"fixed_shape","select")))]},save:function(e){return!1}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(23),n=(r.n(o),r(24)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,l.a,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=p.BaseControl,u=EcwidGutenbergParams.blockParams["ec-store/category-page"];i("ec-store/category-page",{title:__("Store Category Page","ecwid-shopping-cart"),icon:l.a.category,category:"ec-store",attributes:EcwidGutenbergStoreBlockParams.attributes,description:__("Display category page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var o=wp.element.createElement(c.d,{props:e,attributes:r,icon:l.a.category,title:__("Store Category Page","ecwid-shopping-cart"),showDemoButton:u.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-sneaker"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-bag"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-shirt"}))),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-hat"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-watch"})),wp.element.createElement("div",{className:"ec-store-product-block"},wp.element.createElement("div",{className:"ec-store-product ec-store-category-glasses"})))),n=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),a=t(__("Display cart icon","ecwid-shopping-cart"),u.customizeMinicartText),i=u.isNewProductList,p=u.isNewDetailsPage,w=Object(c.a)(u.attributes,e);return[o,wp.element.createElement(s,null,wp.element.createElement(m,null,!EcwidGutenbergParams.hasCategories&&wp.element.createElement("div",{style:{margin:"10px"}},wp.element.createElement("a",{href:"admin.php?page=ec-store-admin-category-id-0-mode-edit",target:"_blank",class:"button button-primary"},__("Add categories","ecwid-shopping-cart"))),EcwidGutenbergParams.hasCategories&&[!e.attributes.default_category_id&&w.select("default_category_id",__("Select category","ecwid-shopping-cart")),e.attributes.default_category_id&&w.select("default_category_id",__("Selected category","ecwid-shopping-cart"))]),wp.element.createElement(m,{title:__("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[w.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[w.buttonGroup("product_list_category_image_size"),w.toolbar("product_list_category_image_aspect_ratio")]],!i&&n),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[w.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[w.buttonGroup("product_list_image_size"),w.toolbar("product_list_image_aspect_ratio")],w.toolbar("product_list_product_info_layout"),w.select("product_list_title_behavior"),w.select("product_list_price_behavior"),w.select("product_list_sku_behavior"),w.select("product_list_buybutton_behavior"),w.toggle("product_list_show_additional_image_on_hover"),w.toggle("product_list_show_frame")],!i&&n),wp.element.createElement(m,{title:__("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!p&&n),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},w.toggle("show_categories"),w.toggle("show_search"),w.toggle("show_breadcrumbs"),i&&w.toggle("show_footer_menu"),w.toggle("show_signin_link"),w.toggle("product_list_show_sort_viewas_options"),a),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(26),n=(r.n(o),r(27)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=p.BaseControl,u=(wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/product-page"]);i("ec-store/product-page",{title:__("Product Card Large","ecwid-shopping-cart"),icon:l.a.product,category:"ec-store",attributes:u.attributes,description:__("Display product page with description and a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e){ecwid_open_product_popup({saveCallback:n,props:e})}function r(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var o=e.attributes,n=function(e){var t={default_product_id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)},a=wp.element.createElement(c.d,{props:e,attributes:o,icon:l.a.product,title:__("Product Card Large","ecwid-shopping-cart")},wp.element.createElement(c.b,{src:"product-page-preview.png",className:"ec-store-product-page-preview"}),!o.default_product_id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:n,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),i=r("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),p=(r("",__('To improve the look and feel of your product page and manage your its appearance here, please enable the \u201cNext-gen look and feel of the product page on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),u.isNewDetailsPage),w=Object(c.a)(u.attributes,e);return[a,wp.element.createElement(s,null,o.default_product_id>0&&wp.element.createElement(m,null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},__("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.default_product_id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.default_product_id].name),wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},__("Change","ecwid-shopping-cart")))),!o.default_product_id&&wp.element.createElement(m,null,wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},__("Choose product","ecwid-shopping-cart"))),wp.element.createElement(m,{title:__("Appearance","ecwid-shopping-cart"),initialOpen:!1},p&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===o.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===o.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(c.c)(__("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!p&&i),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(29),n=(r.n(o),r(30)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=wp.blockEditor.InspectorControls,p=wp.components,m=p.PanelBody,d=(p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl),u=(p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/filters-page"]);i("ec-store/filters-page",{title:__("Product Search and filters","ecwid-shopping-cart"),icon:l.a.filters,category:"ec-store",attributes:u.attributes,description:__("Display search page with filters on a side","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){function t(e,t){return wp.element.createElement(d,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes,o=wp.element.createElement(c.d,{props:e,attributes:r,icon:l.a.filters,title:__("Search and Filters","ecwid-shopping-cart")},wp.element.createElement(c.e,{state:"SEARCH_FILTERS_PAGE"})),n=t("",__('You can enable filters in the store settings: (\u201c<a target="_blank" href="admin.php?page=ec-store-admin-product-filters-mode-main">Settings \u2192 Product Filters</a>\u201d).',"ecwid-shopping-cart")),a=t("",__('To improve the look and feel of your store and manage your storefront appearance here, please enable the \u201cNext-gen look and feel of the product list on the storefront\u201d option in your store dashboard (\u201c<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings \u2192 What\u2019s New</a>\u201d).',"ecwid-shopping-cart")),i=u.isNewProductList,p=Object(c.a)(u.attributes,e);return[o,wp.element.createElement(s,null,wp.element.createElement(m,{title:__("Filters","ecwid-shopping-cart"),initialOpen:!1},!u.filtersEnabled&&n,u.filtersEnabled&&[p.select("product_filters_position_search_page")]),wp.element.createElement(m,{title:__("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},i&&[p.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[p.buttonGroup("product_list_image_size"),p.toolbar("product_list_image_aspect_ratio")],p.toolbar("product_list_product_info_layout"),p.select("product_list_title_behavior"),p.select("product_list_price_behavior"),p.select("product_list_sku_behavior"),p.select("product_list_buybutton_behavior"),p.toggle("product_list_show_additional_image_on_hover"),p.toggle("product_list_show_frame")],!i&&a),wp.element.createElement(m,{title:__("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},p.toggle("show_categories"),p.toggle("show_breadcrumbs"),i&&p.toggle("show_footer_menu"),p.toggle("show_signin_link"),p.toggle("product_list_show_sort_viewas_options")),wp.element.createElement(m,{title:__("Color settings","ecwid-shopping-cart"),initialOpen:!1},p.color("chameleon_color_button"),p.color("chameleon_color_foreground"),p.color("chameleon_color_price"),p.color("chameleon_color_link"),p.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var o=r(32),n=(r.n(o),r(33)),l=(r.n(n),r(0)),c=r(1),a=wp.i18n,__=a.__,i=(a._x,wp.blocks.registerBlockType),s=(wp.blockEditor.InspectorControls,wp.components),p=(s.PanelBody,s.PanelRow,s.ToggleControl,s.ButtonGroup,s.Button,s.BaseControl,s.Toolbar,s.ColorPalette,s.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/cart-page"]);i("ec-store/cart-page",{title:__("Cart and Checkout","ecwid-shopping-cart"),icon:l.a.cartPage,category:"ec-store",attributes:p.attributes,description:__("Display shopping cart and checkout page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1,inserter:!EcwidGutenbergParams.isWidgetsScreen},example:{},edit:function(e){var t=e.attributes;return[wp.element.createElement(c.d,{props:e,attributes:t,icon:l.a.cartPage,title:__("Cart and Checkout","ecwid-shopping-cart")},wp.element.createElement("div",{className:"ec-store-block-cart-page"},wp.element.createElement(c.b,{src:"cart-page-preview.png"})))]},save:function(e){return null}})},function(e,t){},function(e,t){}]);
|
lib/ecwid_platform.php
CHANGED
@@ -5,31 +5,29 @@ require_once ECWID_PLUGIN_DIR . 'lib/phpseclib/AES.php';
|
|
5 |
|
6 |
class EcwidPlatform {
|
7 |
|
8 |
-
static
|
9 |
|
10 |
-
static
|
11 |
|
12 |
-
static
|
13 |
|
14 |
const FORCES_CATALOG_CACHE_RESET_VALID_FROM = 'forced_catalog_cache_reset_valid_from';
|
15 |
-
const CATEGORIES_CACHE_VALID_FROM
|
16 |
-
const PRODUCTS_CACHE_VALID_FROM
|
17 |
-
const PROFILE_CACHE_VALID_FROM
|
18 |
-
const CATALOG_CACHE_VALID_FROM
|
19 |
-
|
20 |
-
const OPTION_LOG_CACHE
|
21 |
const OPTION_ECWID_PLUGIN_DATA = 'ecwid_plugin_data';
|
22 |
|
23 |
-
const TRANSIENTS_LIMIT =
|
24 |
-
|
25 |
-
static
|
26 |
-
|
27 |
-
return get_ecwid_store_id();
|
28 |
}
|
29 |
|
30 |
-
static
|
31 |
-
|
32 |
-
if ( $force || is_null(self::$crypt) ) {
|
33 |
self::$crypt = new Ecwid_Crypt_AES();
|
34 |
self::_init_crypt();
|
35 |
}
|
@@ -38,31 +36,30 @@ class EcwidPlatform {
|
|
38 |
/*
|
39 |
* @throws InvalidArgumentException if $file can't be slugified at all
|
40 |
*/
|
41 |
-
static
|
42 |
-
|
43 |
$filename = $file;
|
44 |
-
|
45 |
if ( strpos( $file, '.js' ) == strlen( $file ) - 3 ) {
|
46 |
$filename = substr( $filename, 0, strlen( $file ) - 3 );
|
47 |
}
|
48 |
-
|
49 |
$handle = self::make_handle( $file );
|
50 |
-
|
51 |
$filename .= '.js';
|
52 |
-
|
53 |
if ( defined( 'WP_DEBUG' ) ) {
|
54 |
$path = ECWID_PLUGIN_DIR . 'js/' . $filename;
|
55 |
-
|
56 |
$ver = filemtime( $path );
|
57 |
} else {
|
58 |
$ver = get_option( 'ecwid_plugin_version' );
|
59 |
}
|
60 |
-
|
61 |
wp_enqueue_script( $handle, ECWID_PLUGIN_URL . 'js/' . $filename, $deps, $ver, $in_footer );
|
62 |
}
|
63 |
-
|
64 |
-
static
|
65 |
-
{
|
66 |
$filename = $file;
|
67 |
|
68 |
if ( strpos( $file, '.js' ) == strlen( $file ) - 3 ) {
|
@@ -70,24 +67,22 @@ class EcwidPlatform {
|
|
70 |
}
|
71 |
|
72 |
$prefix = 'ecwid-';
|
73 |
-
|
74 |
if ( strpos( $file, $prefix ) === 0 ) {
|
75 |
$filename = substr( $filename, strlen( $prefix ) );
|
76 |
}
|
77 |
-
|
78 |
$handle = self::slugify( $filename );
|
79 |
-
|
80 |
$handle = $prefix . $handle;
|
81 |
-
|
82 |
return $handle;
|
83 |
}
|
84 |
-
|
85 |
-
|
86 |
|
87 |
/*
|
88 |
-
|
89 |
-
|
90 |
-
static
|
91 |
|
92 |
$filename = $file;
|
93 |
|
@@ -95,12 +90,12 @@ class EcwidPlatform {
|
|
95 |
$filename = substr( $filename, 0, strlen( $file ) - 4 );
|
96 |
}
|
97 |
|
98 |
-
if (
|
99 |
$handle = self::slugify( $filename );
|
100 |
}
|
101 |
-
|
102 |
$handle = 'ecwid-' . $handle;
|
103 |
-
|
104 |
$file = $filename . '.css';
|
105 |
|
106 |
if ( defined( 'WP_DEBUG' ) ) {
|
@@ -114,23 +109,22 @@ class EcwidPlatform {
|
|
114 |
wp_enqueue_style( $handle, ECWID_PLUGIN_URL . 'css/' . $file, $deps, $ver );
|
115 |
}
|
116 |
|
117 |
-
|
118 |
-
static
|
119 |
-
$match
|
120 |
$result = preg_match_all( '#[\p{L}0-9\-_]+#u', strtolower( $string ), $match );
|
121 |
|
122 |
if ( $result && count( @$match[0] ) > 0 ) {
|
123 |
-
$handle = implode('-', $match[0] );
|
124 |
} else {
|
125 |
throw new InvalidArgumentException( 'Can\'t make slug from ' . $string );
|
126 |
-
}
|
127 |
return $handle;
|
128 |
}
|
129 |
-
|
130 |
-
static
|
131 |
-
{
|
132 |
$salt = '';
|
133 |
-
|
134 |
// It turns out sometimes there is no salt is wp-config. And since it is already seeded
|
135 |
// with the SECURE_AUTH_KEY, and to avoid breaking someones encryption
|
136 |
// we use 'SECURE_AUTH_SALT' as string
|
@@ -139,299 +133,314 @@ class EcwidPlatform {
|
|
139 |
} else {
|
140 |
$salt = 'SECURE_AUTH_SALT';
|
141 |
}
|
142 |
-
|
143 |
-
self::$crypt->setIV( substr( md5( $salt . get_option('ecwid_store_id') ), 0, 16 ) );
|
144 |
self::$crypt->setKey( SECURE_AUTH_KEY );
|
145 |
}
|
146 |
|
147 |
-
static
|
148 |
-
{
|
149 |
self::init_crypt();
|
150 |
|
151 |
-
return self::$crypt->encrypt($what);
|
152 |
}
|
153 |
|
154 |
-
static
|
155 |
-
{
|
156 |
self::init_crypt();
|
157 |
|
158 |
-
return self::$crypt->decrypt($what);
|
159 |
}
|
160 |
|
161 |
-
static
|
162 |
-
|
163 |
-
if ( !get_option( self::OPTION_LOG_CACHE, false ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
-
if (!$params) $params = array();
|
166 |
-
$backtrace = debug_backtrace(false);
|
167 |
-
|
168 |
$file = $line = '';
|
169 |
foreach ( $backtrace as $entry ) {
|
170 |
if ( strpos( @$entry['file'], 'ecwid_platform.php' ) !== false ) {
|
171 |
continue;
|
172 |
}
|
173 |
-
|
174 |
@$file = $entry['file'];
|
175 |
@$line = $entry['line'];
|
176 |
}
|
177 |
-
|
178 |
$log_entry = array(
|
179 |
'operation' => $operation,
|
180 |
-
'file'
|
181 |
-
'line'
|
182 |
-
'timestamp' => time()
|
183 |
);
|
184 |
-
|
185 |
$log_entry = array_merge(
|
186 |
$log_entry,
|
187 |
$params
|
188 |
);
|
189 |
|
190 |
$cache = get_option( 'ecwid_cache_log' );
|
191 |
-
if (
|
192 |
$cache = array();
|
193 |
}
|
194 |
$cache[] = $log_entry;
|
195 |
-
|
196 |
-
update_option('ecwid_cache_log', $cache );
|
197 |
}
|
198 |
|
199 |
-
static
|
200 |
-
|
201 |
-
$result = get_transient('ecwid_' . $name);
|
202 |
|
203 |
-
self::cache_log_record(
|
204 |
-
|
205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
return $default;
|
207 |
}
|
208 |
|
209 |
return $result;
|
210 |
}
|
211 |
|
212 |
-
static
|
213 |
-
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
}
|
217 |
|
218 |
-
static
|
219 |
self::cache_log_record( 'reset', array( 'name' => $name ) );
|
220 |
-
delete_transient('ecwid_' . $name);
|
221 |
}
|
222 |
|
223 |
-
static
|
224 |
-
|
225 |
-
return wp_parse_args($args, $defaults);
|
226 |
}
|
227 |
|
228 |
-
static
|
229 |
-
ecwid_log_error(json_encode($error));
|
230 |
}
|
231 |
|
232 |
-
static
|
233 |
-
|
234 |
-
$api_check_retry_after = get_option('ecwid_api_check_retry_after', 0);
|
235 |
|
236 |
-
if( $api_check_retry_after > time() ) {
|
237 |
return array(
|
238 |
-
'code'
|
239 |
-
'data'
|
240 |
-
'message' => 'Too Many Requests'
|
241 |
);
|
242 |
}
|
243 |
|
244 |
-
if (get_option('ecwid_http_use_stream', false)) {
|
245 |
self::$http_use_streams = true;
|
246 |
}
|
247 |
|
248 |
$default_timeout = 10;
|
249 |
-
$result
|
|
|
|
|
250 |
array(
|
251 |
-
'timeout' => get_option( 'ecwid_remote_get_timeout', $default_timeout )
|
252 |
),
|
253 |
$options
|
254 |
)
|
255 |
);
|
256 |
|
257 |
-
if( wp_remote_retrieve_response_code($result) == '429' ) {
|
258 |
|
259 |
-
$retry_after = intval( wp_remote_retrieve_header($result, 'retry-after') );
|
260 |
|
261 |
-
if( $retry_after > 0 ) {
|
262 |
update_option( 'ecwid_api_check_retry_after', time() + $retry_after );
|
263 |
}
|
264 |
}
|
265 |
|
266 |
-
if (get_option('ecwid_http_use_stream', false)) {
|
267 |
self::$http_use_streams = false;
|
268 |
}
|
269 |
|
270 |
$return = array(
|
271 |
-
'code'
|
272 |
-
'data'
|
273 |
-
'message' => ''
|
274 |
);
|
275 |
|
276 |
-
if (is_string($result)) {
|
277 |
$return['code'] = 200;
|
278 |
$return['data'] = $result;
|
279 |
}
|
280 |
|
281 |
-
if (is_array($result)) {
|
282 |
$return = array(
|
283 |
'code' => $result['response']['code'],
|
284 |
-
'data' => $result['body']
|
285 |
);
|
286 |
-
} elseif (is_object($result)) {
|
287 |
|
288 |
$return = array(
|
289 |
-
'code'
|
290 |
-
'data'
|
291 |
-
'message' => $result->get_error_message()
|
292 |
);
|
293 |
}
|
294 |
|
295 |
return $return;
|
296 |
}
|
297 |
|
298 |
-
static
|
299 |
-
return self::fetch_url($url);
|
300 |
}
|
301 |
|
302 |
-
static
|
303 |
-
{
|
304 |
$result = null;
|
305 |
|
306 |
$args = array();
|
307 |
|
308 |
-
if ( !empty( $params ) ) {
|
309 |
$args = $params;
|
310 |
}
|
311 |
|
312 |
$args['body'] = $data;
|
313 |
|
314 |
-
if ( get_option('ecwid_http_use_stream', false) !== true) {
|
315 |
$result = wp_remote_post( $url, $args );
|
316 |
}
|
317 |
|
318 |
-
if ( !is_array($result) ) {
|
319 |
self::$http_use_streams = true;
|
320 |
-
$result
|
321 |
self::$http_use_streams = false;
|
322 |
|
323 |
-
if ( is_array($result) ) {
|
324 |
-
update_option('ecwid_http_use_stream', true);
|
325 |
}
|
326 |
}
|
327 |
|
328 |
return $result;
|
329 |
}
|
330 |
|
331 |
-
static
|
332 |
-
|
333 |
-
if ( !self::$ecwid_plugin_data ) {
|
334 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
335 |
}
|
336 |
-
|
337 |
if ( is_array( self::$ecwid_plugin_data ) && array_key_exists( $name, self::$ecwid_plugin_data ) ) {
|
338 |
-
return self::$ecwid_plugin_data[$name];
|
339 |
}
|
340 |
|
341 |
return $default;
|
342 |
}
|
343 |
-
|
344 |
-
static
|
345 |
-
|
346 |
if ( is_null( self::$ecwid_plugin_data ) ) {
|
347 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
348 |
}
|
349 |
-
|
350 |
-
if ( !is_array( self::$ecwid_plugin_data ) ) {
|
351 |
self::$ecwid_plugin_data = array();
|
352 |
}
|
353 |
|
354 |
-
self::$ecwid_plugin_data[$name] = $value;
|
355 |
|
356 |
update_option( self::OPTION_ECWID_PLUGIN_DATA, self::$ecwid_plugin_data );
|
357 |
}
|
358 |
|
359 |
-
static
|
360 |
-
if ( !self::$ecwid_plugin_data ) {
|
361 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
362 |
}
|
363 |
|
364 |
$options = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
365 |
|
366 |
-
if ( !is_array( self::$ecwid_plugin_data ) || !array_key_exists( $name, self::$ecwid_plugin_data ) ) {
|
367 |
return;
|
368 |
}
|
369 |
|
370 |
-
unset( self::$ecwid_plugin_data[$name] );
|
371 |
-
|
372 |
update_option( self::OPTION_ECWID_PLUGIN_DATA, self::$ecwid_plugin_data );
|
373 |
|
374 |
}
|
375 |
|
376 |
-
static
|
377 |
-
|
378 |
-
|
379 |
-
return array('streams');
|
380 |
}
|
381 |
|
382 |
return $transports;
|
383 |
}
|
384 |
-
|
385 |
-
static public function store_in_products_cache( $url, $data ) {
|
386 |
-
self::_store_in_cache($url, 'products', $data);
|
387 |
-
}
|
388 |
|
|
|
|
|
|
|
389 |
|
390 |
-
static
|
391 |
-
self::
|
392 |
}
|
393 |
|
394 |
-
static
|
395 |
-
self::
|
396 |
}
|
397 |
|
398 |
-
static
|
399 |
$name = self::_build_cache_name( $url, $type );
|
400 |
|
401 |
$to_store = array(
|
402 |
'time' => time(),
|
403 |
-
'data' => $data
|
404 |
);
|
405 |
|
406 |
-
self::cache_set( $name, $to_store,
|
407 |
-
|
408 |
-
self::cache_log_record(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
}
|
410 |
|
411 |
-
static
|
412 |
-
{
|
413 |
$cache_name = self::_build_cache_name( $key, 'categories' );
|
414 |
|
415 |
$result = self::cache_get( $cache_name );
|
416 |
|
417 |
-
self::cache_log_record(
|
418 |
-
'get_from_categories_cache',
|
419 |
-
array(
|
420 |
-
'name'
|
421 |
-
'result'
|
422 |
-
'valid_from' =>
|
423 |
-
)
|
424 |
);
|
425 |
-
|
426 |
-
if ( $result && $result['time'] >
|
427 |
return $result['data'];
|
428 |
}
|
429 |
|
430 |
return false;
|
431 |
}
|
432 |
|
433 |
-
static
|
434 |
-
{
|
435 |
$cache_name = self::_build_cache_name( $key, 'products' );
|
436 |
|
437 |
$result = self::cache_get( $cache_name );
|
@@ -439,132 +448,140 @@ class EcwidPlatform {
|
|
439 |
self::cache_log_record(
|
440 |
'get_from_products_cache',
|
441 |
array(
|
442 |
-
'name'
|
443 |
-
'result'
|
444 |
-
'valid_from' =>
|
445 |
)
|
446 |
);
|
447 |
|
448 |
-
if ( $result && $result['time'] >
|
449 |
return $result['data'];
|
450 |
}
|
451 |
|
452 |
return false;
|
453 |
}
|
454 |
-
|
455 |
-
static
|
456 |
-
|
457 |
-
$cache_name = self::_build_cache_name( $key, 'catalog' );
|
458 |
|
459 |
$result = self::cache_get( $cache_name );
|
460 |
-
|
461 |
-
$valid_from = max(
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
);
|
467 |
|
468 |
self::cache_log_record(
|
469 |
'get_from_catalog_cache',
|
470 |
array(
|
471 |
-
'name'
|
472 |
-
'result'
|
473 |
-
'valid_from' => $valid_from
|
474 |
)
|
475 |
);
|
476 |
|
477 |
-
if ( $result &&
|
478 |
return $result['data'];
|
479 |
}
|
480 |
|
481 |
return false;
|
482 |
}
|
483 |
-
|
484 |
-
static
|
485 |
|
486 |
$valid_from = max(
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
);
|
491 |
-
|
492 |
-
self::cache_log_record(
|
493 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
return time() - $valid_from > 10;
|
495 |
}
|
496 |
|
497 |
-
static
|
498 |
-
return $type . '_' . md5($url);
|
499 |
}
|
500 |
|
501 |
-
static
|
502 |
$time = is_null( $time ) ? time() : $time;
|
503 |
-
|
504 |
-
$old = EcwidPlatform::get( $name );
|
505 |
-
if ( $old > $time) return;
|
506 |
|
507 |
-
|
|
|
|
|
|
|
|
|
|
|
508 |
self::cache_log_record(
|
509 |
'invalidate_cache_' . $name,
|
510 |
array(
|
511 |
-
'time' => $time
|
512 |
)
|
513 |
);
|
514 |
}
|
515 |
-
|
516 |
-
static
|
517 |
-
|
518 |
-
self::_invalidate_cache_from( self::PRODUCTS_CACHE_VALID_FROM, $time );
|
519 |
}
|
520 |
|
521 |
-
static
|
522 |
-
{
|
523 |
self::_invalidate_cache_from( self::CATEGORIES_CACHE_VALID_FROM, $time );
|
524 |
}
|
525 |
|
526 |
-
static
|
527 |
-
{
|
528 |
self::_invalidate_cache_from( self::PROFILE_CACHE_VALID_FROM, $time );
|
529 |
}
|
530 |
-
|
531 |
-
static
|
532 |
-
{
|
533 |
self::_invalidate_cache_from( self::CATALOG_CACHE_VALID_FROM, $time );
|
534 |
}
|
535 |
-
|
536 |
-
static
|
537 |
-
{
|
538 |
$time = is_null( $time ) ? time() : $time;
|
539 |
-
|
540 |
}
|
541 |
|
542 |
-
static
|
543 |
global $wpdb;
|
544 |
|
545 |
-
$count_transients = $wpdb->get_var(
|
|
|
546 |
SELECT COUNT(*)
|
547 |
FROM {$wpdb->options}
|
548 |
WHERE option_name LIKE '\_transient\_ecwid\_%'
|
549 |
-
"
|
|
|
550 |
|
551 |
-
if( $count_transients >= self::TRANSIENTS_LIMIT ) {
|
552 |
return true;
|
553 |
}
|
554 |
|
555 |
return false;
|
556 |
}
|
557 |
|
558 |
-
static
|
559 |
-
|
560 |
|
561 |
-
|
|
|
562 |
DELETE
|
563 |
FROM {$wpdb->options}
|
564 |
WHERE option_name LIKE '\_transient\_ecwid\_%'
|
565 |
OR option_name LIKE '\_transient\_timeout\_ecwid\_%'
|
566 |
-
"
|
|
|
567 |
}
|
568 |
}
|
569 |
|
570 |
-
add_filter('http_api_transports', array('EcwidPlatform', 'http_api_transports'));
|
5 |
|
6 |
class EcwidPlatform {
|
7 |
|
8 |
+
protected static $http_use_streams = false;
|
9 |
|
10 |
+
protected static $crypt = null;
|
11 |
|
12 |
+
protected static $ecwid_plugin_data = null;
|
13 |
|
14 |
const FORCES_CATALOG_CACHE_RESET_VALID_FROM = 'forced_catalog_cache_reset_valid_from';
|
15 |
+
const CATEGORIES_CACHE_VALID_FROM = 'categories_cache_valid_from';
|
16 |
+
const PRODUCTS_CACHE_VALID_FROM = 'products_cache_valid_from';
|
17 |
+
const PROFILE_CACHE_VALID_FROM = 'profile_cache_valid_from';
|
18 |
+
const CATALOG_CACHE_VALID_FROM = 'catalog_valid_from';
|
19 |
+
|
20 |
+
const OPTION_LOG_CACHE = 'ecwid_log_cache';
|
21 |
const OPTION_ECWID_PLUGIN_DATA = 'ecwid_plugin_data';
|
22 |
|
23 |
+
const TRANSIENTS_LIMIT = 5000;
|
24 |
+
|
25 |
+
public static function get_store_id() {
|
26 |
+
return get_ecwid_store_id();
|
|
|
27 |
}
|
28 |
|
29 |
+
public static function init_crypt( $force = false ) {
|
30 |
+
if ( $force || is_null( self::$crypt ) ) {
|
|
|
31 |
self::$crypt = new Ecwid_Crypt_AES();
|
32 |
self::_init_crypt();
|
33 |
}
|
36 |
/*
|
37 |
* @throws InvalidArgumentException if $file can't be slugified at all
|
38 |
*/
|
39 |
+
public static function enqueue_script( $file, $deps = array(), $in_footer = false, $handle = false ) {
|
40 |
+
|
41 |
$filename = $file;
|
42 |
+
|
43 |
if ( strpos( $file, '.js' ) == strlen( $file ) - 3 ) {
|
44 |
$filename = substr( $filename, 0, strlen( $file ) - 3 );
|
45 |
}
|
46 |
+
|
47 |
$handle = self::make_handle( $file );
|
48 |
+
|
49 |
$filename .= '.js';
|
50 |
+
|
51 |
if ( defined( 'WP_DEBUG' ) ) {
|
52 |
$path = ECWID_PLUGIN_DIR . 'js/' . $filename;
|
53 |
+
|
54 |
$ver = filemtime( $path );
|
55 |
} else {
|
56 |
$ver = get_option( 'ecwid_plugin_version' );
|
57 |
}
|
58 |
+
|
59 |
wp_enqueue_script( $handle, ECWID_PLUGIN_URL . 'js/' . $filename, $deps, $ver, $in_footer );
|
60 |
}
|
61 |
+
|
62 |
+
public static function make_handle( $file ) {
|
|
|
63 |
$filename = $file;
|
64 |
|
65 |
if ( strpos( $file, '.js' ) == strlen( $file ) - 3 ) {
|
67 |
}
|
68 |
|
69 |
$prefix = 'ecwid-';
|
70 |
+
|
71 |
if ( strpos( $file, $prefix ) === 0 ) {
|
72 |
$filename = substr( $filename, strlen( $prefix ) );
|
73 |
}
|
74 |
+
|
75 |
$handle = self::slugify( $filename );
|
76 |
+
|
77 |
$handle = $prefix . $handle;
|
78 |
+
|
79 |
return $handle;
|
80 |
}
|
|
|
|
|
81 |
|
82 |
/*
|
83 |
+
* @throws InvalidArgumentException if $file can't be slugified at all
|
84 |
+
*/
|
85 |
+
public static function enqueue_style( $file, $deps = array(), $handle = false ) {
|
86 |
|
87 |
$filename = $file;
|
88 |
|
90 |
$filename = substr( $filename, 0, strlen( $file ) - 4 );
|
91 |
}
|
92 |
|
93 |
+
if ( ! $handle ) {
|
94 |
$handle = self::slugify( $filename );
|
95 |
}
|
96 |
+
|
97 |
$handle = 'ecwid-' . $handle;
|
98 |
+
|
99 |
$file = $filename . '.css';
|
100 |
|
101 |
if ( defined( 'WP_DEBUG' ) ) {
|
109 |
wp_enqueue_style( $handle, ECWID_PLUGIN_URL . 'css/' . $file, $deps, $ver );
|
110 |
}
|
111 |
|
112 |
+
|
113 |
+
public static function slugify( $string ) {
|
114 |
+
$match = array();
|
115 |
$result = preg_match_all( '#[\p{L}0-9\-_]+#u', strtolower( $string ), $match );
|
116 |
|
117 |
if ( $result && count( @$match[0] ) > 0 ) {
|
118 |
+
$handle = implode( '-', $match[0] );
|
119 |
} else {
|
120 |
throw new InvalidArgumentException( 'Can\'t make slug from ' . $string );
|
121 |
+
}
|
122 |
return $handle;
|
123 |
}
|
124 |
+
|
125 |
+
protected static function _init_crypt() {
|
|
|
126 |
$salt = '';
|
127 |
+
|
128 |
// It turns out sometimes there is no salt is wp-config. And since it is already seeded
|
129 |
// with the SECURE_AUTH_KEY, and to avoid breaking someones encryption
|
130 |
// we use 'SECURE_AUTH_SALT' as string
|
133 |
} else {
|
134 |
$salt = 'SECURE_AUTH_SALT';
|
135 |
}
|
136 |
+
|
137 |
+
self::$crypt->setIV( substr( md5( $salt . get_option( 'ecwid_store_id' ) ), 0, 16 ) );
|
138 |
self::$crypt->setKey( SECURE_AUTH_KEY );
|
139 |
}
|
140 |
|
141 |
+
public static function encrypt( $what ) {
|
|
|
142 |
self::init_crypt();
|
143 |
|
144 |
+
return self::$crypt->encrypt( $what );
|
145 |
}
|
146 |
|
147 |
+
public static function decrypt( $what ) {
|
|
|
148 |
self::init_crypt();
|
149 |
|
150 |
+
return self::$crypt->decrypt( $what );
|
151 |
}
|
152 |
|
153 |
+
public static function cache_log_record( $operation, $params ) {
|
154 |
+
|
155 |
+
if ( ! get_option( self::OPTION_LOG_CACHE, false ) ) {
|
156 |
+
return; }
|
157 |
+
|
158 |
+
if ( ! $params ) {
|
159 |
+
$params = array();
|
160 |
+
}
|
161 |
+
$backtrace = debug_backtrace( false );
|
162 |
|
|
|
|
|
|
|
163 |
$file = $line = '';
|
164 |
foreach ( $backtrace as $entry ) {
|
165 |
if ( strpos( @$entry['file'], 'ecwid_platform.php' ) !== false ) {
|
166 |
continue;
|
167 |
}
|
168 |
+
|
169 |
@$file = $entry['file'];
|
170 |
@$line = $entry['line'];
|
171 |
}
|
172 |
+
|
173 |
$log_entry = array(
|
174 |
'operation' => $operation,
|
175 |
+
'file' => $file,
|
176 |
+
'line' => $line,
|
177 |
+
'timestamp' => time(),
|
178 |
);
|
179 |
+
|
180 |
$log_entry = array_merge(
|
181 |
$log_entry,
|
182 |
$params
|
183 |
);
|
184 |
|
185 |
$cache = get_option( 'ecwid_cache_log' );
|
186 |
+
if ( ! $cache ) {
|
187 |
$cache = array();
|
188 |
}
|
189 |
$cache[] = $log_entry;
|
190 |
+
|
191 |
+
update_option( 'ecwid_cache_log', $cache );
|
192 |
}
|
193 |
|
194 |
+
public static function cache_get( $name, $default = false ) {
|
195 |
+
$result = get_transient( 'ecwid_' . $name );
|
|
|
196 |
|
197 |
+
self::cache_log_record(
|
198 |
+
'get',
|
199 |
+
array(
|
200 |
+
'name' => $name,
|
201 |
+
'default' => $default,
|
202 |
+
'result' => $result,
|
203 |
+
)
|
204 |
+
);
|
205 |
+
|
206 |
+
if ( $default !== false && $result === false ) {
|
207 |
return $default;
|
208 |
}
|
209 |
|
210 |
return $result;
|
211 |
}
|
212 |
|
213 |
+
public static function cache_set( $name, $value, $expires_after = 0 ) {
|
214 |
+
self::cache_log_record(
|
215 |
+
'set',
|
216 |
+
array(
|
217 |
+
'name' => $name,
|
218 |
+
'value' => $value,
|
219 |
+
'expires' => $expires_after,
|
220 |
+
)
|
221 |
+
);
|
222 |
+
set_transient( 'ecwid_' . $name, $value, $expires_after );
|
223 |
}
|
224 |
|
225 |
+
public static function cache_reset( $name ) {
|
226 |
self::cache_log_record( 'reset', array( 'name' => $name ) );
|
227 |
+
delete_transient( 'ecwid_' . $name );
|
228 |
}
|
229 |
|
230 |
+
public static function parse_args( $args, $defaults ) {
|
231 |
+
return wp_parse_args( $args, $defaults );
|
|
|
232 |
}
|
233 |
|
234 |
+
public static function report_error( $error ) {
|
235 |
+
ecwid_log_error( json_encode( $error ) );
|
236 |
}
|
237 |
|
238 |
+
public static function fetch_url( $url, $options = array() ) {
|
239 |
+
$api_check_retry_after = get_option( 'ecwid_api_check_retry_after', 0 );
|
|
|
240 |
|
241 |
+
if ( $api_check_retry_after > time() ) {
|
242 |
return array(
|
243 |
+
'code' => '429',
|
244 |
+
'data' => '',
|
245 |
+
'message' => 'Too Many Requests',
|
246 |
);
|
247 |
}
|
248 |
|
249 |
+
if ( get_option( 'ecwid_http_use_stream', false ) ) {
|
250 |
self::$http_use_streams = true;
|
251 |
}
|
252 |
|
253 |
$default_timeout = 10;
|
254 |
+
$result = wp_remote_get(
|
255 |
+
$url,
|
256 |
+
array_merge(
|
257 |
array(
|
258 |
+
'timeout' => get_option( 'ecwid_remote_get_timeout', $default_timeout ),
|
259 |
),
|
260 |
$options
|
261 |
)
|
262 |
);
|
263 |
|
264 |
+
if ( wp_remote_retrieve_response_code( $result ) == '429' ) {
|
265 |
|
266 |
+
$retry_after = intval( wp_remote_retrieve_header( $result, 'retry-after' ) );
|
267 |
|
268 |
+
if ( $retry_after > 0 ) {
|
269 |
update_option( 'ecwid_api_check_retry_after', time() + $retry_after );
|
270 |
}
|
271 |
}
|
272 |
|
273 |
+
if ( get_option( 'ecwid_http_use_stream', false ) ) {
|
274 |
self::$http_use_streams = false;
|
275 |
}
|
276 |
|
277 |
$return = array(
|
278 |
+
'code' => '',
|
279 |
+
'data' => '',
|
280 |
+
'message' => '',
|
281 |
);
|
282 |
|
283 |
+
if ( is_string( $result ) ) {
|
284 |
$return['code'] = 200;
|
285 |
$return['data'] = $result;
|
286 |
}
|
287 |
|
288 |
+
if ( is_array( $result ) ) {
|
289 |
$return = array(
|
290 |
'code' => $result['response']['code'],
|
291 |
+
'data' => $result['body'],
|
292 |
);
|
293 |
+
} elseif ( is_object( $result ) ) {
|
294 |
|
295 |
$return = array(
|
296 |
+
'code' => $result->get_error_code(),
|
297 |
+
'data' => $result->get_error_data(),
|
298 |
+
'message' => $result->get_error_message(),
|
299 |
);
|
300 |
}
|
301 |
|
302 |
return $return;
|
303 |
}
|
304 |
|
305 |
+
public static function http_get_request( $url ) {
|
306 |
+
return self::fetch_url( $url );
|
307 |
}
|
308 |
|
309 |
+
public static function http_post_request( $url, $data = array(), $params = array() ) {
|
|
|
310 |
$result = null;
|
311 |
|
312 |
$args = array();
|
313 |
|
314 |
+
if ( ! empty( $params ) ) {
|
315 |
$args = $params;
|
316 |
}
|
317 |
|
318 |
$args['body'] = $data;
|
319 |
|
320 |
+
if ( get_option( 'ecwid_http_use_stream', false ) !== true ) {
|
321 |
$result = wp_remote_post( $url, $args );
|
322 |
}
|
323 |
|
324 |
+
if ( ! is_array( $result ) ) {
|
325 |
self::$http_use_streams = true;
|
326 |
+
$result = wp_remote_post( $url, $args );
|
327 |
self::$http_use_streams = false;
|
328 |
|
329 |
+
if ( is_array( $result ) ) {
|
330 |
+
update_option( 'ecwid_http_use_stream', true );
|
331 |
}
|
332 |
}
|
333 |
|
334 |
return $result;
|
335 |
}
|
336 |
|
337 |
+
public static function get( $name, $default = null ) {
|
338 |
+
if ( ! self::$ecwid_plugin_data ) {
|
|
|
339 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
340 |
}
|
341 |
+
|
342 |
if ( is_array( self::$ecwid_plugin_data ) && array_key_exists( $name, self::$ecwid_plugin_data ) ) {
|
343 |
+
return self::$ecwid_plugin_data[ $name ];
|
344 |
}
|
345 |
|
346 |
return $default;
|
347 |
}
|
348 |
+
|
349 |
+
public static function set( $name, $value ) {
|
350 |
+
|
351 |
if ( is_null( self::$ecwid_plugin_data ) ) {
|
352 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
353 |
}
|
354 |
+
|
355 |
+
if ( ! is_array( self::$ecwid_plugin_data ) ) {
|
356 |
self::$ecwid_plugin_data = array();
|
357 |
}
|
358 |
|
359 |
+
self::$ecwid_plugin_data[ $name ] = $value;
|
360 |
|
361 |
update_option( self::OPTION_ECWID_PLUGIN_DATA, self::$ecwid_plugin_data );
|
362 |
}
|
363 |
|
364 |
+
public static function reset( $name ) {
|
365 |
+
if ( ! self::$ecwid_plugin_data ) {
|
366 |
self::$ecwid_plugin_data = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
367 |
}
|
368 |
|
369 |
$options = get_option( self::OPTION_ECWID_PLUGIN_DATA );
|
370 |
|
371 |
+
if ( ! is_array( self::$ecwid_plugin_data ) || ! array_key_exists( $name, self::$ecwid_plugin_data ) ) {
|
372 |
return;
|
373 |
}
|
374 |
|
375 |
+
unset( self::$ecwid_plugin_data[ $name ] );
|
376 |
+
|
377 |
update_option( self::OPTION_ECWID_PLUGIN_DATA, self::$ecwid_plugin_data );
|
378 |
|
379 |
}
|
380 |
|
381 |
+
public static function http_api_transports( $transports ) {
|
382 |
+
if ( self::$http_use_streams ) {
|
383 |
+
return array( 'streams' );
|
|
|
384 |
}
|
385 |
|
386 |
return $transports;
|
387 |
}
|
|
|
|
|
|
|
|
|
388 |
|
389 |
+
public static function store_in_products_cache( $url, $data ) {
|
390 |
+
self::store_in_cache( $url, 'products', $data );
|
391 |
+
}
|
392 |
|
393 |
+
public static function store_in_categories_cache( $url, $data ) {
|
394 |
+
self::store_in_cache( $url, 'categories', $data );
|
395 |
}
|
396 |
|
397 |
+
public static function store_in_catalog_cache( $url, $data ) {
|
398 |
+
self::store_in_cache( $url, 'catalog', $data );
|
399 |
}
|
400 |
|
401 |
+
protected static function store_in_cache( $url, $type, $data ) {
|
402 |
$name = self::_build_cache_name( $url, $type );
|
403 |
|
404 |
$to_store = array(
|
405 |
'time' => time(),
|
406 |
+
'data' => $data,
|
407 |
);
|
408 |
|
409 |
+
self::cache_set( $name, $to_store, WEEK_IN_SECONDS );
|
410 |
+
|
411 |
+
self::cache_log_record(
|
412 |
+
'store_in_entity_cache',
|
413 |
+
array(
|
414 |
+
'name' => $url,
|
415 |
+
'type' => $type,
|
416 |
+
'data' => $data,
|
417 |
+
),
|
418 |
+
'set'
|
419 |
+
);
|
420 |
}
|
421 |
|
422 |
+
public static function get_from_categories_cache( $key ) {
|
|
|
423 |
$cache_name = self::_build_cache_name( $key, 'categories' );
|
424 |
|
425 |
$result = self::cache_get( $cache_name );
|
426 |
|
427 |
+
self::cache_log_record(
|
428 |
+
'get_from_categories_cache',
|
429 |
+
array(
|
430 |
+
'name' => $key,
|
431 |
+
'result' => $result,
|
432 |
+
'valid_from' => self::get( self::CATEGORIES_CACHE_VALID_FROM ),
|
433 |
+
)
|
434 |
);
|
435 |
+
|
436 |
+
if ( $result && $result['time'] > self::get( self::CATEGORIES_CACHE_VALID_FROM ) ) {
|
437 |
return $result['data'];
|
438 |
}
|
439 |
|
440 |
return false;
|
441 |
}
|
442 |
|
443 |
+
public static function get_from_products_cache( $key ) {
|
|
|
444 |
$cache_name = self::_build_cache_name( $key, 'products' );
|
445 |
|
446 |
$result = self::cache_get( $cache_name );
|
448 |
self::cache_log_record(
|
449 |
'get_from_products_cache',
|
450 |
array(
|
451 |
+
'name' => $key,
|
452 |
+
'result' => $result,
|
453 |
+
'valid_from' => self::get( self::CATEGORIES_CACHE_VALID_FROM ),
|
454 |
)
|
455 |
);
|
456 |
|
457 |
+
if ( $result && $result['time'] > self::get( self::PRODUCTS_CACHE_VALID_FROM ) ) {
|
458 |
return $result['data'];
|
459 |
}
|
460 |
|
461 |
return false;
|
462 |
}
|
463 |
+
|
464 |
+
public static function get_from_catalog_cache( $key ) {
|
465 |
+
$cache_name = self::_build_cache_name( $key, 'catalog' );
|
|
|
466 |
|
467 |
$result = self::cache_get( $cache_name );
|
468 |
+
|
469 |
+
$valid_from = max(
|
470 |
+
self::get( self::CATEGORIES_CACHE_VALID_FROM ),
|
471 |
+
self::get( self::PRODUCTS_CACHE_VALID_FROM ),
|
472 |
+
self::get( self::PROFILE_CACHE_VALID_FROM ),
|
473 |
+
self::get( self::FORCES_CATALOG_CACHE_RESET_VALID_FROM )
|
474 |
);
|
475 |
|
476 |
self::cache_log_record(
|
477 |
'get_from_catalog_cache',
|
478 |
array(
|
479 |
+
'name' => $key,
|
480 |
+
'result' => $result,
|
481 |
+
'valid_from' => $valid_from,
|
482 |
)
|
483 |
);
|
484 |
|
485 |
+
if ( $result && self::get( self::CATALOG_CACHE_VALID_FROM ) > $valid_from ) {
|
486 |
return $result['data'];
|
487 |
}
|
488 |
|
489 |
return false;
|
490 |
}
|
491 |
+
|
492 |
+
public static function is_catalog_cache_trusted() {
|
493 |
|
494 |
$valid_from = max(
|
495 |
+
self::get( self::CATEGORIES_CACHE_VALID_FROM ),
|
496 |
+
self::get( self::PRODUCTS_CACHE_VALID_FROM ),
|
497 |
+
self::get( self::PROFILE_CACHE_VALID_FROM )
|
498 |
);
|
499 |
+
|
500 |
+
self::cache_log_record(
|
501 |
+
'is_trusted',
|
502 |
+
array(
|
503 |
+
'result' => time() - $valid_from > 10,
|
504 |
+
'time' => time(),
|
505 |
+
'cats' => self::get( self::CATEGORIES_CACHE_VALID_FROM ),
|
506 |
+
'prods' => self::get( self::PRODUCTS_CACHE_VALID_FROM ),
|
507 |
+
)
|
508 |
+
);
|
509 |
+
|
510 |
return time() - $valid_from > 10;
|
511 |
}
|
512 |
|
513 |
+
protected static function _build_cache_name( $url, $type ) {
|
514 |
+
return $type . '_' . md5( $url );
|
515 |
}
|
516 |
|
517 |
+
protected static function _invalidate_cache_from( $name, $time ) {
|
518 |
$time = is_null( $time ) ? time() : $time;
|
|
|
|
|
|
|
519 |
|
520 |
+
$old = self::get( $name );
|
521 |
+
if ( $old > $time ) {
|
522 |
+
return;
|
523 |
+
}
|
524 |
+
|
525 |
+
self::set( $name, $time );
|
526 |
self::cache_log_record(
|
527 |
'invalidate_cache_' . $name,
|
528 |
array(
|
529 |
+
'time' => $time,
|
530 |
)
|
531 |
);
|
532 |
}
|
533 |
+
|
534 |
+
public static function invalidate_products_cache_from( $time = null ) {
|
535 |
+
self::_invalidate_cache_from( self::PRODUCTS_CACHE_VALID_FROM, $time );
|
|
|
536 |
}
|
537 |
|
538 |
+
public static function invalidate_categories_cache_from( $time = null ) {
|
|
|
539 |
self::_invalidate_cache_from( self::CATEGORIES_CACHE_VALID_FROM, $time );
|
540 |
}
|
541 |
|
542 |
+
public static function invalidate_profile_cache_from( $time = null ) {
|
|
|
543 |
self::_invalidate_cache_from( self::PROFILE_CACHE_VALID_FROM, $time );
|
544 |
}
|
545 |
+
|
546 |
+
public static function invalidate_catalog_cache_from( $time = null ) {
|
|
|
547 |
self::_invalidate_cache_from( self::CATALOG_CACHE_VALID_FROM, $time );
|
548 |
}
|
549 |
+
|
550 |
+
public static function force_catalog_cache_reset( $time = null ) {
|
|
|
551 |
$time = is_null( $time ) ? time() : $time;
|
552 |
+
self::set( self::FORCES_CATALOG_CACHE_RESET_VALID_FROM, $time );
|
553 |
}
|
554 |
|
555 |
+
public static function is_need_clear_transients() {
|
556 |
global $wpdb;
|
557 |
|
558 |
+
$count_transients = $wpdb->get_var(
|
559 |
+
"
|
560 |
SELECT COUNT(*)
|
561 |
FROM {$wpdb->options}
|
562 |
WHERE option_name LIKE '\_transient\_ecwid\_%'
|
563 |
+
"
|
564 |
+
);
|
565 |
|
566 |
+
if ( $count_transients >= self::TRANSIENTS_LIMIT ) {
|
567 |
return true;
|
568 |
}
|
569 |
|
570 |
return false;
|
571 |
}
|
572 |
|
573 |
+
public static function clear_all_transients() {
|
574 |
+
global $wpdb;
|
575 |
|
576 |
+
$wpdb->query(
|
577 |
+
"
|
578 |
DELETE
|
579 |
FROM {$wpdb->options}
|
580 |
WHERE option_name LIKE '\_transient\_ecwid\_%'
|
581 |
OR option_name LIKE '\_transient\_timeout\_ecwid\_%'
|
582 |
+
"
|
583 |
+
);
|
584 |
}
|
585 |
}
|
586 |
|
587 |
+
add_filter( 'http_api_transports', array( 'EcwidPlatform', 'http_api_transports' ) );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
|
|
3 |
Tags: ecommerce, e-commerce, storefront, shopping cart, online store
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 6.10.
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
@@ -152,6 +152,11 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
152 |
|
153 |
== Changelog ==
|
154 |
|
|
|
|
|
|
|
|
|
|
|
155 |
= 6.10.21 - May 24, 2022 =
|
156 |
- **WordPress 6.0 compatibility.** The new WordPress version will be released soon. The Ecwid ecommerce shopping cart plugin is ready for the new release — everything works well in your WordPress admin and storefront pages. Feel free to upgrade your site to WordPress 6.0.
|
157 |
- Minor fixes for Gutenberg ecommerce blocks.
|
3 |
Tags: ecommerce, e-commerce, storefront, shopping cart, online store
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 6.10.22
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart for WordPress. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= 6.10.22 - June 08, 2022 =
|
156 |
+
- Improvements for the integration with the All in One SEO plugin. There was a minor SEO issue with duplicates of the canonical tag on ecommerce store pages. There was sitemaps issue generated by plugin did not work well with those generated by All in One SEO. These issues has been fixed and everything should work fine now.
|
157 |
+
- Minor fixes for Gutenberg ecommerce blocks.
|
158 |
+
- Improvements for the “Store page speedup” feature.
|
159 |
+
|
160 |
= 6.10.21 - May 24, 2022 =
|
161 |
- **WordPress 6.0 compatibility.** The new WordPress version will be released soon. The Ecwid ecommerce shopping cart plugin is ready for the new release — everything works well in your WordPress admin and storefront pages. Feel free to upgrade your site to WordPress 6.0.
|
162 |
- Minor fixes for Gutenberg ecommerce blocks.
|
templates/admin/developers.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<div id="ec-store-developers" class="settings-page ec-ui-framework-page">
|
2 |
<div class="settings-page__header">
|
3 |
<div class="settings-page__titles settings-page__titles--left">
|
4 |
-
<h1 class="settings-page__title"><?php echo esc_html( __( 'Developers', 'ecwid-shopping-cart' ) )
|
5 |
<div class="settings-page__subtitle">
|
6 |
-
<?php echo esc_html( __( 'Build the store your client needs and realize your own vision with Ecwid. Use the Ecwid plugin, powerful API, apps and integrations to design stores and build your own solutions. Become an Ecwid partner and grow your business effectively.', 'ecwid-shopping-cart' ) )
|
7 |
</div>
|
8 |
</div>
|
9 |
</div>
|
@@ -12,10 +12,10 @@
|
|
12 |
<div class="named-area__header">
|
13 |
<div class="named-area__titles">
|
14 |
<div class="named-area__title">
|
15 |
-
<?php echo esc_html( __( 'Ecwid plugin features', 'ecwid-shopping-cart' ) )
|
16 |
</div>
|
17 |
<div class="named-area__subtitle">
|
18 |
-
<?php echo esc_html( __( 'Extend your site with an easy-to-use plugin compatible with WordPress page builders and editors.', 'ecwid-shopping-cart' ) )
|
19 |
</div>
|
20 |
</div>
|
21 |
<div class="named-area__description"></div>
|
@@ -29,7 +29,7 @@
|
|
29 |
<div class="feature-element__core">
|
30 |
<div class="feature-element__data">
|
31 |
<div class="feature-element__title">
|
32 |
-
<?php echo esc_html( __( 'Store blocks for your website', 'ecwid-shopping-cart'))
|
33 |
</div>
|
34 |
<div class="feature-element__content">
|
35 |
<div class="feature-element__text">
|
@@ -37,7 +37,7 @@
|
|
37 |
<div class="titled-item__title"></div>
|
38 |
<div class="titled-item__content">
|
39 |
<div>
|
40 |
-
<?php echo esc_html( __( 'Add store components to any place of your WordPress site using shortcodes or WordPress site builders and editors.', 'ecwid-shopping-cart' ) )
|
41 |
</div>
|
42 |
</div>
|
43 |
</div>
|
@@ -66,14 +66,14 @@
|
|
66 |
<div class="cta-block">
|
67 |
<div class="cta-block__central">
|
68 |
<div class="cta-block__title">
|
69 |
-
<?php echo esc_html( __( 'Shortcodes', 'ecwid-shopping-cart'))
|
70 |
</div>
|
71 |
<div class="cta-block__content">
|
72 |
-
<?php echo esc_html( __( 'Add shortcodes to the WordPress site to apply basic changes to your store appearance.', 'ecwid-shopping-cart' ) )
|
73 |
</div>
|
74 |
</div>
|
75 |
<div class="cta-block__cta">
|
76 |
-
<a href="https://support.ecwid.com/hc/en-us/articles/360002137520" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
77 |
</div>
|
78 |
</div>
|
79 |
</div>
|
@@ -92,14 +92,14 @@
|
|
92 |
<div class="cta-block">
|
93 |
<div class="cta-block__central">
|
94 |
<div class="cta-block__title">
|
95 |
-
<?php echo esc_html( __( 'Store blocks for Gutenberg', 'ecwid-shopping-cart'))
|
96 |
</div>
|
97 |
<div class="cta-block__content">
|
98 |
-
<?php echo esc_html( __( 'Add store plugin to the WordPress site in Gutenberg block editor, with no HTML or shortcodes.', 'ecwid-shopping-cart' ) )
|
99 |
</div>
|
100 |
</div>
|
101 |
<div class="cta-block__cta">
|
102 |
-
<a href="https://support.ecwid.com/hc/en-us/articles/4489063443612" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
103 |
</div>
|
104 |
</div>
|
105 |
</div>
|
@@ -118,14 +118,14 @@
|
|
118 |
<div class="cta-block">
|
119 |
<div class="cta-block__central">
|
120 |
<div class="cta-block__title">
|
121 |
-
<?php echo esc_html( __( 'Store blocks for Elementor', 'ecwid-shopping-cart'))
|
122 |
</div>
|
123 |
<div class="cta-block__content">
|
124 |
-
<?php echo esc_html( __( 'Create a store from your website with the Ecwid plugin and Elementor page builder, with no coding required.', 'ecwid-shopping-cart' ) )
|
125 |
</div>
|
126 |
</div>
|
127 |
<div class="cta-block__cta">
|
128 |
-
<a href="https://support.ecwid.com/hc/en-us/articles/4489039710364" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
129 |
</div>
|
130 |
</div>
|
131 |
</div>
|
@@ -140,7 +140,7 @@
|
|
140 |
<div class="feature-element__core">
|
141 |
<div class="feature-element__data">
|
142 |
<div class="feature-element__title">
|
143 |
-
<?php echo esc_html( __( 'Advanced customization', 'ecwid-shopping-cart'))
|
144 |
</div>
|
145 |
<div class="feature-element__content">
|
146 |
<div class="feature-element__text">
|
@@ -148,7 +148,7 @@
|
|
148 |
<div class="titled-item__title"></div>
|
149 |
<div class="titled-item__content">
|
150 |
<div>
|
151 |
-
<?php echo esc_html( __( 'Use advanced settings and Ecwid API capabilities to tailor the look and functionality of your site.', 'ecwid-shopping-cart' ) )
|
152 |
</div>
|
153 |
</div>
|
154 |
</div>
|
@@ -174,14 +174,14 @@
|
|
174 |
<div class="cta-block">
|
175 |
<div class="cta-block__central">
|
176 |
<div class="cta-block__title">
|
177 |
-
<?php echo esc_html( __( 'Advanced settings', 'ecwid-shopping-cart'))
|
178 |
</div>
|
179 |
<div class="cta-block__content">
|
180 |
-
<?php echo esc_html( __( 'Change functionality of the plugin with advanced settings, like dashboard visibility for webmasters, display of store components, clean URLs, and more.', 'ecwid-shopping-cart' ) )
|
181 |
</div>
|
182 |
</div>
|
183 |
<div class="cta-block__cta">
|
184 |
-
<a href="<?php echo admin_url('admin.php?page=ec-params')
|
185 |
</div>
|
186 |
</div>
|
187 |
</div>
|
@@ -200,14 +200,14 @@
|
|
200 |
<div class="cta-block">
|
201 |
<div class="cta-block__central">
|
202 |
<div class="cta-block__title">
|
203 |
-
<?php echo esc_html( __( 'Customization with API', 'ecwid-shopping-cart'))
|
204 |
</div>
|
205 |
<div class="cta-block__content">
|
206 |
-
<?php echo esc_html( __( 'Use the powerful Ecwid API to customize your store design, layout, and functionality.', 'ecwid-shopping-cart' ) )
|
207 |
</div>
|
208 |
</div>
|
209 |
<div class="cta-block__cta">
|
210 |
-
<a href="https://api-docs.ecwid.com/reference/customize-appearance" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
211 |
</div>
|
212 |
</div>
|
213 |
</div>
|
@@ -221,10 +221,10 @@
|
|
221 |
<div class="named-area__header">
|
222 |
<div class="named-area__titles">
|
223 |
<div class="named-area__title">
|
224 |
-
<?php echo esc_html( __( 'Apps and integrations', 'ecwid-shopping-cart'))
|
225 |
</div>
|
226 |
<div class="named-area__subtitle">
|
227 |
-
<?php echo esc_html( __( 'Integrate your store with external services to enhance its functionality.', 'ecwid-shopping-cart' ) )
|
228 |
</div>
|
229 |
</div>
|
230 |
<div class="named-area__description"></div>
|
@@ -243,17 +243,17 @@
|
|
243 |
<div class="cta-block">
|
244 |
<div class="cta-block__central">
|
245 |
<div class="cta-block__title">
|
246 |
-
<?php echo esc_html( __( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart'))
|
247 |
</div>
|
248 |
<div class="cta-block__content">
|
249 |
-
<?php echo esc_html( __( 'If you want to move your WooCommerce store to Ecwid or have another store outside WooCommerce, use the Ecwid migration tool to import your products in bulk.', 'ecwid-shopping-cart' ) )
|
250 |
</div>
|
251 |
</div>
|
252 |
<div class="cta-block__cta">
|
253 |
-
<?php if( class_exists('woocommerce') && class_exists('Ecwid_Importer') )
|
254 |
-
<a href="<?php echo admin_url('admin.php?page=ec-store-import-woocommerce')
|
255 |
<?php } else { ?>
|
256 |
-
<a href="https://support.ecwid.com/hc/en-us/articles/360000049040" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
257 |
<?php } ?>
|
258 |
</div>
|
259 |
</div>
|
@@ -273,21 +273,21 @@
|
|
273 |
<div class="cta-block">
|
274 |
<div class="cta-block__central">
|
275 |
<div class="cta-block__title">
|
276 |
-
<?php echo esc_html( __( 'App Market', 'ecwid-shopping-cart'))
|
277 |
</div>
|
278 |
<div class="cta-block__content">
|
279 |
-
<?php echo esc_html( __( 'Enhance your store functionality, add new features, or connect backend systems with powerful apps, tools, and extensions.', 'ecwid-shopping-cart' ) )
|
280 |
</div>
|
281 |
</div>
|
282 |
<div class="cta-block__cta">
|
283 |
-
<?php
|
284 |
-
if( ecwid_is_demo_store() ) {
|
285 |
-
$app_market_link = 'https://www.ecwid.com/apps';
|
286 |
} else {
|
287 |
-
$app_market_link = admin_url('admin.php?page=ec-store-admin-appmarket');
|
288 |
}
|
289 |
?>
|
290 |
-
<a href="<?php echo esc_html($app_market_link)
|
291 |
</div>
|
292 |
</div>
|
293 |
</div>
|
@@ -306,14 +306,14 @@
|
|
306 |
<div class="cta-block">
|
307 |
<div class="cta-block__central">
|
308 |
<div class="cta-block__title">
|
309 |
-
<?php echo esc_html( __( 'Zapier integration', 'ecwid-shopping-cart'))
|
310 |
</div>
|
311 |
<div class="cta-block__content">
|
312 |
-
<?php echo esc_html( __( 'Connect thousands of popular apps to your online store with Zapier integration and streamline store management workflows without writing code.', 'ecwid-shopping-cart' ) )
|
313 |
</div>
|
314 |
</div>
|
315 |
<div class="cta-block__cta">
|
316 |
-
<a href="https://www.ecwid.com/blog/how-to-connect-ecwid-with-2000-online-business-tools.html" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More','ecwid-shopping-cart'))
|
317 |
</div>
|
318 |
</div>
|
319 |
</div>
|
@@ -332,14 +332,14 @@
|
|
332 |
<div class="cta-block">
|
333 |
<div class="cta-block__central">
|
334 |
<div class="cta-block__title">
|
335 |
-
<?php echo esc_html( __( 'API for catalog and sales','ecwid-shopping-cart'))
|
336 |
</div>
|
337 |
<div class="cta-block__content">
|
338 |
-
<?php echo esc_html( __( 'Use a powerful RESTful API to manage your store, mass update your product catalog and orders.', 'ecwid-shopping-cart' ) )
|
339 |
</div>
|
340 |
</div>
|
341 |
<div class="cta-block__cta">
|
342 |
-
<a href="https://api-docs.ecwid.com/reference/rest-api" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More','ecwid-shopping-cart'))
|
343 |
</div>
|
344 |
</div>
|
345 |
</div>
|
@@ -352,10 +352,10 @@
|
|
352 |
<div class="named-area__header">
|
353 |
<div class="named-area__titles">
|
354 |
<div class="named-area__title">
|
355 |
-
<?php echo esc_html( __( 'Partnership', 'ecwid-shopping-cart'))
|
356 |
</div>
|
357 |
<div class="named-area__subtitle">
|
358 |
-
<?php echo sprintf( __( 'Join our partnership program to build and scale your offering in ecommerce. <a %s>More about partnership</a>', 'ecwid-shopping-cart' ), 'href="https://www.ecwid.com/partners
|
359 |
</div>
|
360 |
</div>
|
361 |
<div class="named-area__description"></div>
|
@@ -374,14 +374,14 @@
|
|
374 |
<div class="cta-block">
|
375 |
<div class="cta-block__central">
|
376 |
<div class="cta-block__title">
|
377 |
-
<?php echo esc_html( __( 'Become an Ecwid Referral Partner', 'ecwid-shopping-cart'))
|
378 |
</div>
|
379 |
<div class="cta-block__content">
|
380 |
-
<?php echo esc_html( __( 'Recommend Ecwid within your network and get a 20% lifetime commission for every referral that creates an account through your link.', 'ecwid-shopping-cart' ) )
|
381 |
</div>
|
382 |
</div>
|
383 |
<div class="cta-block__cta">
|
384 |
-
<a href="https://www.ecwid.com/partners/referral" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
385 |
</div>
|
386 |
</div>
|
387 |
</div>
|
@@ -400,14 +400,14 @@
|
|
400 |
<div class="cta-block">
|
401 |
<div class="cta-block__central">
|
402 |
<div class="cta-block__title">
|
403 |
-
<?php echo esc_html( __( 'Promote your services as Ecwid Expert','ecwid-shopping-cart'))
|
404 |
</div>
|
405 |
<div class="cta-block__content">
|
406 |
-
<?php echo esc_html( __( 'Join our community of experts and promote your services to clients who need help with store setup, design, or customization.', 'ecwid-shopping-cart' ) )
|
407 |
</div>
|
408 |
</div>
|
409 |
<div class="cta-block__cta">
|
410 |
-
<a href="https://www.ecwid.com/experts" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart'))
|
411 |
</div>
|
412 |
</div>
|
413 |
</div>
|
@@ -426,14 +426,14 @@
|
|
426 |
<div class="cta-block">
|
427 |
<div class="cta-block__central">
|
428 |
<div class="cta-block__title">
|
429 |
-
<?php echo esc_html( __( 'Use Ecwid premium plan for free', 'ecwid-shopping-cart'))
|
430 |
</div>
|
431 |
<div class="cta-block__content">
|
432 |
-
<?php echo esc_html( __( 'If you’re developing sites on WordPress, you can get a free subscription to the Ecwid premium plan. Use it to build and test stores on the WordPress sites, check out the platform features, and get access to Ecwid API. Just apply for the free subscription, and we’ll get in touch with you soon.', 'ecwid-shopping-cart' ) )
|
433 |
</div>
|
434 |
</div>
|
435 |
<div class="cta-block__cta">
|
436 |
-
<a href="https://ecommerce-store.typeform.com/to/Heh5d4?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Apply for Free Plan', 'ecwid-shopping-cart'))
|
437 |
</div>
|
438 |
</div>
|
439 |
</div>
|
@@ -446,7 +446,7 @@
|
|
446 |
<div class="named-area__header">
|
447 |
<div class="named-area__titles">
|
448 |
<div class="named-area__title">
|
449 |
-
<?php echo esc_html( __( 'Need a hand?', 'ecwid-shopping-cart'))
|
450 |
</div>
|
451 |
<div class="named-area__subtitle"></div>
|
452 |
</div>
|
@@ -466,14 +466,14 @@
|
|
466 |
<div class="cta-block">
|
467 |
<div class="cta-block__central">
|
468 |
<div class="cta-block__title">
|
469 |
-
<?php echo esc_html( __( 'Join developer community on Slack', 'ecwid-shopping-cart'))
|
470 |
</div>
|
471 |
<div class="cta-block__content">
|
472 |
-
<?php echo esc_html( __( 'Join the community of professionals to get help with questions that are not covered by Help Center or API documentation.', 'ecwid-shopping-cart' ) )
|
473 |
</div>
|
474 |
</div>
|
475 |
<div class="cta-block__cta">
|
476 |
-
<a href="https://ecwid-community.herokuapp.com
|
477 |
</div>
|
478 |
</div>
|
479 |
</div>
|
@@ -490,14 +490,14 @@
|
|
490 |
<div class="cta-block">
|
491 |
<div class="cta-block__central">
|
492 |
<div class="cta-block__title">
|
493 |
-
<?php echo esc_html( __( 'Request custom development', 'ecwid-shopping-cart' ) )
|
494 |
</div>
|
495 |
<div class="cta-block__content">
|
496 |
-
<?php echo esc_html( __( 'The Ecwid team can help you build the desired features and options that Ecwid does not have out of the box — from integrations with other tools to your own mobile app. Custom development is a paid service, the price depends on the complexity of the request.', 'ecwid-shopping-cart' ) )
|
497 |
</div>
|
498 |
</div>
|
499 |
<div class="cta-block__cta">
|
500 |
-
<a href="https://support.ecwid.com/hc/en-us/articles/115005821245" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Submit Request', 'ecwid-shopping-cart') )
|
501 |
</div>
|
502 |
</div>
|
503 |
</div>
|
@@ -516,14 +516,14 @@
|
|
516 |
<div class="cta-block">
|
517 |
<div class="cta-block__central">
|
518 |
<div class="cta-block__title">
|
519 |
-
<?php echo esc_html( __( 'Leave feedback', 'ecwid-shopping-cart' ) )
|
520 |
</div>
|
521 |
<div class="cta-block__content">
|
522 |
-
<?php echo esc_html( __( 'Tell us what can be improved regarding Ecwid features, integrations, and functionality.', 'ecwid-shopping-cart' ) )
|
523 |
</div>
|
524 |
</div>
|
525 |
<div class="cta-block__cta">
|
526 |
-
<a href="https://ecommerce-store.typeform.com/to/qMgJpSBq?utm_source=wp-plugin#store_id=<?php echo get_ecwid_store_id(); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Leave Feedback', 'ecwid-shopping-cart' ) )
|
527 |
</div>
|
528 |
</div>
|
529 |
</div>
|
@@ -533,4 +533,4 @@
|
|
533 |
</div>
|
534 |
</div>
|
535 |
</div>
|
536 |
-
</div>
|
1 |
<div id="ec-store-developers" class="settings-page ec-ui-framework-page">
|
2 |
<div class="settings-page__header">
|
3 |
<div class="settings-page__titles settings-page__titles--left">
|
4 |
+
<h1 class="settings-page__title"><?php echo esc_html( __( 'Developers', 'ecwid-shopping-cart' ) ); ?></h1>
|
5 |
<div class="settings-page__subtitle">
|
6 |
+
<?php echo esc_html( __( 'Build the store your client needs and realize your own vision with Ecwid. Use the Ecwid plugin, powerful API, apps and integrations to design stores and build your own solutions. Become an Ecwid partner and grow your business effectively.', 'ecwid-shopping-cart' ) ); ?>
|
7 |
</div>
|
8 |
</div>
|
9 |
</div>
|
12 |
<div class="named-area__header">
|
13 |
<div class="named-area__titles">
|
14 |
<div class="named-area__title">
|
15 |
+
<?php echo esc_html( __( 'Ecwid plugin features', 'ecwid-shopping-cart' ) ); ?>
|
16 |
</div>
|
17 |
<div class="named-area__subtitle">
|
18 |
+
<?php echo esc_html( __( 'Extend your site with an easy-to-use plugin compatible with WordPress page builders and editors.', 'ecwid-shopping-cart' ) ); ?>
|
19 |
</div>
|
20 |
</div>
|
21 |
<div class="named-area__description"></div>
|
29 |
<div class="feature-element__core">
|
30 |
<div class="feature-element__data">
|
31 |
<div class="feature-element__title">
|
32 |
+
<?php echo esc_html( __( 'Store blocks for your website', 'ecwid-shopping-cart' ) ); ?>
|
33 |
</div>
|
34 |
<div class="feature-element__content">
|
35 |
<div class="feature-element__text">
|
37 |
<div class="titled-item__title"></div>
|
38 |
<div class="titled-item__content">
|
39 |
<div>
|
40 |
+
<?php echo esc_html( __( 'Add store components to any place of your WordPress site using shortcodes or WordPress site builders and editors.', 'ecwid-shopping-cart' ) ); ?>
|
41 |
</div>
|
42 |
</div>
|
43 |
</div>
|
66 |
<div class="cta-block">
|
67 |
<div class="cta-block__central">
|
68 |
<div class="cta-block__title">
|
69 |
+
<?php echo esc_html( __( 'Shortcodes', 'ecwid-shopping-cart' ) ); ?>
|
70 |
</div>
|
71 |
<div class="cta-block__content">
|
72 |
+
<?php echo esc_html( __( 'Add shortcodes to the WordPress site to apply basic changes to your store appearance.', 'ecwid-shopping-cart' ) ); ?>
|
73 |
</div>
|
74 |
</div>
|
75 |
<div class="cta-block__cta">
|
76 |
+
<a href="https://support.ecwid.com/hc/en-us/articles/360002137520?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
77 |
</div>
|
78 |
</div>
|
79 |
</div>
|
92 |
<div class="cta-block">
|
93 |
<div class="cta-block__central">
|
94 |
<div class="cta-block__title">
|
95 |
+
<?php echo esc_html( __( 'Store blocks for Gutenberg', 'ecwid-shopping-cart' ) ); ?>
|
96 |
</div>
|
97 |
<div class="cta-block__content">
|
98 |
+
<?php echo esc_html( __( 'Add store plugin to the WordPress site in Gutenberg block editor, with no HTML or shortcodes.', 'ecwid-shopping-cart' ) ); ?>
|
99 |
</div>
|
100 |
</div>
|
101 |
<div class="cta-block__cta">
|
102 |
+
<a href="https://support.ecwid.com/hc/en-us/articles/4489063443612?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
103 |
</div>
|
104 |
</div>
|
105 |
</div>
|
118 |
<div class="cta-block">
|
119 |
<div class="cta-block__central">
|
120 |
<div class="cta-block__title">
|
121 |
+
<?php echo esc_html( __( 'Store blocks for Elementor', 'ecwid-shopping-cart' ) ); ?>
|
122 |
</div>
|
123 |
<div class="cta-block__content">
|
124 |
+
<?php echo esc_html( __( 'Create a store from your website with the Ecwid plugin and Elementor page builder, with no coding required.', 'ecwid-shopping-cart' ) ); ?>
|
125 |
</div>
|
126 |
</div>
|
127 |
<div class="cta-block__cta">
|
128 |
+
<a href="https://support.ecwid.com/hc/en-us/articles/4489039710364?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
129 |
</div>
|
130 |
</div>
|
131 |
</div>
|
140 |
<div class="feature-element__core">
|
141 |
<div class="feature-element__data">
|
142 |
<div class="feature-element__title">
|
143 |
+
<?php echo esc_html( __( 'Advanced customization', 'ecwid-shopping-cart' ) ); ?>
|
144 |
</div>
|
145 |
<div class="feature-element__content">
|
146 |
<div class="feature-element__text">
|
148 |
<div class="titled-item__title"></div>
|
149 |
<div class="titled-item__content">
|
150 |
<div>
|
151 |
+
<?php echo esc_html( __( 'Use advanced settings and Ecwid API capabilities to tailor the look and functionality of your site.', 'ecwid-shopping-cart' ) ); ?>
|
152 |
</div>
|
153 |
</div>
|
154 |
</div>
|
174 |
<div class="cta-block">
|
175 |
<div class="cta-block__central">
|
176 |
<div class="cta-block__title">
|
177 |
+
<?php echo esc_html( __( 'Advanced settings', 'ecwid-shopping-cart' ) ); ?>
|
178 |
</div>
|
179 |
<div class="cta-block__content">
|
180 |
+
<?php echo esc_html( __( 'Change functionality of the plugin with advanced settings, like dashboard visibility for webmasters, display of store components, clean URLs, and more.', 'ecwid-shopping-cart' ) ); ?>
|
181 |
</div>
|
182 |
</div>
|
183 |
<div class="cta-block__cta">
|
184 |
+
<a href="<?php echo admin_url( 'admin.php?page=ec-params' ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to Settings', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
185 |
</div>
|
186 |
</div>
|
187 |
</div>
|
200 |
<div class="cta-block">
|
201 |
<div class="cta-block__central">
|
202 |
<div class="cta-block__title">
|
203 |
+
<?php echo esc_html( __( 'Customization with API', 'ecwid-shopping-cart' ) ); ?>
|
204 |
</div>
|
205 |
<div class="cta-block__content">
|
206 |
+
<?php echo esc_html( __( 'Use the powerful Ecwid API to customize your store design, layout, and functionality.', 'ecwid-shopping-cart' ) ); ?>
|
207 |
</div>
|
208 |
</div>
|
209 |
<div class="cta-block__cta">
|
210 |
+
<a href="https://api-docs.ecwid.com/reference/customize-appearance?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
211 |
</div>
|
212 |
</div>
|
213 |
</div>
|
221 |
<div class="named-area__header">
|
222 |
<div class="named-area__titles">
|
223 |
<div class="named-area__title">
|
224 |
+
<?php echo esc_html( __( 'Apps and integrations', 'ecwid-shopping-cart' ) ); ?>
|
225 |
</div>
|
226 |
<div class="named-area__subtitle">
|
227 |
+
<?php echo esc_html( __( 'Integrate your store with external services to enhance its functionality.', 'ecwid-shopping-cart' ) ); ?>
|
228 |
</div>
|
229 |
</div>
|
230 |
<div class="named-area__description"></div>
|
243 |
<div class="cta-block">
|
244 |
<div class="cta-block__central">
|
245 |
<div class="cta-block__title">
|
246 |
+
<?php echo esc_html( __( 'Import product catalog from WooCommerce', 'ecwid-shopping-cart' ) ); ?>
|
247 |
</div>
|
248 |
<div class="cta-block__content">
|
249 |
+
<?php echo esc_html( __( 'If you want to move your WooCommerce store to Ecwid or have another store outside WooCommerce, use the Ecwid migration tool to import your products in bulk.', 'ecwid-shopping-cart' ) ); ?>
|
250 |
</div>
|
251 |
</div>
|
252 |
<div class="cta-block__cta">
|
253 |
+
<?php if ( class_exists( 'woocommerce' ) && class_exists( 'Ecwid_Importer' ) ) { ?>
|
254 |
+
<a href="<?php echo admin_url( 'admin.php?page=ec-store-import-woocommerce' ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to Import Page', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
255 |
<?php } else { ?>
|
256 |
+
<a href="https://support.ecwid.com/hc/en-us/articles/360000049040?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
257 |
<?php } ?>
|
258 |
</div>
|
259 |
</div>
|
273 |
<div class="cta-block">
|
274 |
<div class="cta-block__central">
|
275 |
<div class="cta-block__title">
|
276 |
+
<?php echo esc_html( __( 'App Market', 'ecwid-shopping-cart' ) ); ?>
|
277 |
</div>
|
278 |
<div class="cta-block__content">
|
279 |
+
<?php echo esc_html( __( 'Enhance your store functionality, add new features, or connect backend systems with powerful apps, tools, and extensions.', 'ecwid-shopping-cart' ) ); ?>
|
280 |
</div>
|
281 |
</div>
|
282 |
<div class="cta-block__cta">
|
283 |
+
<?php
|
284 |
+
if ( ecwid_is_demo_store() ) {
|
285 |
+
$app_market_link = 'https://www.ecwid.com/apps?utm_source=wp-plugin';
|
286 |
} else {
|
287 |
+
$app_market_link = admin_url( 'admin.php?page=ec-store-admin-appmarket' );
|
288 |
}
|
289 |
?>
|
290 |
+
<a href="<?php echo esc_html( $app_market_link ); ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Go to App Market', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
291 |
</div>
|
292 |
</div>
|
293 |
</div>
|
306 |
<div class="cta-block">
|
307 |
<div class="cta-block__central">
|
308 |
<div class="cta-block__title">
|
309 |
+
<?php echo esc_html( __( 'Zapier integration', 'ecwid-shopping-cart' ) ); ?>
|
310 |
</div>
|
311 |
<div class="cta-block__content">
|
312 |
+
<?php echo esc_html( __( 'Connect thousands of popular apps to your online store with Zapier integration and streamline store management workflows without writing code.', 'ecwid-shopping-cart' ) ); ?>
|
313 |
</div>
|
314 |
</div>
|
315 |
<div class="cta-block__cta">
|
316 |
+
<a href="https://www.ecwid.com/blog/how-to-connect-ecwid-with-2000-online-business-tools.html?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
317 |
</div>
|
318 |
</div>
|
319 |
</div>
|
332 |
<div class="cta-block">
|
333 |
<div class="cta-block__central">
|
334 |
<div class="cta-block__title">
|
335 |
+
<?php echo esc_html( __( 'API for catalog and sales', 'ecwid-shopping-cart' ) ); ?>
|
336 |
</div>
|
337 |
<div class="cta-block__content">
|
338 |
+
<?php echo esc_html( __( 'Use a powerful RESTful API to manage your store, mass update your product catalog and orders.', 'ecwid-shopping-cart' ) ); ?>
|
339 |
</div>
|
340 |
</div>
|
341 |
<div class="cta-block__cta">
|
342 |
+
<a href="https://api-docs.ecwid.com/reference/rest-api?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
343 |
</div>
|
344 |
</div>
|
345 |
</div>
|
352 |
<div class="named-area__header">
|
353 |
<div class="named-area__titles">
|
354 |
<div class="named-area__title">
|
355 |
+
<?php echo esc_html( __( 'Partnership', 'ecwid-shopping-cart' ) ); ?>
|
356 |
</div>
|
357 |
<div class="named-area__subtitle">
|
358 |
+
<?php echo sprintf( __( 'Join our partnership program to build and scale your offering in ecommerce. <a %s>More about partnership</a>', 'ecwid-shopping-cart' ), 'href="https://www.ecwid.com/partners/?utm_source=wp-plugin" target="_blank"' ); ?>
|
359 |
</div>
|
360 |
</div>
|
361 |
<div class="named-area__description"></div>
|
374 |
<div class="cta-block">
|
375 |
<div class="cta-block__central">
|
376 |
<div class="cta-block__title">
|
377 |
+
<?php echo esc_html( __( 'Become an Ecwid Referral Partner', 'ecwid-shopping-cart' ) ); ?>
|
378 |
</div>
|
379 |
<div class="cta-block__content">
|
380 |
+
<?php echo esc_html( __( 'Recommend Ecwid within your network and get a 20% lifetime commission for every referral that creates an account through your link.', 'ecwid-shopping-cart' ) ); ?>
|
381 |
</div>
|
382 |
</div>
|
383 |
<div class="cta-block__cta">
|
384 |
+
<a href="https://www.ecwid.com/partners/referral?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
385 |
</div>
|
386 |
</div>
|
387 |
</div>
|
400 |
<div class="cta-block">
|
401 |
<div class="cta-block__central">
|
402 |
<div class="cta-block__title">
|
403 |
+
<?php echo esc_html( __( 'Promote your services as Ecwid Expert', 'ecwid-shopping-cart' ) ); ?>
|
404 |
</div>
|
405 |
<div class="cta-block__content">
|
406 |
+
<?php echo esc_html( __( 'Join our community of experts and promote your services to clients who need help with store setup, design, or customization.', 'ecwid-shopping-cart' ) ); ?>
|
407 |
</div>
|
408 |
</div>
|
409 |
<div class="cta-block__cta">
|
410 |
+
<a href="https://www.ecwid.com/experts?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Learn More', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
411 |
</div>
|
412 |
</div>
|
413 |
</div>
|
426 |
<div class="cta-block">
|
427 |
<div class="cta-block__central">
|
428 |
<div class="cta-block__title">
|
429 |
+
<?php echo esc_html( __( 'Use Ecwid premium plan for free', 'ecwid-shopping-cart' ) ); ?>
|
430 |
</div>
|
431 |
<div class="cta-block__content">
|
432 |
+
<?php echo esc_html( __( 'If you’re developing sites on WordPress, you can get a free subscription to the Ecwid premium plan. Use it to build and test stores on the WordPress sites, check out the platform features, and get access to Ecwid API. Just apply for the free subscription, and we’ll get in touch with you soon.', 'ecwid-shopping-cart' ) ); ?>
|
433 |
</div>
|
434 |
</div>
|
435 |
<div class="cta-block__cta">
|
436 |
+
<a href="https://ecommerce-store.typeform.com/to/Heh5d4?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Apply for Free Plan', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
437 |
</div>
|
438 |
</div>
|
439 |
</div>
|
446 |
<div class="named-area__header">
|
447 |
<div class="named-area__titles">
|
448 |
<div class="named-area__title">
|
449 |
+
<?php echo esc_html( __( 'Need a hand?', 'ecwid-shopping-cart' ) ); ?>
|
450 |
</div>
|
451 |
<div class="named-area__subtitle"></div>
|
452 |
</div>
|
466 |
<div class="cta-block">
|
467 |
<div class="cta-block__central">
|
468 |
<div class="cta-block__title">
|
469 |
+
<?php echo esc_html( __( 'Join developer community on Slack', 'ecwid-shopping-cart' ) ); ?>
|
470 |
</div>
|
471 |
<div class="cta-block__content">
|
472 |
+
<?php echo esc_html( __( 'Join the community of professionals to get help with questions that are not covered by Help Center or API documentation.', 'ecwid-shopping-cart' ) ); ?>
|
473 |
</div>
|
474 |
</div>
|
475 |
<div class="cta-block__cta">
|
476 |
+
<a href="https://ecwid-community.herokuapp.com/?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span>Join Community</span> </a>
|
477 |
</div>
|
478 |
</div>
|
479 |
</div>
|
490 |
<div class="cta-block">
|
491 |
<div class="cta-block__central">
|
492 |
<div class="cta-block__title">
|
493 |
+
<?php echo esc_html( __( 'Request custom development', 'ecwid-shopping-cart' ) ); ?>
|
494 |
</div>
|
495 |
<div class="cta-block__content">
|
496 |
+
<?php echo esc_html( __( 'The Ecwid team can help you build the desired features and options that Ecwid does not have out of the box — from integrations with other tools to your own mobile app. Custom development is a paid service, the price depends on the complexity of the request.', 'ecwid-shopping-cart' ) ); ?>
|
497 |
</div>
|
498 |
</div>
|
499 |
<div class="cta-block__cta">
|
500 |
+
<a href="https://support.ecwid.com/hc/en-us/articles/115005821245?utm_source=wp-plugin" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Submit Request', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
501 |
</div>
|
502 |
</div>
|
503 |
</div>
|
516 |
<div class="cta-block">
|
517 |
<div class="cta-block__central">
|
518 |
<div class="cta-block__title">
|
519 |
+
<?php echo esc_html( __( 'Leave feedback', 'ecwid-shopping-cart' ) ); ?>
|
520 |
</div>
|
521 |
<div class="cta-block__content">
|
522 |
+
<?php echo esc_html( __( 'Tell us what can be improved regarding Ecwid features, integrations, and functionality.', 'ecwid-shopping-cart' ) ); ?>
|
523 |
</div>
|
524 |
</div>
|
525 |
<div class="cta-block__cta">
|
526 |
+
<a href="https://ecommerce-store.typeform.com/to/qMgJpSBq?utm_source=wp-plugin#store_id=<?php echo get_ecwid_store_id(); ?>&email=<?php echo $admin_email; ?>" target="_blank" type="button" class="btn btn-default btn-medium"> <span><?php echo esc_html( __( 'Leave Feedback', 'ecwid-shopping-cart' ) ); ?></span> </a>
|
527 |
</div>
|
528 |
</div>
|
529 |
</div>
|
533 |
</div>
|
534 |
</div>
|
535 |
</div>
|
536 |
+
</div>
|