Version Description
- Nov 13, 2018 =
- WordPress v 5.0 compatibility. This update brings compatibility with the upcoming WordPress version. In particular, we made sure Ecwid e-commerce stores looks good with the new Twenty Nineteenth theme. Also, we polished the Ecwid online store block in the new WordPress editor (Gutenberg) to make sure you can add a product listing to any site page and customize its appearance including colors, product grid layout, store navigation controls, product page appearance and more.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 6.4.1 |
Comparing to | |
See all releases |
Code changes from version 6.4 to 6.4.1
- ecwid-shopping-cart.php +5 -1
- includes/class-ecwid-product-browser.php +6 -6
- includes/class-ecwid-store-page.php +26 -0
- includes/importer/class-ecwid-importer-task.php +1 -1
- includes/integrations/class-ecwid-integration-gutenberg.php +118 -27
- includes/themes.php +3 -2
- includes/themes/class-ecwid-theme-twentynineteen.php +19 -0
- includes/widgets/class-ecwid-widget-latest-products.php +1 -0
- includes/widgets/class-ecwid-widget-products-base.php +2 -2
- js/gutenberg/blocks.build.js +1 -1
- js/gutenberg/store.jsx +75 -71
- lib/ecwid_catalog.php +2 -2
- readme.txt +15 -12
ecwid-shopping-cart.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ecwid.com?source=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.4
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
@@ -143,6 +143,10 @@ if (version_compare($version, '4.0') >= 0) {
|
|
143 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
|
144 |
}
|
145 |
|
|
|
|
|
|
|
|
|
146 |
$ecwid_script_rendered = false; // controls single script.js on page
|
147 |
|
148 |
|
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.4.1
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
143 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-floating-minicart.php';
|
144 |
}
|
145 |
|
146 |
+
if ( strpos( $version, '5.0' ) === 0 || version_compare( $version, '5.0' ) > 0 ) {
|
147 |
+
require_once ECWID_PLUGIN_DIR . 'includes/integrations/class-ecwid-integration-gutenberg.php';
|
148 |
+
}
|
149 |
+
|
150 |
$ecwid_script_rendered = false; // controls single script.js on page
|
151 |
|
152 |
|
includes/class-ecwid-product-browser.php
CHANGED
@@ -25,7 +25,7 @@ class Ecwid_Product_Browser
|
|
25 |
'name' => 'product_list_image_aspect_ratio',
|
26 |
'title' => __( 'Product thumbnail aspect ratio', 'ecwid-shopping-cart' ),
|
27 |
'values' => self::_get_aspect_ratios(),
|
28 |
-
'default' => '
|
29 |
'is_storefront_api' => true
|
30 |
),
|
31 |
|
@@ -201,7 +201,7 @@ class Ecwid_Product_Browser
|
|
201 |
'name' => 'default_category_id',
|
202 |
'title' => __( 'Default category ID', 'ecwid-shopping-cart' ),
|
203 |
'type' => 'default_category_id',
|
204 |
-
'default' =>
|
205 |
),
|
206 |
|
207 |
'product_details_layout' => array(
|
@@ -216,16 +216,16 @@ class Ecwid_Product_Browser
|
|
216 |
'name' => 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
217 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
218 |
'type' => 'boolean',
|
219 |
-
'default' =>
|
220 |
'is_storefront_api' => true
|
221 |
),
|
222 |
|
223 |
|
224 |
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar' => array(
|
225 |
-
'name' => '
|
226 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
227 |
'type' => 'boolean',
|
228 |
-
'default' =>
|
229 |
'is_storefront_api' => true
|
230 |
),
|
231 |
|
@@ -386,7 +386,7 @@ class Ecwid_Product_Browser
|
|
386 |
'icon' => 'aspect34',
|
387 |
),
|
388 |
array(
|
389 |
-
'value' => '
|
390 |
'title' => __( 'Square 1:1', 'ecwid-shopping-cart' ),
|
391 |
'icon' => 'aspect11'
|
392 |
),
|
25 |
'name' => 'product_list_image_aspect_ratio',
|
26 |
'title' => __( 'Product thumbnail aspect ratio', 'ecwid-shopping-cart' ),
|
27 |
'values' => self::_get_aspect_ratios(),
|
28 |
+
'default' => 'SQUARE',
|
29 |
'is_storefront_api' => true
|
30 |
),
|
31 |
|
201 |
'name' => 'default_category_id',
|
202 |
'title' => __( 'Default category ID', 'ecwid-shopping-cart' ),
|
203 |
'type' => 'default_category_id',
|
204 |
+
'default' => 0
|
205 |
),
|
206 |
|
207 |
'product_details_layout' => array(
|
216 |
'name' => 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
217 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
218 |
'type' => 'boolean',
|
219 |
+
'default' => true,
|
220 |
'is_storefront_api' => true
|
221 |
),
|
222 |
|
223 |
|
224 |
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar' => array(
|
225 |
+
'name' => 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar',
|
226 |
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
227 |
'type' => 'boolean',
|
228 |
+
'default' => true,
|
229 |
'is_storefront_api' => true
|
230 |
),
|
231 |
|
386 |
'icon' => 'aspect34',
|
387 |
),
|
388 |
array(
|
389 |
+
'value' => 'SQUARE',
|
390 |
'title' => __( 'Square 1:1', 'ecwid-shopping-cart' ),
|
391 |
'icon' => 'aspect11'
|
392 |
),
|
includes/class-ecwid-store-page.php
CHANGED
@@ -164,6 +164,32 @@ class Ecwid_Store_Page {
|
|
164 |
return $page_id;
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
public static function is_store_page( $page_id = 0 ) {
|
168 |
|
169 |
if (!$page_id) {
|
164 |
return $page_id;
|
165 |
}
|
166 |
|
167 |
+
public static function save_store_page_data( $name, $value ) {
|
168 |
+
$current = get_the_ID();
|
169 |
+
|
170 |
+
$data = get_post_meta( $current, self::META_STORE_DATA, true );
|
171 |
+
|
172 |
+
if (! is_array( $data ) ) {
|
173 |
+
$data = array();
|
174 |
+
}
|
175 |
+
|
176 |
+
$data[$name] = $value;
|
177 |
+
|
178 |
+
update_post_meta( $current, self::META_STORE_DATA, $data );
|
179 |
+
}
|
180 |
+
|
181 |
+
public static function get_store_page_data( $name ) {
|
182 |
+
$current = get_the_ID();
|
183 |
+
|
184 |
+
$data = get_post_meta( $current, self::META_STORE_DATA, true );
|
185 |
+
|
186 |
+
if ( class_exists( 'Ecwid_Integration_Gutenberg' ) ) {
|
187 |
+
$data = array_merge( $data, Ecwid_Integration_Gutenberg::get_store_block_data_from_current_page() );
|
188 |
+
}
|
189 |
+
|
190 |
+
return @$data[$name];
|
191 |
+
}
|
192 |
+
|
193 |
public static function is_store_page( $page_id = 0 ) {
|
194 |
|
195 |
if (!$page_id) {
|
includes/importer/class-ecwid-importer-task.php
CHANGED
@@ -478,7 +478,7 @@ class Ecwid_Importer_Task_Create_Product_Variation extends Ecwid_Importer_Task
|
|
478 |
$variation_data['quantity'] = $var['max_qty'];
|
479 |
}
|
480 |
|
481 |
-
if ( $var['sku'] != $p->
|
482 |
$variation_data['sku'] = $var['sku'];
|
483 |
}
|
484 |
|
478 |
$variation_data['quantity'] = $var['max_qty'];
|
479 |
}
|
480 |
|
481 |
+
if ( $var['sku'] != $p->get_sku() ) {
|
482 |
$variation_data['sku'] = $var['sku'];
|
483 |
}
|
484 |
|
includes/integrations/class-ecwid-integration-gutenberg.php
CHANGED
@@ -5,7 +5,7 @@ require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-product-browser.php';
|
|
5 |
class Ecwid_Integration_Gutenberg {
|
6 |
|
7 |
const STORE_BLOCK = 'ecwid/store-block';
|
8 |
-
const PRODUCT_BLOCK = '
|
9 |
|
10 |
public function __construct() {
|
11 |
|
@@ -21,7 +21,7 @@ class Ecwid_Integration_Gutenberg {
|
|
21 |
|
22 |
add_action( "rest_insert_post", array( $this, 'on_save_post' ), 10, 3 );
|
23 |
add_action( "rest_insert_page", array( $this, 'on_save_post' ), 10, 3 );
|
24 |
-
|
25 |
register_block_type(self::STORE_BLOCK, array(
|
26 |
'editor_script' => 'ecwid-gutenberg-store',
|
27 |
'render_callback' => array( $this, 'render_callback' ),
|
@@ -42,20 +42,30 @@ class Ecwid_Integration_Gutenberg {
|
|
42 |
}
|
43 |
|
44 |
public function enqueue_block_editor_assets() {
|
45 |
-
wp_enqueue_script( 'gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
|
46 |
wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css' );
|
47 |
if ( Ecwid_Api_V3::is_available() ) {
|
48 |
EcwidPlatform::enqueue_script( 'gutenberg-product', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
|
49 |
}
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
$api = new Ecwid_Api_V3();
|
58 |
-
wp_localize_script( 'gutenberg-store', 'EcwidGutenbergStoreBlockParams',
|
59 |
array(
|
60 |
'attributes' => $this->_get_attributes_for_editor(),
|
61 |
'is_new_product_list' => $this->_is_new_product_list(),
|
@@ -65,7 +75,7 @@ class Ecwid_Integration_Gutenberg {
|
|
65 |
);
|
66 |
|
67 |
$is_demo_store = ecwid_is_demo_store();
|
68 |
-
wp_localize_script( 'gutenberg-store', 'EcwidGutenbergParams',
|
69 |
array(
|
70 |
'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
|
71 |
'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
|
@@ -135,11 +145,11 @@ class Ecwid_Integration_Gutenberg {
|
|
135 |
}
|
136 |
|
137 |
public function render_callback( $params ) {
|
138 |
-
|
139 |
if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
|
140 |
return '';
|
141 |
}
|
142 |
-
|
143 |
$params['widgets'] = 'productbrowser';
|
144 |
if ( @$params['show_categories'] ) {
|
145 |
$params['widgets'] .= ' categories';
|
@@ -155,9 +165,35 @@ class Ecwid_Integration_Gutenberg {
|
|
155 |
';
|
156 |
|
157 |
$attributes = $this->_get_attributes_for_editor();
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
if ( @$attribute['type'] == 'boolean') {
|
162 |
$result .= 'window.ec.storefront.' . $name . "=" . ( $value ? 'true' : 'false' ) . ";" . PHP_EOL;
|
163 |
} else {
|
@@ -165,7 +201,8 @@ class Ecwid_Integration_Gutenberg {
|
|
165 |
}
|
166 |
}
|
167 |
}
|
168 |
-
|
|
|
169 |
$colors = array();
|
170 |
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
|
171 |
$color = @$params['chameleon_color_' . $kind];
|
@@ -224,26 +261,58 @@ JS;
|
|
224 |
return get_option( 'ecwid_plugin_version' );
|
225 |
}
|
226 |
|
227 |
-
protected function _get_attributes_for_editor()
|
228 |
-
{
|
229 |
$api = new Ecwid_Api_V3();
|
230 |
-
|
231 |
if ( $api->is_available() && $api->get_store_profile() ) {
|
232 |
$settings = $api->get_store_profile()->designSettings;
|
233 |
} else {
|
234 |
$settings = new stdClass();
|
235 |
}
|
236 |
-
|
237 |
$attributes = Ecwid_Product_Browser::get_attributes();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
foreach ( $attributes as $key => $attribute ) {
|
239 |
$name = $attribute['name'];
|
|
|
|
|
240 |
if ( property_exists( $settings, $name ) ) {
|
241 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
}
|
243 |
}
|
244 |
-
|
245 |
$categories = ecwid_get_categories_for_selector();
|
246 |
-
|
247 |
if ( $categories ) {
|
248 |
$attributes['default_category_id']['values'] = array(
|
249 |
array(
|
@@ -258,17 +327,39 @@ JS;
|
|
258 |
);
|
259 |
}
|
260 |
} else {
|
261 |
-
$api
|
262 |
$cats = $api->get_categories( array() );
|
263 |
-
|
264 |
if ( $cats && $cats->total == 0 ) {
|
265 |
unset( $attributes['default_category_id'] );
|
266 |
}
|
267 |
}
|
|
|
|
|
|
|
|
|
|
|
268 |
|
269 |
-
|
270 |
|
271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
protected function _get_store_icon_path()
|
5 |
class Ecwid_Integration_Gutenberg {
|
6 |
|
7 |
const STORE_BLOCK = 'ecwid/store-block';
|
8 |
+
const PRODUCT_BLOCK = 'ecwid/product-block';
|
9 |
|
10 |
public function __construct() {
|
11 |
|
21 |
|
22 |
add_action( "rest_insert_post", array( $this, 'on_save_post' ), 10, 3 );
|
23 |
add_action( "rest_insert_page", array( $this, 'on_save_post' ), 10, 3 );
|
24 |
+
|
25 |
register_block_type(self::STORE_BLOCK, array(
|
26 |
'editor_script' => 'ecwid-gutenberg-store',
|
27 |
'render_callback' => array( $this, 'render_callback' ),
|
42 |
}
|
43 |
|
44 |
public function enqueue_block_editor_assets() {
|
45 |
+
wp_enqueue_script( 'ecwid-gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ) );
|
46 |
wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css' );
|
47 |
if ( Ecwid_Api_V3::is_available() ) {
|
48 |
EcwidPlatform::enqueue_script( 'gutenberg-product', array( 'wp-blocks', 'wp-i18n', 'wp-element' ) );
|
49 |
}
|
50 |
|
51 |
+
$locale_data = '';
|
52 |
+
if ( function_exists( 'gutenberg_get_jed_locale_data' ) ) {
|
53 |
+
$locale_data = gutenberg_get_jed_locale_data( 'ecwid-shopping-cart' );
|
54 |
+
} else if ( function_exists( 'wp_get_jed_locale_data' ) ) {
|
55 |
+
$locale_data = wp_get_jed_locale_data( 'ecwid-shopping-cart' );
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
if ( $locale_data ) {
|
60 |
+
wp_add_inline_script(
|
61 |
+
'ecwid-gutenberg-store',
|
62 |
+
'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ', "ecwid-shopping-cart"' . ');',
|
63 |
+
'before'
|
64 |
+
);
|
65 |
+
}
|
66 |
|
67 |
$api = new Ecwid_Api_V3();
|
68 |
+
wp_localize_script( 'ecwid-gutenberg-store', 'EcwidGutenbergStoreBlockParams',
|
69 |
array(
|
70 |
'attributes' => $this->_get_attributes_for_editor(),
|
71 |
'is_new_product_list' => $this->_is_new_product_list(),
|
75 |
);
|
76 |
|
77 |
$is_demo_store = ecwid_is_demo_store();
|
78 |
+
wp_localize_script( 'ecwid-gutenberg-store', 'EcwidGutenbergParams',
|
79 |
array(
|
80 |
'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
|
81 |
'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
|
145 |
}
|
146 |
|
147 |
public function render_callback( $params ) {
|
148 |
+
|
149 |
if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
|
150 |
return '';
|
151 |
}
|
152 |
+
|
153 |
$params['widgets'] = 'productbrowser';
|
154 |
if ( @$params['show_categories'] ) {
|
155 |
$params['widgets'] .= ' categories';
|
165 |
';
|
166 |
|
167 |
$attributes = $this->_get_attributes_for_editor();
|
168 |
+
|
169 |
+
foreach ( $attributes as $key => $attribute ) {
|
170 |
+
|
171 |
+
$name = $attribute['name'];
|
172 |
+
// we do not print defaults
|
173 |
+
if ( !isset( $params[$name] ) ) continue;
|
174 |
+
|
175 |
+
$value = $params[$name];
|
176 |
+
|
177 |
+
if ( $name == 'show_description_under_image' ) {
|
178 |
+
$attribute['is_storefront_api'] = true;
|
179 |
+
$value = !@$params[$name];
|
180 |
+
|
181 |
+
$layout = @$params['product_details_layout'];
|
182 |
+
if ( is_null( $layout ) ) {
|
183 |
+
$layout = $attributes['product_details_layout']['default'];
|
184 |
+
}
|
185 |
+
|
186 |
+
if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT' ) {
|
187 |
+
$name = 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar';
|
188 |
+
} else if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT' ) {
|
189 |
+
$name = 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar';
|
190 |
+
} else {
|
191 |
+
unset( $attribute['is_storefront_api'] );
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
if ( @$attribute['is_storefront_api'] ) {
|
196 |
+
|
197 |
if ( @$attribute['type'] == 'boolean') {
|
198 |
$result .= 'window.ec.storefront.' . $name . "=" . ( $value ? 'true' : 'false' ) . ";" . PHP_EOL;
|
199 |
} else {
|
201 |
}
|
202 |
}
|
203 |
}
|
204 |
+
|
205 |
+
|
206 |
$colors = array();
|
207 |
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
|
208 |
$color = @$params['chameleon_color_' . $kind];
|
261 |
return get_option( 'ecwid_plugin_version' );
|
262 |
}
|
263 |
|
264 |
+
protected function _get_attributes_for_editor() {
|
|
|
265 |
$api = new Ecwid_Api_V3();
|
266 |
+
|
267 |
if ( $api->is_available() && $api->get_store_profile() ) {
|
268 |
$settings = $api->get_store_profile()->designSettings;
|
269 |
} else {
|
270 |
$settings = new stdClass();
|
271 |
}
|
272 |
+
|
273 |
$attributes = Ecwid_Product_Browser::get_attributes();
|
274 |
+
$to_remove = array(
|
275 |
+
'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
276 |
+
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar'
|
277 |
+
);
|
278 |
+
foreach ( $to_remove as $name ) {
|
279 |
+
unset( $attributes[ $name ] );
|
280 |
+
}
|
281 |
+
|
282 |
+
$attributes['show_description_under_image'] = array(
|
283 |
+
'name' => 'show_description_under_image',
|
284 |
+
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
285 |
+
'default' => false,
|
286 |
+
'type' => 'boolean'
|
287 |
+
);
|
288 |
+
|
289 |
foreach ( $attributes as $key => $attribute ) {
|
290 |
$name = $attribute['name'];
|
291 |
+
|
292 |
+
$default = null;
|
293 |
if ( property_exists( $settings, $name ) ) {
|
294 |
+
$default = $settings->$name;
|
295 |
+
}
|
296 |
+
|
297 |
+
$prop_to_default_exceptions = array(
|
298 |
+
'product_list_category_image_aspect_ratio' => 'product_list_image_aspect_ratio',
|
299 |
+
'product_list_category_image_size' => 'product_list_image_size'
|
300 |
+
);
|
301 |
+
|
302 |
+
if ( array_key_exists( $name, $prop_to_default_exceptions ) ) {
|
303 |
+
$another_name = $prop_to_default_exceptions[ $name ];
|
304 |
+
if ( property_exists( $settings, $another_name ) ) {
|
305 |
+
$default = $settings->$another_name;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( $default !== null ) {
|
310 |
+
$attributes[ $key ]['default'] = $default;
|
311 |
}
|
312 |
}
|
313 |
+
|
314 |
$categories = ecwid_get_categories_for_selector();
|
315 |
+
|
316 |
if ( $categories ) {
|
317 |
$attributes['default_category_id']['values'] = array(
|
318 |
array(
|
327 |
);
|
328 |
}
|
329 |
} else {
|
330 |
+
$api = new Ecwid_Api_V3();
|
331 |
$cats = $api->get_categories( array() );
|
332 |
+
|
333 |
if ( $cats && $cats->total == 0 ) {
|
334 |
unset( $attributes['default_category_id'] );
|
335 |
}
|
336 |
}
|
337 |
+
|
338 |
+
$attributes['widgets'] = array( 'type' => 'string', 'default' => '', 'name' => 'widgets' );
|
339 |
+
|
340 |
+
return $attributes;
|
341 |
+
}
|
342 |
|
343 |
+
public static function get_store_block_data_from_current_page() {
|
344 |
|
345 |
+
if ( !function_exists( 'gutenberg_parse_blocks' ) ) {
|
346 |
+
return array();
|
347 |
+
}
|
348 |
+
|
349 |
+
$post = get_post();
|
350 |
+
$blocks = gutenberg_parse_blocks( $post->post_content );
|
351 |
+
|
352 |
+
$store_block = null;
|
353 |
+
foreach ( $blocks as $block ) {
|
354 |
+
if ( $block['blockName'] == self::STORE_BLOCK ) {
|
355 |
+
$store_block = $block;
|
356 |
+
break;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
if ( !$store_block ) return array();
|
361 |
+
|
362 |
+
return $store_block['atts'];
|
363 |
}
|
364 |
|
365 |
protected function _get_store_icon_path()
|
includes/themes.php
CHANGED
@@ -85,7 +85,8 @@ function ecwid_apply_theme($theme_name = null)
|
|
85 |
'Boundless',
|
86 |
'twentyseventeen',
|
87 |
'themify-music',
|
88 |
-
'Avada'
|
|
|
89 |
);
|
90 |
|
91 |
$custom_themes = apply_filters( 'ecwid_custom_themes', $custom_themes );
|
@@ -95,7 +96,7 @@ function ecwid_apply_theme($theme_name = null)
|
|
95 |
}
|
96 |
|
97 |
$theme_file = '';
|
98 |
-
|
99 |
if (function_exists('wp_get_theme') && wp_get_theme()->Name == 'ResponsiveBoat') {
|
100 |
$theme_name = 'responsiveboat';
|
101 |
}
|
85 |
'Boundless',
|
86 |
'twentyseventeen',
|
87 |
'themify-music',
|
88 |
+
'Avada',
|
89 |
+
'twentynineteen'
|
90 |
);
|
91 |
|
92 |
$custom_themes = apply_filters( 'ecwid_custom_themes', $custom_themes );
|
96 |
}
|
97 |
|
98 |
$theme_file = '';
|
99 |
+
|
100 |
if (function_exists('wp_get_theme') && wp_get_theme()->Name == 'ResponsiveBoat') {
|
101 |
$theme_name = 'responsiveboat';
|
102 |
}
|
includes/themes/class-ecwid-theme-twentynineteen.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
3 |
+
|
4 |
+
class Ecwid_Theme_2019 extends Ecwid_Theme_Base {
|
5 |
+
|
6 |
+
protected $name = 'twentynineteen';
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
add_filter( 'ecwid_shortcode_content', array( $this, 'filter_shortcode_content' ) );
|
12 |
+
}
|
13 |
+
|
14 |
+
public function filter_shortcode_content( $content ) {
|
15 |
+
return '<div>' . $content . '</div>';
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
$ecwid_current_theme = new Ecwid_Theme_2019();
|
includes/widgets/class-ecwid-widget-latest-products.php
CHANGED
@@ -17,6 +17,7 @@ class Ecwid_Widget_Latest_Products extends Ecwid_Widget_Products_List_Base {
|
|
17 |
protected function _get_products() {
|
18 |
$api = new Ecwid_Api_V3();
|
19 |
|
|
|
20 |
$result = $api->search_products(array(
|
21 |
'sortBy' => 'ADDED_TIME_DESC',
|
22 |
'limit' => $this->_instance['number_of_products']
|
17 |
protected function _get_products() {
|
18 |
$api = new Ecwid_Api_V3();
|
19 |
|
20 |
+
|
21 |
$result = $api->search_products(array(
|
22 |
'sortBy' => 'ADDED_TIME_DESC',
|
23 |
'limit' => $this->_instance['number_of_products']
|
includes/widgets/class-ecwid-widget-products-base.php
CHANGED
@@ -60,12 +60,12 @@ abstract class Ecwid_Widget_Products_List_Base extends Ecwid_Widget_Base {
|
|
60 |
function _render_widget_content( $args, $instance ) {
|
61 |
|
62 |
$this->_args = $args;
|
63 |
-
$this->_instance = $instance;
|
64 |
|
65 |
$html = '';
|
66 |
$html .= '<!-- noptimize -->' . ecwid_get_scriptjs_code() . '<!-- /noptimize -->';
|
67 |
|
68 |
-
$html .= '<div class="' . $this->_class_name . '" data-ecwid-max="' . $
|
69 |
|
70 |
$counter = 1;
|
71 |
$ids = array();
|
60 |
function _render_widget_content( $args, $instance ) {
|
61 |
|
62 |
$this->_args = $args;
|
63 |
+
$this->_instance = wp_parse_args( $instance, array( 'number_of_products' => $this->_default ) );
|
64 |
|
65 |
$html = '';
|
66 |
$html .= '<!-- noptimize -->' . ecwid_get_scriptjs_code() . '<!-- /noptimize -->';
|
67 |
|
68 |
+
$html .= '<div class="' . $this->_class_name . '" data-ecwid-max="' . $this->_instance['number_of_products'] . '">';
|
69 |
|
70 |
$counter = 1;
|
71 |
$ids = array();
|
js/gutenberg/blocks.build.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(n){if(l[n])return l[n].exports;var r=l[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var l={};t.m=e,t.c=l,t.d=function(e,l,n){t.o(e,l)||Object.defineProperty(e,l,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var l=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(l,"a",l),l},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l(1),l(5)},function(e,t,l){"use strict";function n(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var r=l(2),o=(l.n(r),l(3)),a=(l.n(o),l(4)),i=wp.i18n,c=i.__,s=(i._x,a.a,wp.blocks),m=(s.BlockControls,s.registerBlockType),p=wp.editor,u=(p.RichText,p.InspectorControls),d=(p.AlignmentToolbar,p.withColors,wp.components),w=d.PanelBody,h=d.PanelRow,g=d.ToggleControl,_=d.ButtonGroup,f=d.Button,E=(d.IconButton,d.BaseControl),v=d.Toolbar,y=(d.Dropdown,d.ColorPalette),b=d.ColorIndicator,x=wp.compose.withState;wp.element.Fragment;m("ecwid/store-block",{title:EcwidGutenbergParams.storeBlockTitle,icon:wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),category:"common",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Add storefront (product listing)","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t,l){return wp.element.createElement(g,{label:l,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function l(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(v,{controls:r.map(function(l){return{icon:a.a[l.icon],title:l.title,isActive:e.attributes[t]===l.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,l.value))}}})}))}function r(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement("select",{onChange:function(l){e.setAttributes(n({},t,l.target.value))}},r.map(function(l){return wp.element.createElement("option",{value:l.value,selected:e.attributes[t]==l.value},l.title)})))}function o(e,t,l){return wp.element.createElement(E,{label:l},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(l){e.setAttributes(n({},t,l.target.value))}}))}function i(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(_,null,r.map(function(l){return wp.element.createElement(f,{isDefault:!0,isButton:!0,isPrimary:C[t]==l.value,onClick:function(){return e.setAttributes(n({},t,l.value))}},l.title)})))}function s(e,t,l){var r=wp.element.createElement("span",null,l,wp.element.createElement(b,{colorValue:C[t]}));return wp.element.createElement(E,{label:r,className:"ec-store-color-picker"},wp.element.createElement(y,{value:C[t],colors:P,onChange:function(l){return e.setAttributes(n({},t,l))}}))}function m(e){function t(e){o(function(t){return{manual:"manual",color:e}}),i.setAttributes(n({},a,e))}var l=e.manual,r=e.color,o=e.setState,a=arguments[0].name,i=arguments[0].props,s=EcwidGutenbergStoreBlockParams.attributes[a].title,m=null===l&&null!==i.attributes[a]&&""!==i.attributes[a]||"manual"===l;m?null!==r&&i.setAttributes(n({},a,r)):i.setAttributes(n({},a,null));var p=i.attributes[a],u=wp.element.createElement("span",null,s,null!==p&&wp.element.createElement(b,{colorValue:C[a]}));return wp.element.createElement(E,{label:u,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return o(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!m},c("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:m},c("Set manually","ecwid-shopping-cart"))),m&&wp.element.createElement(y,{value:p,colors:P,onChange:t}))}function p(e){var t=e.count,l=e.setState;return wp.element.createElement("div",null,wp.element.createElement("button",{onClick:function(){return l(function(e){return{count:e.count+1}})}},"text ",t," ",arguments[0].color))}function d(e,t){return wp.element.createElement(E,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}function k(e,n,a){var c=EcwidGutenbergStoreBlockParams.attributes[n];return"undefined"===typeof a&&(a=c.type),"default_category_id"===a&&(a=c.values&&c.values.length>1?"select":"textbox"),"buttonGroup"===a?i(e,c.name,c.title,c.values):"toolbar"===a?l(e,c.name,c.title,c.values):"select"===a?r(e,c.name,c.title,c.values):"colorPalette"===a?s(e,c.name,c.title):"text"===a?d(c.title,c.message):"textbox"===a?o(e,c.name,c.title):t(e,c.name,c.title)}var C=e.attributes;e.setAttributes({widgets:""});var B=wp.element.createElement("div",{className:"ec-store-block ec-store-block-product-browser"},wp.element.createElement("div",{className:"ec-store-block-header"},wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),EcwidGutenbergParams.isDemoStore&&c("Demo store","ecwid-shopping-cart"),!EcwidGutenbergParams.isDemoStore&&EcwidGutenbergStoreBlockParams.storeBlockTitle),EcwidGutenbergParams.isDemoStore&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},c("Set up your store","ecwid-shopping-cart")))),P=[{name:c("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:c("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:c("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:c("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:c("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:c("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:c("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:c("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:c("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:c("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:c("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],S=x({manual:null,color:null})(m),G=(x({count:0})(p),d("",c('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"))),N=d(c("Display cart icon","ecwid-shopping-cart"),EcwidGutenbergParams.customizeMinicartText),O=(d("",c('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")),EcwidGutenbergStoreBlockParams.is_new_product_list),z=EcwidGutenbergStoreBlockParams.is_new_details_page,L=EcwidGutenbergStoreBlockParams.attributes.default_category_id&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values.length>0;return[B,wp.element.createElement(u,null,L&&wp.element.createElement(w,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&k(e,"product_list_category_title_behavior","select"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&k(e,"product_list_category_image_size","buttonGroup"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&k(e,"product_list_category_image_aspect_ratio","toolbar"),!O&&G),wp.element.createElement(w,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},z&&k(e,"product_details_layout","select"),z&&"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===C.product_details_layout&&k(e,"product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar","toogle"),z&&"TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===C.product_details_layout&&k(e,"product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar","toogle"),z&&k(e,"product_details_gallery_layout","toolbar"),z&&wp.element.createElement(h,null,wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Product sidebar content","ecwid-shopping-cart"))),z&&k(e,"product_details_show_product_name","toggle"),z&&k(e,"product_details_show_breadcrumbs","toggle"),z&&k(e,"product_details_show_product_sku","toggle"),z&&k(e,"product_details_show_product_price","toggle"),z&&k(e,"product_details_show_qty","toggle"),z&&k(e,"product_details_show_number_of_items_in_stock","toggle"),z&&k(e,"product_details_show_in_stock_label","toggle"),z&&k(e,"product_details_show_wholesale_prices","toggle"),z&&k(e,"product_details_show_share_buttons","toggle"),!z&&G),wp.element.createElement(w,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&k(e,"product_list_show_product_images","toggle"),O&&C.product_list_show_product_images&&k(e,"product_list_image_size","buttonGroup"),O&&C.product_list_show_product_images&&k(e,"product_list_image_aspect_ratio","toolbar"),O&&k(e,"product_list_product_info_layout","toolbar"),O&&k(e,"product_list_title_behavior","select"),O&&k(e,"product_list_price_behavior","select"),O&&k(e,"product_list_sku_behavior","select"),O&&k(e,"product_list_buybutton_behavior","select"),O&&k(e,"product_list_show_additional_image_on_hover","toggle"),O&&k(e,"product_list_show_frame","toggle"),!O&&G),wp.element.createElement(w,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},k(e,"show_categories","toggle"),k(e,"show_search","toggle"),k(e,"show_breadcrumbs","toggle"),O&&k(e,"show_footer_menu","toggle"),k(e,"show_signin_link","toggle"),k(e,"product_list_show_sort_viewas_options","toggle"),N),L&&wp.element.createElement(w,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},k(e,"default_category_id","default_category_id")),wp.element.createElement(w,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},wp.element.createElement(S,{props:e,name:"chameleon_color_button"}),wp.element.createElement(S,{props:e,name:"chameleon_color_foreground"}),wp.element.createElement(S,{props:e,name:"chameleon_color_price"}),wp.element.createElement(S,{props:e,name:"chameleon_color_link"}),wp.element.createElement(S,{props:e,name:"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 l={widgets:t.join(" "),default_category_id:e.attributes.default_category_id};return new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:l,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={},l=["widgets","default_category_id"],n=0;n<l.length;n++)t[l[n]]=e.attributes[l[n]];return t.default_product_id=0,new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}}],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,l){"use strict";l.d(t,"a",function(){return n});var n={store:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#555d66",d:"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 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 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 C11.95,5.4,12.41,4.94,12.97,4.94z M12.97,8.02c0.57,0,1.03,0.46,1.03,1.03c0,0.57-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C11.95,8.48,12.41,8.02,12.97,8.02z M9.98,4.94c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,5.4,9.41,4.94,9.98,4.94z M9.98,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,8.48,9.41,8.02,9.98,8.02z M7.03,4.94c0.57,0,1.03,0.46,1.03,1.03S7.6,6.99,7.03,6.99C6.46,6.99,6,6.53,6,5.96 C6,5.4,6.46,4.94,7.03,4.94z M7.03,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03C6.46,10.08,6,9.62,6,9.05 C6,8.48,6.46,8.02,7.03,8.02z M4.6,18.02c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C6.45,17.19,5.62,18.02,4.6,18.02z M15.32,18.1c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C17.17,17.27,16.34,18.1,15.32,18.1z M18.48,2.79l-1.92,7.14c-0.51,1.91-2.03,3.1-4,3.1H7.2c-1.91,0-3.26-1.09-3.84-2.91L1.73,5 C1.7,4.9,1.72,4.79,1.78,4.71c0.06-0.09,0.16-0.14,0.27-0.14l0.31,0c0.75,0,1.41,0.49,1.64,1.2l1.2,3.76 c0.32,1.02,1.26,1.7,2.33,1.7h4.81c1.1,0,2.08-0.74,2.36-1.81l1.55-5.78c0.2-0.75,0.89-1.28,1.67-1.28h0.24 c0.1,0,0.2,0.05,0.26,0.13C18.48,2.58,18.5,2.68,18.48,2.79z M4.6,15.5c-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 S4.96,15.5,4.6,15.5z"})),product:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#231F20",d:"M16.43,5.12c-0.13-1.19-0.15-1.19-1.35-1.33c-0.21-0.02-0.21-0.02-0.43-0.05c-0.01,0.06,0.06,0.78,0.14,1.13 c0.57,0.37,0.87,0.98,0.87,1.71c0,1.14-0.93,2.07-2.07,2.07s-2.07-0.93-2.07-2.07c0-0.54,0.09-0.97,0.55-1.4 c-0.06-0.61-0.19-1.54-0.18-1.64C10.14,3.46,8.72,3.46,8.58,3.6l-8.17,8.13c-0.56,0.55-0.56,1.43,0,1.97l5.54,5.93 c0.56,0.55,1.46,0.55,2.01,0l8.67-8.14C17.04,11.09,16.68,7.14,16.43,5.12z M16.06,0.04c-1.91,0-3.46,1.53-3.46,3.41c0,0.74,0.4,3.09,0.44,3.28c0.07,0.34,0.52,0.56,0.86,0.49 C14,7.19,14.07,7.15,14.12,7.1c0.24-0.11,0.32-0.39,0.25-0.68c-0.09-0.45-0.39-2.44-0.39-2.94c0-1.16,0.94-2.09,2.11-2.09 c1.24,0,2.11,0.96,2.11,2.34c0,2.43-0.31,4.23-0.32,4.26c-0.1,0.17-0.1,0.38-0.03,0.55c0.03,0.17,0.13,0.31,0.28,0.4 c0.1,0.06,0.22,0.09,0.33,0.09c0.21,0,0.42-0.1,0.54-0.3c0.06-0.09,0.52-2.17,0.52-5.03C19.52,1.61,18.04,0.04,16.06,0.04z"})),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"})))),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(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"})))),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(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"}))))}},function(e,t,l){"use strict";var n=l(6),r=(l.n(n),l(7)),o=(l.n(r),wp.i18n.__);(0,wp.blocks.registerBlockType)("cgb/block-my-block2",{title:o("my-block - CGB Block"),icon:"shield",category:"common",keywords:[o("my-block \u2014 CGB Block"),o("CGB Example"),o("create-guten-block")],edit:function(e){return wp.element.createElement("div",{className:e.className},wp.element.createElement("p",null,"\u2014 Hello from the backend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block"),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))},save:function(e){return wp.element.createElement("div",null,wp.element.createElement("p",null,"\u2014 Hello from the frontend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block."),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))}})},function(e,t){},function(e,t){}]);
|
1 |
+
!function(e){function t(n){if(l[n])return l[n].exports;var r=l[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var l={};t.m=e,t.c=l,t.d=function(e,l,n){t.o(e,l)||Object.defineProperty(e,l,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var l=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(l,"a",l),l},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l(1),l(5)},function(e,t,l){"use strict";function n(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var r=l(2),o=(l.n(r),l(3)),a=(l.n(o),l(4)),i=wp.i18n,c=i.__,s=(i._x,a.a,wp.blocks),m=(s.BlockControls,s.registerBlockType),p=wp.editor,u=p.InspectorControls,d=(p.AlignmentToolbar,p.withColors,wp.components),w=d.PanelBody,h=d.PanelRow,g=d.ToggleControl,_=d.ButtonGroup,f=d.Button,E=(d.IconButton,d.BaseControl),v=d.Toolbar,y=(d.Dropdown,d.ColorPalette),b=d.ColorIndicator,x=wp.compose.withState;wp.element.Fragment;m("ecwid/store-block",{title:EcwidGutenbergParams.storeBlockTitle,icon:wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),category:"common",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Add storefront (product listing)","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t,l){return wp.element.createElement(g,{label:l,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function l(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(v,{controls:r.map(function(l){return{icon:a.a[l.icon],title:l.title,isActive:e.attributes[t]===l.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,l.value))}}})}))}function r(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement("select",{onChange:function(l){e.setAttributes(n({},t,l.target.value))}},r.map(function(l){return wp.element.createElement("option",{value:l.value,selected:e.attributes[t]==l.value},l.title)})))}function o(e,t,l){return wp.element.createElement(E,{label:l},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(l){e.setAttributes(n({},t,l.target.value))}}))}function i(e,t,l,r){return wp.element.createElement(E,{label:l},wp.element.createElement(_,null,r.map(function(l){return wp.element.createElement(f,{isDefault:!0,isButton:!0,isPrimary:C[t]==l.value,onClick:function(){return e.setAttributes(n({},t,l.value))}},l.title)})))}function s(e,t){return wp.element.createElement(E,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}function m(e,n,a){var c=EcwidGutenbergStoreBlockParams.attributes[n];return"undefined"===typeof a&&(a=c.type),"default_category_id"===a&&(a=c.values&&c.values.length>1?"select":"textbox"),"buttonGroup"===a?i(e,c.name,c.title,c.values):"toolbar"===a?l(e,c.name,c.title,c.values):"select"===a?r(e,c.name,c.title,c.values):"colorPalette"===a?p(e,c.name,c.title):"text"===a?s(c.title,c.message):"textbox"===a?o(e,c.name,c.title):t(e,c.name,c.title)}function p(e,t,l){var r=wp.element.createElement("span",null,l,wp.element.createElement(b,{colorValue:C[t]}));return wp.element.createElement(E,{label:r,className:"ec-store-color-picker"},wp.element.createElement(y,{value:C[t],colors:P,onChange:function(l){return e.setAttributes(n({},t,l))}}))}function d(e){function t(e){o(function(t){return{manual:"manual",color:e}}),i.setAttributes(n({},a,e))}var l=e.manual,r=e.color,o=e.setState,a=arguments[0].name,i=arguments[0].props,s=EcwidGutenbergStoreBlockParams.attributes[a].title,m=null===l&&null!==i.attributes[a]&&""!==i.attributes[a]||"manual"===l;m?null!==r&&i.setAttributes(n({},a,r)):i.setAttributes(n({},a,null));var p=i.attributes[a],u=wp.element.createElement("span",null,s,null!==p&&wp.element.createElement(b,{colorValue:C[a]}));return wp.element.createElement(E,{label:u,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return o(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!m},c("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:m},c("Set manually","ecwid-shopping-cart"))),m&&wp.element.createElement(y,{value:p,colors:P,onChange:t}))}function k(e){var t=e.count,l=e.setState;return wp.element.createElement("div",null,wp.element.createElement("button",{onClick:function(){return l(function(e){return{count:e.count+1}})}},"text ",t," ",arguments[0].color))}var C=e.attributes;e.setAttributes({widgets:""});var B=wp.element.createElement("div",{className:"ec-store-block ec-store-block-product-browser"},wp.element.createElement("div",{className:"ec-store-block-header"},wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.storeIcon})),EcwidGutenbergParams.isDemoStore&&c("Demo store","ecwid-shopping-cart"),!EcwidGutenbergParams.isDemoStore&&EcwidGutenbergStoreBlockParams.storeBlockTitle),EcwidGutenbergParams.isDemoStore&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},c("Set up your store","ecwid-shopping-cart")))),P=[{name:c("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:c("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:c("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:c("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:c("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:c("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:c("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:c("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:c("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:c("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:c("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],S=x({manual:null,color:null})(d),G=(x({count:0})(k),s("",c('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"))),N=s(c("Display cart icon","ecwid-shopping-cart"),EcwidGutenbergParams.customizeMinicartText),O=(s("",c('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")),EcwidGutenbergStoreBlockParams.is_new_product_list),z=EcwidGutenbergStoreBlockParams.is_new_details_page,L=EcwidGutenbergStoreBlockParams.attributes.default_category_id&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values.length>0;return[B,wp.element.createElement(u,null,L&&wp.element.createElement(w,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&m(e,"product_list_category_title_behavior","select"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&m(e,"product_list_category_image_size","buttonGroup"),O&&"SHOW_TEXT_ONLY"!==C.product_list_category_title_behavior&&m(e,"product_list_category_image_aspect_ratio","toolbar"),!O&&G),wp.element.createElement(w,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&m(e,"product_list_show_product_images","toggle"),O&&C.product_list_show_product_images&&m(e,"product_list_image_size","buttonGroup"),O&&C.product_list_show_product_images&&m(e,"product_list_image_aspect_ratio","toolbar"),O&&m(e,"product_list_product_info_layout","toolbar"),O&&m(e,"product_list_title_behavior","select"),O&&m(e,"product_list_price_behavior","select"),O&&m(e,"product_list_sku_behavior","select"),O&&m(e,"product_list_buybutton_behavior","select"),O&&m(e,"product_list_show_additional_image_on_hover","toggle"),O&&m(e,"product_list_show_frame","toggle"),!O&&G),wp.element.createElement(w,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},z&&m(e,"product_details_layout","select"),z&&("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"==C.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"==C.product_details_layout)&&m(e,"show_description_under_image","toggle"),z&&m(e,"product_details_gallery_layout","toolbar"),z&&wp.element.createElement(h,null,wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Product sidebar content","ecwid-shopping-cart"))),z&&m(e,"product_details_show_product_name","toggle"),z&&m(e,"product_details_show_breadcrumbs","toggle"),z&&m(e,"product_details_show_product_sku","toggle"),z&&m(e,"product_details_show_product_price","toggle"),z&&m(e,"product_details_show_qty","toggle"),z&&m(e,"product_details_show_number_of_items_in_stock","toggle"),z&&m(e,"product_details_show_in_stock_label","toggle"),z&&m(e,"product_details_show_wholesale_prices","toggle"),z&&m(e,"product_details_show_share_buttons","toggle"),!z&&G),L&&wp.element.createElement(w,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},m(e,"default_category_id","default_category_id")),wp.element.createElement(w,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},m(e,"show_categories","toggle"),m(e,"show_search","toggle"),m(e,"show_breadcrumbs","toggle"),O&&m(e,"show_footer_menu","toggle"),m(e,"show_signin_link","toggle"),m(e,"product_list_show_sort_viewas_options","toggle"),N),wp.element.createElement(w,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},wp.element.createElement(S,{props:e,name:"chameleon_color_button"}),wp.element.createElement(S,{props:e,name:"chameleon_color_foreground"}),wp.element.createElement(S,{props:e,name:"chameleon_color_price"}),wp.element.createElement(S,{props:e,name:"chameleon_color_link"}),wp.element.createElement(S,{props:e,name:"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 l={widgets:t.join(" "),default_category_id:e.attributes.default_category_id};return new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:l,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={},l=["widgets","default_category_id"],n=0;n<l.length;n++)t[l[n]]=e.attributes[l[n]];return t.default_product_id=0,new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,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"]'}}],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,l){"use strict";l.d(t,"a",function(){return n});var n={store:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#555d66",d:"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 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 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 C11.95,5.4,12.41,4.94,12.97,4.94z M12.97,8.02c0.57,0,1.03,0.46,1.03,1.03c0,0.57-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C11.95,8.48,12.41,8.02,12.97,8.02z M9.98,4.94c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,5.4,9.41,4.94,9.98,4.94z M9.98,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03c-0.57,0-1.03-0.46-1.03-1.03 C8.95,8.48,9.41,8.02,9.98,8.02z M7.03,4.94c0.57,0,1.03,0.46,1.03,1.03S7.6,6.99,7.03,6.99C6.46,6.99,6,6.53,6,5.96 C6,5.4,6.46,4.94,7.03,4.94z M7.03,8.02c0.57,0,1.03,0.46,1.03,1.03s-0.46,1.03-1.03,1.03C6.46,10.08,6,9.62,6,9.05 C6,8.48,6.46,8.02,7.03,8.02z M4.6,18.02c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C6.45,17.19,5.62,18.02,4.6,18.02z M15.32,18.1c-1.02,0-1.86-0.83-1.86-1.86c0-1.03,0.83-1.86,1.86-1.86c1.03,0,1.86,0.83,1.86,1.86 C17.17,17.27,16.34,18.1,15.32,18.1z M18.48,2.79l-1.92,7.14c-0.51,1.91-2.03,3.1-4,3.1H7.2c-1.91,0-3.26-1.09-3.84-2.91L1.73,5 C1.7,4.9,1.72,4.79,1.78,4.71c0.06-0.09,0.16-0.14,0.27-0.14l0.31,0c0.75,0,1.41,0.49,1.64,1.2l1.2,3.76 c0.32,1.02,1.26,1.7,2.33,1.7h4.81c1.1,0,2.08-0.74,2.36-1.81l1.55-5.78c0.2-0.75,0.89-1.28,1.67-1.28h0.24 c0.1,0,0.2,0.05,0.26,0.13C18.48,2.58,18.5,2.68,18.48,2.79z M4.6,15.5c-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 S4.96,15.5,4.6,15.5z"})),product:wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20"},wp.element.createElement("path",{fill:"#231F20",d:"M16.43,5.12c-0.13-1.19-0.15-1.19-1.35-1.33c-0.21-0.02-0.21-0.02-0.43-0.05c-0.01,0.06,0.06,0.78,0.14,1.13 c0.57,0.37,0.87,0.98,0.87,1.71c0,1.14-0.93,2.07-2.07,2.07s-2.07-0.93-2.07-2.07c0-0.54,0.09-0.97,0.55-1.4 c-0.06-0.61-0.19-1.54-0.18-1.64C10.14,3.46,8.72,3.46,8.58,3.6l-8.17,8.13c-0.56,0.55-0.56,1.43,0,1.97l5.54,5.93 c0.56,0.55,1.46,0.55,2.01,0l8.67-8.14C17.04,11.09,16.68,7.14,16.43,5.12z M16.06,0.04c-1.91,0-3.46,1.53-3.46,3.41c0,0.74,0.4,3.09,0.44,3.28c0.07,0.34,0.52,0.56,0.86,0.49 C14,7.19,14.07,7.15,14.12,7.1c0.24-0.11,0.32-0.39,0.25-0.68c-0.09-0.45-0.39-2.44-0.39-2.94c0-1.16,0.94-2.09,2.11-2.09 c1.24,0,2.11,0.96,2.11,2.34c0,2.43-0.31,4.23-0.32,4.26c-0.1,0.17-0.1,0.38-0.03,0.55c0.03,0.17,0.13,0.31,0.28,0.4 c0.1,0.06,0.22,0.09,0.33,0.09c0.21,0,0.42-0.1,0.54-0.3c0.06-0.09,0.52-2.17,0.52-5.03C19.52,1.61,18.04,0.04,16.06,0.04z"})),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"})))),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(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"})))),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(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"}))))}},function(e,t,l){"use strict";var n=l(6),r=(l.n(n),l(7)),o=(l.n(r),wp.i18n.__);(0,wp.blocks.registerBlockType)("cgb/block-my-block2",{title:o("my-block - CGB Block"),icon:"shield",category:"common",keywords:[o("my-block \u2014 CGB Block"),o("CGB Example"),o("create-guten-block")],edit:function(e){return wp.element.createElement("div",{className:e.className},wp.element.createElement("p",null,"\u2014 Hello from the backend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block"),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))},save:function(e){return wp.element.createElement("div",null,wp.element.createElement("p",null,"\u2014 Hello from the frontend."),wp.element.createElement("p",null,"CGB BLOCK: ",wp.element.createElement("code",null,"my-block")," is a new Gutenberg block."),wp.element.createElement("p",null,"It was created via"," ",wp.element.createElement("code",null,wp.element.createElement("a",{href:"https://github.com/ahmadawais/create-guten-block"},"create-guten-block")),"."))}})},function(e,t){},function(e,t){}]);
|
js/gutenberg/store.jsx
CHANGED
@@ -20,7 +20,6 @@ const {
|
|
20 |
} = wp.blocks;
|
21 |
|
22 |
const {
|
23 |
-
RichText,
|
24 |
InspectorControls,
|
25 |
AlignmentToolbar,
|
26 |
withColors
|
@@ -114,7 +113,7 @@ registerBlockType( 'ecwid/store-block', {
|
|
114 |
onChange={ () => props.setAttributes( { [name]: ! props.attributes[name] } ) }
|
115 |
/>
|
116 |
}
|
117 |
-
|
118 |
function buildToolbar(props, name, label, items) {
|
119 |
return <BaseControl label={label}>
|
120 |
<Toolbar
|
@@ -161,8 +160,46 @@ registerBlockType( 'ecwid/store-block', {
|
|
161 |
</ButtonGroup>
|
162 |
</BaseControl>;
|
163 |
}
|
164 |
-
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
name: __("Pale pink"),
|
167 |
slug: "pale-pink",
|
168 |
color: "#f78da7"
|
@@ -272,45 +309,7 @@ registerBlockType( 'ecwid/store-block', {
|
|
272 |
}
|
273 |
|
274 |
const Counter = withState( {count:0 } ) (simpleState);
|
275 |
-
|
276 |
|
277 |
-
function buildDangerousHTMLMessageWithTitle(title, message) {
|
278 |
-
return <BaseControl label={title}><div dangerouslySetInnerHTML={{ __html: message }} /></BaseControl>;
|
279 |
-
}
|
280 |
-
|
281 |
-
function buildItem(props, name, type) {
|
282 |
-
|
283 |
-
const item = EcwidGutenbergStoreBlockParams.attributes[name];
|
284 |
-
|
285 |
-
if ( typeof type === 'undefined' ) {
|
286 |
-
type = item.type;
|
287 |
-
}
|
288 |
-
|
289 |
-
if ( type === 'default_category_id' ) {
|
290 |
-
if ( item.values && item.values.length > 1 ) {
|
291 |
-
type = 'select';
|
292 |
-
} else {
|
293 |
-
type = 'textbox';
|
294 |
-
}
|
295 |
-
}
|
296 |
-
|
297 |
-
if ( type === 'buttonGroup' ) {
|
298 |
-
return buildButtonGroup( props, item.name, item.title, item.values );
|
299 |
-
} else if ( type === 'toolbar' ) {
|
300 |
-
return buildToolbar( props, item.name, item.title, item.values );
|
301 |
-
} else if ( type === 'select' ) {
|
302 |
-
return buildSelect( props, item.name, item.title, item.values );
|
303 |
-
} else if ( type === 'colorPalette' ) {
|
304 |
-
return buildColorPalette( props, item.name, item.title );
|
305 |
-
} else if ( type === 'text' ) {
|
306 |
-
return buildDangerousHTMLMessageWithTitle( item.title, item.message );
|
307 |
-
} else if ( type === 'textbox') {
|
308 |
-
return buildTextbox( props, item.name, item.title );
|
309 |
-
} else {
|
310 |
-
return buildToggle( props, item.name, item.title );
|
311 |
-
}
|
312 |
-
}
|
313 |
-
|
314 |
const productMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
315 |
'',
|
316 |
__( 'To improve the look and feel of your store and manage your storefront appearance here, please enable the “Next-gen look and feel of the product list on the storefront” option in your store dashboard (“<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings → What’s New</a>”).', 'ecwid-shopping-cart' )
|
@@ -346,15 +345,30 @@ registerBlockType( 'ecwid/store-block', {
|
|
346 |
</PanelBody>
|
347 |
|
348 |
}
|
349 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
<PanelBody title={ __( 'Product Page Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
351 |
|
352 |
{ isNewDetailsPage && buildItem( props, 'product_details_layout', 'select' ) }
|
353 |
-
{
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
358 |
}
|
359 |
{ isNewDetailsPage && buildItem( props, 'product_details_gallery_layout', 'toolbar' ) }
|
360 |
{ isNewDetailsPage &&
|
@@ -373,37 +387,22 @@ registerBlockType( 'ecwid/store-block', {
|
|
373 |
{ isNewDetailsPage && buildItem( props, 'product_details_show_share_buttons', 'toggle' ) }
|
374 |
{ !isNewDetailsPage && productMigrationWarning }
|
375 |
</PanelBody>
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
buildItem(
|
380 |
-
{ isNewProductList && attributes.product_list_show_product_images &&
|
381 |
-
buildItem( props, 'product_list_image_aspect_ratio', 'toolbar' ) }
|
382 |
-
{ isNewProductList && buildItem( props, 'product_list_product_info_layout', 'toolbar' ) }
|
383 |
-
{ isNewProductList && buildItem( props, 'product_list_title_behavior', 'select' ) }
|
384 |
-
{ isNewProductList && buildItem( props, 'product_list_price_behavior', 'select' ) }
|
385 |
-
{ isNewProductList && buildItem( props, 'product_list_sku_behavior', 'select' ) }
|
386 |
-
{ isNewProductList && buildItem( props, 'product_list_buybutton_behavior', 'select' ) }
|
387 |
-
{ isNewProductList && buildItem( props, 'product_list_show_additional_image_on_hover', 'toggle' ) }
|
388 |
-
{ isNewProductList && buildItem( props, 'product_list_show_frame', 'toggle' ) }
|
389 |
-
{ !isNewProductList && productMigrationWarning }
|
390 |
</PanelBody>
|
|
|
|
|
391 |
<PanelBody title={ __( 'Store Navigation', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
392 |
-
|
393 |
{ buildItem( props, 'show_search', 'toggle' ) }
|
394 |
{ buildItem( props, 'show_breadcrumbs', 'toggle' ) }
|
395 |
{ isNewProductList && buildItem( props, 'show_footer_menu', 'toggle' ) }
|
396 |
{ buildItem( props, 'show_signin_link', 'toggle' ) }
|
397 |
{ buildItem( props, 'product_list_show_sort_viewas_options', 'toggle' ) }
|
398 |
{ cartIconMessage }
|
399 |
-
</PanelBody>
|
400 |
-
{ hasCategories &&
|
401 |
-
|
402 |
-
<PanelBody title={ __('Store Front Page', 'ecwid-shopping-cart') } initialOpen={false}>
|
403 |
-
{ buildItem(props, 'default_category_id', 'default_category_id') }
|
404 |
</PanelBody>
|
405 |
-
|
406 |
-
}
|
407 |
<PanelBody title={ __( 'Color settings', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
408 |
<ChameleonColorControl props={props} name="chameleon_color_button" />
|
409 |
<ChameleonColorControl props={props} name="chameleon_color_foreground" />
|
@@ -481,7 +480,7 @@ registerBlockType( 'ecwid/store-block', {
|
|
481 |
'attrs': shortcodeAttributes,
|
482 |
'type': 'single'
|
483 |
});
|
484 |
-
|
485 |
return shortcode.string();
|
486 |
},
|
487 |
},
|
@@ -490,6 +489,11 @@ registerBlockType( 'ecwid/store-block', {
|
|
490 |
return '[ecwid]';
|
491 |
},
|
492 |
},
|
|
|
|
|
|
|
|
|
|
|
493 |
],
|
494 |
|
495 |
transforms: {
|
20 |
} = wp.blocks;
|
21 |
|
22 |
const {
|
|
|
23 |
InspectorControls,
|
24 |
AlignmentToolbar,
|
25 |
withColors
|
113 |
onChange={ () => props.setAttributes( { [name]: ! props.attributes[name] } ) }
|
114 |
/>
|
115 |
}
|
116 |
+
|
117 |
function buildToolbar(props, name, label, items) {
|
118 |
return <BaseControl label={label}>
|
119 |
<Toolbar
|
160 |
</ButtonGroup>
|
161 |
</BaseControl>;
|
162 |
}
|
163 |
+
|
164 |
+
|
165 |
+
function buildDangerousHTMLMessageWithTitle(title, message) {
|
166 |
+
return <BaseControl label={title}><div dangerouslySetInnerHTML={{ __html: message }} /></BaseControl>;
|
167 |
+
}
|
168 |
+
|
169 |
+
function buildItem(props, name, type) {
|
170 |
+
|
171 |
+
const item = EcwidGutenbergStoreBlockParams.attributes[name];
|
172 |
+
|
173 |
+
if ( typeof type === 'undefined' ) {
|
174 |
+
type = item.type;
|
175 |
+
}
|
176 |
+
|
177 |
+
if ( type === 'default_category_id' ) {
|
178 |
+
if ( item.values && item.values.length > 1 ) {
|
179 |
+
type = 'select';
|
180 |
+
} else {
|
181 |
+
type = 'textbox';
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( type === 'buttonGroup' ) {
|
186 |
+
return buildButtonGroup( props, item.name, item.title, item.values );
|
187 |
+
} else if ( type === 'toolbar' ) {
|
188 |
+
return buildToolbar( props, item.name, item.title, item.values );
|
189 |
+
} else if ( type === 'select' ) {
|
190 |
+
return buildSelect( props, item.name, item.title, item.values );
|
191 |
+
} else if ( type === 'colorPalette' ) {
|
192 |
+
return buildColorPalette( props, item.name, item.title );
|
193 |
+
} else if ( type === 'text' ) {
|
194 |
+
return buildDangerousHTMLMessageWithTitle( item.title, item.message );
|
195 |
+
} else if ( type === 'textbox') {
|
196 |
+
return buildTextbox( props, item.name, item.title );
|
197 |
+
} else {
|
198 |
+
return buildToggle( props, item.name, item.title );
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
const colors = [{
|
203 |
name: __("Pale pink"),
|
204 |
slug: "pale-pink",
|
205 |
color: "#f78da7"
|
309 |
}
|
310 |
|
311 |
const Counter = withState( {count:0 } ) (simpleState);
|
|
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
const productMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
314 |
'',
|
315 |
__( 'To improve the look and feel of your store and manage your storefront appearance here, please enable the “Next-gen look and feel of the product list on the storefront” option in your store dashboard (“<a href="admin.php?page=ec-store&ec-store-page=whatsnew">Settings → What’s New</a>”).', 'ecwid-shopping-cart' )
|
345 |
</PanelBody>
|
346 |
|
347 |
}
|
348 |
+
<PanelBody title={ __( 'Product List Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
349 |
+
{ isNewProductList && buildItem( props, 'product_list_show_product_images', 'toggle' ) }
|
350 |
+
{ isNewProductList && attributes.product_list_show_product_images &&
|
351 |
+
buildItem( props, 'product_list_image_size', 'buttonGroup' ) }
|
352 |
+
{ isNewProductList && attributes.product_list_show_product_images &&
|
353 |
+
buildItem( props, 'product_list_image_aspect_ratio', 'toolbar' ) }
|
354 |
+
{ isNewProductList && buildItem( props, 'product_list_product_info_layout', 'toolbar' ) }
|
355 |
+
{ isNewProductList && buildItem( props, 'product_list_title_behavior', 'select' ) }
|
356 |
+
{ isNewProductList && buildItem( props, 'product_list_price_behavior', 'select' ) }
|
357 |
+
{ isNewProductList && buildItem( props, 'product_list_sku_behavior', 'select' ) }
|
358 |
+
{ isNewProductList && buildItem( props, 'product_list_buybutton_behavior', 'select' ) }
|
359 |
+
{ isNewProductList && buildItem( props, 'product_list_show_additional_image_on_hover', 'toggle' ) }
|
360 |
+
{ isNewProductList && buildItem( props, 'product_list_show_frame', 'toggle' ) }
|
361 |
+
{ !isNewProductList && productMigrationWarning }
|
362 |
+
</PanelBody>
|
363 |
<PanelBody title={ __( 'Product Page Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
364 |
|
365 |
{ isNewDetailsPage && buildItem( props, 'product_details_layout', 'select' ) }
|
366 |
+
{
|
367 |
+
isNewDetailsPage
|
368 |
+
&& (
|
369 |
+
attributes.product_details_layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT'
|
370 |
+
|| attributes.product_details_layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT'
|
371 |
+
) && buildItem( props, 'show_description_under_image', 'toggle' )
|
372 |
}
|
373 |
{ isNewDetailsPage && buildItem( props, 'product_details_gallery_layout', 'toolbar' ) }
|
374 |
{ isNewDetailsPage &&
|
387 |
{ isNewDetailsPage && buildItem( props, 'product_details_show_share_buttons', 'toggle' ) }
|
388 |
{ !isNewDetailsPage && productMigrationWarning }
|
389 |
</PanelBody>
|
390 |
+
{ hasCategories &&
|
391 |
+
|
392 |
+
<PanelBody title={ __('Store Front Page', 'ecwid-shopping-cart') } initialOpen={false}>
|
393 |
+
{ buildItem(props, 'default_category_id', 'default_category_id') }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
</PanelBody>
|
395 |
+
|
396 |
+
}
|
397 |
<PanelBody title={ __( 'Store Navigation', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
398 |
+
{ buildItem( props, 'show_categories', 'toggle' ) }
|
399 |
{ buildItem( props, 'show_search', 'toggle' ) }
|
400 |
{ buildItem( props, 'show_breadcrumbs', 'toggle' ) }
|
401 |
{ isNewProductList && buildItem( props, 'show_footer_menu', 'toggle' ) }
|
402 |
{ buildItem( props, 'show_signin_link', 'toggle' ) }
|
403 |
{ buildItem( props, 'product_list_show_sort_viewas_options', 'toggle' ) }
|
404 |
{ cartIconMessage }
|
|
|
|
|
|
|
|
|
|
|
405 |
</PanelBody>
|
|
|
|
|
406 |
<PanelBody title={ __( 'Color settings', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
407 |
<ChameleonColorControl props={props} name="chameleon_color_button" />
|
408 |
<ChameleonColorControl props={props} name="chameleon_color_foreground" />
|
480 |
'attrs': shortcodeAttributes,
|
481 |
'type': 'single'
|
482 |
});
|
483 |
+
|
484 |
return shortcode.string();
|
485 |
},
|
486 |
},
|
489 |
return '[ecwid]';
|
490 |
},
|
491 |
},
|
492 |
+
{
|
493 |
+
save: function( props ) {
|
494 |
+
return '[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]';
|
495 |
+
},
|
496 |
+
},
|
497 |
],
|
498 |
|
499 |
transforms: {
|
lib/ecwid_catalog.php
CHANGED
@@ -75,7 +75,7 @@ class EcwidCatalog
|
|
75 |
|
76 |
return (object) array(
|
77 |
'product' => $product,
|
78 |
-
'formats' =>
|
79 |
);
|
80 |
}
|
81 |
|
@@ -118,7 +118,7 @@ class EcwidCatalog
|
|
118 |
'main_category' => $main_category,
|
119 |
'categories' => $categories->items,
|
120 |
'products' => $products->items,
|
121 |
-
'formats' =>
|
122 |
);
|
123 |
}
|
124 |
|
75 |
|
76 |
return (object) array(
|
77 |
'product' => $product,
|
78 |
+
'formats' => @$profile->formatsAndUnits
|
79 |
);
|
80 |
}
|
81 |
|
118 |
'main_category' => $main_category,
|
119 |
'categories' => $categories->items,
|
120 |
'products' => $products->items,
|
121 |
+
'formats' => @$profile->formatsAndUnits
|
122 |
);
|
123 |
}
|
124 |
|
readme.txt
CHANGED
@@ -3,21 +3,20 @@ Contributors: Ecwid
|
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 6.4
|
7 |
|
8 |
-
Powerful, easy to use ecommerce shopping cart.
|
9 |
|
10 |
== Description ==
|
11 |
-
Ecwid Ecommerce Shopping Cart is
|
12 |
-
|
13 |
|
14 |
= Automatic Shipping and Taxes =
|
15 |
|
16 |
The Ecwid ecommerce plugin integrates with major carriers including USPS, UPS, FedEx, Canada Post, Australia Post, and others to automatically calculate shipping rates. Taxes are also automated and can be set-up in a few clicks. Automated tax rate calculations are available for the U.S., Canada, and EU VAT. Additionally, integration with TaxJar provides automatic sales tax reporting and filing in the U.S.
|
17 |
|
18 |
-
= Facebook
|
19 |
|
20 |
-
Add your online store to Facebook and sell to millions of Facebook users. No addons needed. Ecwid will automatically synchronize your products, customers, orders and inventory between your WordPress and Facebook storefronts. Ecwid is the **#1 e-commerce app on Facebook**. Join!
|
21 |
|
22 |
= eCommerce Mobile Apps =
|
23 |
|
@@ -37,13 +36,13 @@ So you don't need to worry about software updates, security patches and server m
|
|
37 |
|
38 |
Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that Ecwid helps your online store meet the security requirements of the bank you do business with.
|
39 |
|
40 |
-
=
|
41 |
|
42 |
-
Friendly and knowledgeable support experts available 24/5 so you can get immediate help when you need it.
|
43 |
|
44 |
= Sell Everywhere =
|
45 |
|
46 |
-
With Ecwid, you can include your
|
47 |
|
48 |
= Mobile Responsive Design =
|
49 |
|
@@ -59,7 +58,7 @@ Ecwid offers a free plan that’s always available with no hidden setup charges
|
|
59 |
|
60 |
* [Demo Store](https://ecwid.to/ecwid-demo-store "Ecwid demo")
|
61 |
* [Ecwid Ecommerce Control panel](https://ecwid.to/ecwid-store-control-panel "Ecwid Control Panel") (you will be able to create a free Ecwid account)
|
62 |
-
|
63 |
= Ecwid Site =
|
64 |
|
65 |
* [www.ecwid.com](https://ecwid.to/ecwid-wp-site "Ecwid site")
|
@@ -151,8 +150,12 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
151 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
152 |
|
153 |
== Changelog ==
|
154 |
-
= 6.4 -
|
155 |
-
-
|
|
|
|
|
|
|
|
|
156 |
- **SEO fix: 404 status for removed products and categories.** Previously, Ecwid didn't mark removed products and categories with correct 404 responses — it just displayed a customer-friendly message saying the product is not available. Google recommends making removed pages clearly marked with a special 404 response code available for search robots to read. We added it to make sure unavailable products will be quicker removed from the Google search results giving more customer attention to the available products.
|
157 |
- Minor fixes and improvements.
|
158 |
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 6.4.1
|
7 |
|
8 |
+
Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
10 |
== Description ==
|
11 |
+
Ecwid Ecommerce Shopping Cart is everything you need to add an online store to your WordPress site. Powerful, easy-to-use and Gutenberg-friendly. Over 1 million sellers in 175 countries, 45 languages supported. PayPal, Stripe and 40 more payment options. Real-time shipping integrations. Selling on Instagram and Facebook.
|
|
|
12 |
|
13 |
= Automatic Shipping and Taxes =
|
14 |
|
15 |
The Ecwid ecommerce plugin integrates with major carriers including USPS, UPS, FedEx, Canada Post, Australia Post, and others to automatically calculate shipping rates. Taxes are also automated and can be set-up in a few clicks. Automated tax rate calculations are available for the U.S., Canada, and EU VAT. Additionally, integration with TaxJar provides automatic sales tax reporting and filing in the U.S.
|
16 |
|
17 |
+
= Sell on Facebook and Instagram =
|
18 |
|
19 |
+
Add your online store to Facebook and sell to millions of Facebook and Instagram users. No addons needed. Ecwid will automatically synchronize your products, customers, orders and inventory between your WordPress and Facebook storefronts. Ecwid is the **#1 e-commerce app on Facebook**. Join!
|
20 |
|
21 |
= eCommerce Mobile Apps =
|
22 |
|
36 |
|
37 |
Ecwid Shopping Cart is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means that Ecwid helps your online store meet the security requirements of the bank you do business with.
|
38 |
|
39 |
+
= Superb Support =
|
40 |
|
41 |
+
Friendly and knowledgeable support experts available 24/5 so you can get immediate help when you need it. Support options include email, e-commerce community forums, chat and phone support.
|
42 |
|
43 |
= Sell Everywhere =
|
44 |
|
45 |
+
With Ecwid, you can include your ecommerce shop on multiple websites, blogs, social sites and ecommerce marketplaces like *Amazon*, *eBay* and *Google Shopping* and sell simultaneously everywhere. Add your online store to as many sites as you want, manage it from one place.
|
46 |
|
47 |
= Mobile Responsive Design =
|
48 |
|
58 |
|
59 |
* [Demo Store](https://ecwid.to/ecwid-demo-store "Ecwid demo")
|
60 |
* [Ecwid Ecommerce Control panel](https://ecwid.to/ecwid-store-control-panel "Ecwid Control Panel") (you will be able to create a free Ecwid account)
|
61 |
+
* [Showcase](https://ecwid.to/ecwid-wp-site)
|
62 |
= Ecwid Site =
|
63 |
|
64 |
* [www.ecwid.com](https://ecwid.to/ecwid-wp-site "Ecwid site")
|
150 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
151 |
|
152 |
== Changelog ==
|
153 |
+
= 6.4.1 - Nov 13, 2018 =
|
154 |
+
- WordPress v 5.0 compatibility. This update brings compatibility with the upcoming WordPress version. In particular, we made sure Ecwid e-commerce stores looks good with the new Twenty Nineteenth theme. Also, we polished the Ecwid online store block in the new WordPress editor (Gutenberg) to make sure you can add a product listing to any site page and customize its appearance including colors, product grid layout, store navigation controls, product page appearance and more.
|
155 |
+
|
156 |
+
|
157 |
+
= 6.4 - Oct 25, 2018 =
|
158 |
+
- **New storefront appearance settings in Gutenberg.** The new WordPress page editor (Gutenberg) now has plenty of e-commerce design settings: product thumbnails format and size, button and text colors, category images behavior, product page layout, store navigation elements and a lot more. We previously added these appearance options to your Ecwid store control panel: https://www.ecwid.com/blog/new-ecwid-design-settings-dozens-of-customization-options-no-coding.html. Now they are a part of real-time page building experience: you tweak the appearance, preview changes and publish them right from the page editor. To see the new appearance options, please make sure you enabled the Gutenberg editor in your WordPress admin backend.
|
159 |
- **SEO fix: 404 status for removed products and categories.** Previously, Ecwid didn't mark removed products and categories with correct 404 responses — it just displayed a customer-friendly message saying the product is not available. Google recommends making removed pages clearly marked with a special 404 response code available for search robots to read. We added it to make sure unavailable products will be quicker removed from the Google search results giving more customer attention to the available products.
|
160 |
- Minor fixes and improvements.
|
161 |
|