Version Description
- Mar 28, 2019 =
- Added 8 new Gutenberg blocks 10 in total. The Ecwid plugin now provides 10 ecommerce blocks for Gutenberg for adding online store functionality to your site pages. The blocks include: the store home page to display the whole storefront, the store category page to show a particular category, the large product card to show detailed product information, the small product card to display one or several product widgets, the buy now button to add buttons to blog posts, the search and filters page, the search input block, the shopping cart icon block and the cart and checkout block. To try the new blocks, open Gutenberg editor in your WordPress admin backend, click "Add block" and find the "Ecwid" blocks set there.
- Added In-context "Edit Product" links. You can now open store product editor quickly when browsing published store pages as an administrator. Just click the "Edit Product" link at the top of the page in the WordPress admin header or the "Edit" button at the bottom of the post and you will get redirected to the product details in your e-commerce store dashboard.
- Added SEO improvement for the H1 tags on the product and category pages. Ecwid puts product and categories ecommerce data in the page content in a SEO-friendly microdata format so that search engines can index your store well. On the other hand, Wordpress pages have their own data, specifically <h1> tags, which stay on product pages and visible to Google when it is indexing your site. So, in addition to a product title like "My cool product", Google may see your store page title on the same page like "Shop". We improved it: the product pages will now have more prominent and clear <h1> tags containing product titles. This should improve indexation and the way your products look in the search results in Google.
- Added compatibility with the Enfold theme page builder (Avia Layout Builder). We learned that Ecwid didn't work well with the Avia page builder which is a part of the Enfold theme. Enfold users might notice it was difficult to add Ecwid blocks to a page. We fixed that now Ecwid should work fine with Enfold theme.
- Added Mega Menu plugin compatibility. Added fixes and layout improvements to make the Ecwid e-commerce plugin compatible with the Mega Menu WordPress plugin. If you use the Mega Menu plugin, you might notice layout issues on your store page. We fixed that. If you find any trouble in how Ecwid works with your theme or plugin, please let us know.
- Minor fixes for the "Import products from WooCommerce to Ecwid" import tool.
- Ecwid is constantly updated with new features and tools which are of course available to WordPress users. One of the recent major updates is Dynamic AMP emails: weve collaborated with Google/Gmail to launch dynamic email for e-commerce merchants. It's available for the Ecwid plugin users now and you will be able to use it without dealing with custom code or any external plugin. Check it out in our blog.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 6.5 |
Comparing to | |
See all releases |
Code changes from version 6.4.15 to 6.5
- css/gutenberg/blocks.editor.build.css +9 -1
- css/gutenberg/editor.scss +110 -2
- ecwid-shopping-cart.php +59 -12
- images/gutenberg/button-preview.png +0 -0
- images/gutenberg/cart-page-preview.png +0 -0
- images/gutenberg/category1.png +0 -0
- images/gutenberg/category2.png +0 -0
- images/gutenberg/category3.png +0 -0
- images/gutenberg/category4.png +0 -0
- images/gutenberg/category5.png +0 -0
- images/gutenberg/category6.png +0 -0
- images/gutenberg/filter-preview.png +0 -0
- images/gutenberg/full-store-preview.png +0 -0
- images/gutenberg/minicart-preview.png +0 -0
- images/gutenberg/product-page-preview.png +0 -0
- images/gutenberg/search-preview.png +0 -0
- images/gutenberg/store1.png +0 -0
- images/gutenberg/store2.png +0 -0
- images/gutenberg/store3.png +0 -0
- images/gutenberg/store4.png +0 -0
- images/gutenberg/store5.png +0 -0
- images/gutenberg/store6.png +0 -0
- includes/class-ecwid-admin.php +2 -0
- includes/class-ecwid-customizer.php +13 -1
- includes/class-ecwid-product-browser.php +24 -0
- includes/class-ecwid-product-popup.php +1 -1
- includes/class-ecwid-store-page.php +20 -10
- includes/gutenberg/class-ecwid-gutenberg-block-base.php +39 -0
- includes/gutenberg/class-ecwid-gutenberg-block-buynow.php +39 -0
- includes/gutenberg/class-ecwid-gutenberg-block-cart-page.php +46 -0
- includes/gutenberg/class-ecwid-gutenberg-block-categories.php +36 -0
- includes/gutenberg/class-ecwid-gutenberg-block-category-page.php +9 -0
- includes/gutenberg/class-ecwid-gutenberg-block-filters-page.php +59 -0
- includes/gutenberg/class-ecwid-gutenberg-block-minicart.php +104 -0
- includes/gutenberg/class-ecwid-gutenberg-block-product-page.php +33 -0
- includes/gutenberg/class-ecwid-gutenberg-block-product.php +68 -0
- includes/gutenberg/class-ecwid-gutenberg-block-search.php +21 -0
- includes/gutenberg/class-ecwid-gutenberg-block-store.php +286 -0
- includes/gutenberg/class-ecwid-gutenberg.php +252 -0
- includes/importer/class-ecwid-importer.php +0 -5
- includes/shortcodes/class-ecwid-shortcode-productbrowser.php +36 -12
- includes/themes.php +5 -2
- includes/themes/class-ecwid-theme-enfold.php +22 -0
- includes/themes/class-ecwid-theme-woodiex.php +32 -0
- includes/widgets/class-ecwid-widget-products-base.php +2 -0
- js/admin-bar.js +50 -0
- js/admin-menu.js +14 -1
- js/dynamic-title.js +27 -8
- js/frontend.js +1 -0
- js/gutenberg/blocks.build.js +1 -1
- js/gutenberg/product.jsx +16 -29
- js/gutenberg/store.jsx +93 -298
- js/themes/vantage.js +69 -0
- languages/ecwid-shopping-cart-ru_RU.mo +0 -0
- languages/ecwid-shopping-cart-ru_RU.po +10 -1
- lib/ecwid_api_v3.php +17 -4
- readme.txt +14 -5
css/gutenberg/blocks.editor.build.css
CHANGED
@@ -1,2 +1,10 @@
|
|
1 |
-
.components-toolbar__control.components-button:not(:disabled).is-active>svg rect{fill:white}.components-toolbar__control.components-button.ecwid-toolbar-icon>svg{padding:0}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ecwid-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ecwid-block .ecwid-block-header{font-weight:600;margin-bottom:1em}.ecwid-block .ecwid-block-header svg{max-height:20px;margin-right:1ch}.ecwid-block .ecwid-store-block-icon,.ecwid-block .ecwid-product-block-icon{margin-right:10px}.ecwid-block .ecwid-block-image{height:90px;background-repeat:no-repeat;background-size:contain;background-position:50% 50%}.ecwid-block .ecwid-block-image img{width:auto;max-height:100%;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-block .ecwid-block-title{margin-top:11px;margin-bottom:1em}.ecwid-block .ecwid-block-button{font-weight:400}.ecwid-selected-product{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif}.ecwid-selected-product>div{display:table-cell}.ecwid-selected-product .ecwid-selected-product-image img{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-selected-product .ecwid-selected-product-image{padding-right:25px;vertical-align:top}.ecwid-selected-product .ecwid-selected-product-details{vertical-align:middle}.ecwid-selected-product .ecwid-selected-product-name{font-size:20px;font-weight:600;margin-bottom:0.5em}.ecwid-selected-product .ecwid-selected-product-sku{font-size:16px;margin-bottom:1em}.media-frame-content.has-selected-product form,.media-frame-content.has-selected-product .products,.media-frame-content.has-selected-product .tablenav{display:none}#ecwid-product-popup-content .media-frame-content.ecwid-selected-product{padding-left:20px;padding-top:40px}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ec-store-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ec-store-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ec-store-block .ec-store-block-header{font-weight:600;margin-bottom:1em}.ec-store-block .ec-store-block-header svg{max-height:
|
2 |
.wp-block-cgb-block-my-block2{background:#bada55;border:0.2rem solid #292929;color:#292929;margin:0 auto;max-width:740px;padding:2rem}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.components-toolbar__control.components-button:not(:disabled).is-active>svg rect{fill:white}.components-toolbar__control.components-button.ecwid-toolbar-icon>svg{padding:0}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ecwid-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ecwid-block .ecwid-block-header{font-weight:600;margin-bottom:1em}.ecwid-block .ecwid-block-header svg{max-height:20px;margin-right:1ch}.ecwid-block .ecwid-store-block-icon,.ecwid-block .ecwid-product-block-icon{margin-right:10px}.ecwid-block .ecwid-block-image{height:90px;background-repeat:no-repeat;background-size:contain;background-position:50% 50%}.ecwid-block .ecwid-block-image img{width:auto;max-height:100%;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-block .ecwid-block-title{margin-top:11px;margin-bottom:1em}.ecwid-block .ecwid-block-button{font-weight:400}.ecwid-selected-product{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif}.ecwid-selected-product>div{display:table-cell}.ecwid-selected-product .ecwid-selected-product-image img{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1)}.ecwid-selected-product .ecwid-selected-product-image{padding-right:25px;vertical-align:top}.ecwid-selected-product .ecwid-selected-product-details{vertical-align:middle}.ecwid-selected-product .ecwid-selected-product-name{font-size:20px;font-weight:600;margin-bottom:0.5em}.ecwid-selected-product .ecwid-selected-product-sku{font-size:16px;margin-bottom:1em}.media-frame-content.has-selected-product form,.media-frame-content.has-selected-product .products,.media-frame-content.has-selected-product .tablenav{display:none}#ecwid-product-popup-content .media-frame-content.ecwid-selected-product{padding-left:20px;padding-top:40px}.ecwid-store-block-icon{background:url("../images/wordpress_20x20.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ecwid-store-block{position:relative}.ecwid-store-block-button{font-family:Open Sans, Trebuchet MS, Helvetica, Verdana, sans-serif;position:relative;top:135px;font-size:14px}.ecwid-product-block-icon{background:url("../../images/gutenberg-block-product.svg");background-size:contain;width:20px;height:20px;margin-bottom:3px}.ec-store-block{text-align:center;font-size:13px;font-family:'Open Sans';padding:1em;background-color:#f8f9f9;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:220px}.ec-store-block-product{background:none;display:inline-block}.ec-store-block-product svg{margin:auto}.ec-store-product-title{font-weight:600;font-size:14px;color:#555;margin-top:5px}.ec-store-block>div{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.ec-store-block .ec-store-block-header{font-weight:600;margin-bottom:1em;line-height:24px}.ec-store-block .ec-store-block-header svg{max-height:24px;margin-right:1ch}.ec-store-block .ec-store-store-block-icon,.ec-store-block .ec-store-product-block-icon{margin-right:10px}.ec-store-block .ec-store-block-image{height:90px;background-repeat:no-repeat;background-size:contain;background-position:50% 50%}.ec-store-block .ec-store-block-image img{width:auto;max-height:100%;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);box-shadow:0 2px 5px 0 rgba(0,0,0,0.1);-o-object-fit:cover;object-fit:cover}.ec-store-block-product .ec-store-block-image,.ec-store-block-product .ec-store-block-product-preview{height:180px;min-width:180px}.ec-store-block-product .ec-store-block-product-preview{border:1px solid rgba(145,151,162,0.25)}.ec-store-block-minicart{min-height:180px;min-width:180px;display:inline-block;background:none;position:relative}.ec-store-block-minicart .image{background:url("../../images/gutenberg/minicart-widget-preview.png") 50% 50% no-repeat;background-size:50%;position:absolute;left:0;top:0;right:0;bottom:0}.ec-store-block .ec-store-block-title{margin-top:11px;margin-bottom:1em}.ec-store-block .ec-store-block-button{font-weight:400;margin-top:11px}.ec-store-block>.ec-store-products{display:block}.ec-store-products>div{width:130px;height:130px;margin:15px;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #e2e4e7;background-size:100% 100%}.ec-store-product1{background:url("../../images/gutenberg/store1.png")}.ec-store-product2{background:url("../../images/gutenberg/store2.png")}.ec-store-product3{background:url("../../images/gutenberg/store3.png")}.ec-store-product4{background:url("../../images/gutenberg/store4.png")}.ec-store-product5{background:url("../../images/gutenberg/store5.png")}.ec-store-product6{background:url("../../images/gutenberg/store6.png")}.ec-store-color-picker .component-color-indicator{vertical-align:text-bottom}.ec-store-color-picker .components-color-palette{margin-top:.6rem}.ec-store-inspector-subheader-row{margin-bottom:20px}.ec-store-inspector-row{-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ec-store-inspector-row label,.ec-store-inspector-row button{display:block}.ec-store-inspector-subheader{color:#191e23;font-weight:600;cursor:default}.ec-store-inspector-row{margin:15px 0}.ec-store-inspector-select{max-width:100%}.ec-store-generic-block>div{display:block}.ec-store-block .ec-store-block-header{font-weight:600;margin-bottom:1em;line-height:24px;display:-ms-flexbox;display:flex}.ec-store-block .ec-store-block-header svg{max-height:24px;margin-right:1ch}
|
2 |
.wp-block-cgb-block-my-block2{background:#bada55;border:0.2rem solid #292929;color:#292929;margin:0 auto;max-width:740px;padding:2rem}
|
3 |
+
.ec-store-block-buynow{min-height:40px;min-width:120px;display:inline-block;background:none;position:relative}.ec-store-block-buynow .image{background:url("../../images/gutenberg/button-preview.png") 50% 50% no-repeat;background-size:120px 40px;position:absolute;left:0;top:0;right:0;height:40px}.ec-store-block-buynow .button-container{margin-top:35px}
|
4 |
+
.ec-store-block-search{min-width:500px;min-height:48px;display:inline-block;background:none;position:relative}.ec-store-block-search .image{background:url("../../images/gutenberg/search-preview.png") 50% 50% no-repeat;background-size:500px 48px;position:absolute;left:0;top:0;right:0;bottom:0}
|
5 |
+
.ec-store-block-categories{height:50px;min-height:50px}.ec-store-block-categories .ec-store-block-header{margin-bottom:0}
|
6 |
+
.ec-store-block-minicart{min-height:77px;min-width:77px;display:inline-block;background:none;position:relative}.ec-store-block-minicart .image{background:url("../../images/gutenberg/minicart-preview.png") 50% 50% no-repeat;background-size:100%;position:absolute;left:0;top:0;right:0;bottom:0}
|
7 |
+
.ec-store-block>.ec-store-category{display:block}.ec-store-category-products>div{width:130px;height:130px;margin:15px;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #e2e4e7;background-size:100% 100%}.ec-store-category-product1{background:url("../../images/gutenberg/category1.png")}.ec-store-category-product2{background:url("../../images/gutenberg/category2.png")}.ec-store-category-product3{background:url("../../images/gutenberg/category3.png")}.ec-store-category-product4{background:url("../../images/gutenberg/category4.png")}.ec-store-category-product5{background:url("../../images/gutenberg/category5.png")}.ec-store-category-product6{background:url("../../images/gutenberg/category6.png")}
|
8 |
+
.ec-store-block-product-page .image{background:url("../../images/gutenberg/product-page-preview.png") 50% 50% no-repeat;background-size:216px 140px;position:absolute;left:0;top:0;right:0;bottom:0}.ec-store-block-product-page .image.no-product{bottom:45px}.ec-store-block-product-page .button-container{position:absolute;bottom:20px}
|
9 |
+
.ec-store-block-filters-page{min-height:330px}.ec-store-block-filters-page .image{background:url("../../images/gutenberg/filter-preview.png") 50% 50% no-repeat;background-size:432px 280px;position:absolute;left:0;top:0;right:0;bottom:0}
|
10 |
+
.ec-store-block-cart-page .image{background:url("../../images/gutenberg/cart-page-preview.png") 50% 50% no-repeat;background-size:216px 80px;position:absolute;left:0;top:0;right:0;bottom:0}
|
css/gutenberg/editor.scss
CHANGED
@@ -186,6 +186,21 @@
|
|
186 |
min-height: 220px;
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
.ec-store-block > div {
|
190 |
display: flex;
|
191 |
justify-content: center;
|
@@ -194,10 +209,11 @@
|
|
194 |
.ec-store-block .ec-store-block-header {
|
195 |
font-weight: 600;
|
196 |
margin-bottom: 1em;
|
|
|
197 |
}
|
198 |
|
199 |
.ec-store-block .ec-store-block-header svg {
|
200 |
-
max-height:
|
201 |
margin-right: 1ch;
|
202 |
}
|
203 |
|
@@ -222,6 +238,34 @@
|
|
222 |
object-fit: cover;
|
223 |
}
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
.ec-store-block .ec-store-block-title {
|
226 |
margin-top: 11px;
|
227 |
margin-bottom: 1em;
|
@@ -229,6 +273,45 @@
|
|
229 |
|
230 |
.ec-store-block .ec-store-block-button {
|
231 |
font-weight: 400;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
|
234 |
.ec-store-color-picker .component-color-indicator {
|
@@ -239,6 +322,10 @@
|
|
239 |
margin-top: .6rem;
|
240 |
}
|
241 |
|
|
|
|
|
|
|
|
|
242 |
.ec-store-inspector-row {
|
243 |
justify-content: space-between;
|
244 |
display: flex;
|
@@ -259,4 +346,25 @@
|
|
259 |
|
260 |
.ec-store-inspector-row {
|
261 |
margin: 15px 0;
|
262 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
min-height: 220px;
|
187 |
}
|
188 |
|
189 |
+
.ec-store-block-product {
|
190 |
+
background: none;
|
191 |
+
display: inline-block;
|
192 |
+
}
|
193 |
+
|
194 |
+
.ec-store-block-product svg {
|
195 |
+
margin: auto;
|
196 |
+
}
|
197 |
+
.ec-store-product-title {
|
198 |
+
font-weight: 600;
|
199 |
+
font-size: 14px;
|
200 |
+
color: #555;
|
201 |
+
margin-top: 5px;
|
202 |
+
}
|
203 |
+
|
204 |
.ec-store-block > div {
|
205 |
display: flex;
|
206 |
justify-content: center;
|
209 |
.ec-store-block .ec-store-block-header {
|
210 |
font-weight: 600;
|
211 |
margin-bottom: 1em;
|
212 |
+
line-height: 24px;
|
213 |
}
|
214 |
|
215 |
.ec-store-block .ec-store-block-header svg {
|
216 |
+
max-height: 24px;
|
217 |
margin-right: 1ch;
|
218 |
}
|
219 |
|
238 |
object-fit: cover;
|
239 |
}
|
240 |
|
241 |
+
.ec-store-block-product .ec-store-block-image,
|
242 |
+
.ec-store-block-product .ec-store-block-product-preview {
|
243 |
+
height: 180px;
|
244 |
+
min-width: 180px;
|
245 |
+
}
|
246 |
+
|
247 |
+
.ec-store-block-product .ec-store-block-product-preview {
|
248 |
+
border: 1px solid rgba(145,151,162,.25);
|
249 |
+
}
|
250 |
+
|
251 |
+
.ec-store-block-minicart {
|
252 |
+
min-height: 180px;
|
253 |
+
min-width: 180px;
|
254 |
+
display: inline-block;
|
255 |
+
background: none;
|
256 |
+
position: relative;
|
257 |
+
}
|
258 |
+
|
259 |
+
.ec-store-block-minicart .image {
|
260 |
+
background: url('../../images/gutenberg/minicart-widget-preview.png') 50% 50% no-repeat;
|
261 |
+
background-size: 50%;
|
262 |
+
position: absolute;
|
263 |
+
left:0;
|
264 |
+
top:0;
|
265 |
+
right:0;
|
266 |
+
bottom:0;
|
267 |
+
}
|
268 |
+
|
269 |
.ec-store-block .ec-store-block-title {
|
270 |
margin-top: 11px;
|
271 |
margin-bottom: 1em;
|
273 |
|
274 |
.ec-store-block .ec-store-block-button {
|
275 |
font-weight: 400;
|
276 |
+
margin-top: 11px;
|
277 |
+
}
|
278 |
+
|
279 |
+
.ec-store-block > .ec-store-products {
|
280 |
+
display: block;
|
281 |
+
}
|
282 |
+
|
283 |
+
.ec-store-products > div {
|
284 |
+
width: 130px;
|
285 |
+
height: 130px;
|
286 |
+
margin: 15px;
|
287 |
+
display: inline-flex;
|
288 |
+
border: 1px solid #e2e4e7;
|
289 |
+
background-size: 100% 100%;
|
290 |
+
}
|
291 |
+
|
292 |
+
.ec-store-product1 {
|
293 |
+
background: url("../../images/gutenberg/store1.png");
|
294 |
+
}
|
295 |
+
|
296 |
+
.ec-store-product2 {
|
297 |
+
background: url("../../images/gutenberg/store2.png");
|
298 |
+
}
|
299 |
+
|
300 |
+
.ec-store-product3 {
|
301 |
+
background: url("../../images/gutenberg/store3.png");
|
302 |
+
|
303 |
+
}
|
304 |
+
|
305 |
+
.ec-store-product4 {
|
306 |
+
background: url("../../images/gutenberg/store4.png");
|
307 |
+
}
|
308 |
+
|
309 |
+
.ec-store-product5 {
|
310 |
+
background: url("../../images/gutenberg/store5.png");
|
311 |
+
}
|
312 |
+
|
313 |
+
.ec-store-product6 {
|
314 |
+
background: url("../../images/gutenberg/store6.png");
|
315 |
}
|
316 |
|
317 |
.ec-store-color-picker .component-color-indicator {
|
322 |
margin-top: .6rem;
|
323 |
}
|
324 |
|
325 |
+
.ec-store-inspector-subheader-row {
|
326 |
+
margin-bottom: 20px;
|
327 |
+
}
|
328 |
+
|
329 |
.ec-store-inspector-row {
|
330 |
justify-content: space-between;
|
331 |
display: flex;
|
346 |
|
347 |
.ec-store-inspector-row {
|
348 |
margin: 15px 0;
|
349 |
+
}
|
350 |
+
|
351 |
+
.ec-store-inspector-select {
|
352 |
+
max-width: 100%;
|
353 |
+
}
|
354 |
+
|
355 |
+
|
356 |
+
.ec-store-generic-block > div {
|
357 |
+
display: block;
|
358 |
+
}
|
359 |
+
|
360 |
+
.ec-store-block .ec-store-block-header {
|
361 |
+
font-weight: 600;
|
362 |
+
margin-bottom: 1em;
|
363 |
+
line-height: 24px;
|
364 |
+
display: flex;
|
365 |
+
}
|
366 |
+
|
367 |
+
.ec-store-block .ec-store-block-header svg {
|
368 |
+
max-height: 24px;
|
369 |
+
margin-right: 1ch;
|
370 |
+
}
|
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.
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
@@ -146,7 +146,7 @@ if (version_compare($version, '4.0') >= 0) {
|
|
146 |
}
|
147 |
|
148 |
if ( strpos( $version, '5.0' ) === 0 || version_compare( $version, '5.0' ) > 0 ) {
|
149 |
-
require_once ECWID_PLUGIN_DIR . 'includes/
|
150 |
}
|
151 |
|
152 |
// Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
|
@@ -169,7 +169,6 @@ function ecwid_init_integrations()
|
|
169 |
'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
|
170 |
'bb-plugin/fl-builder.php' => 'beaver-builder',
|
171 |
'elementor/elementor.php' => 'elementor'
|
172 |
-
|
173 |
);
|
174 |
|
175 |
|
@@ -382,6 +381,36 @@ function ecwid_enqueue_frontend() {
|
|
382 |
if (current_user_can('manage_options')) {
|
383 |
wp_enqueue_style('ecwid-fonts-css', ECWID_PLUGIN_URL . 'css/fonts.css', array(), get_option('ecwid_plugin_version'));
|
384 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
}
|
386 |
|
387 |
function ecwid_print_inline_js_config() {
|
@@ -395,8 +424,16 @@ window.ec.config.enable_canonical_urls = true;
|
|
395 |
|
396 |
HTML;
|
397 |
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
|
402 |
$js = apply_filters( 'ecwid_inline_js_config', $js );
|
@@ -701,6 +738,9 @@ function ecwid_check_version()
|
|
701 |
// Since 6.4.9+
|
702 |
add_option( 'ecwid_remove_emoji', 'Y' );
|
703 |
|
|
|
|
|
|
|
704 |
do_action( 'ecwid_on_plugin_update' );
|
705 |
|
706 |
Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id') );
|
@@ -880,6 +920,8 @@ function ecwid_check_api_cache() {
|
|
880 |
|
881 |
function ecwid_admin_check_api_cache()
|
882 |
{
|
|
|
|
|
883 |
EcwidPlatform::cache_log_record( 'admin_init', array() );
|
884 |
|
885 |
$last_cache = get_option( 'ecwid_last_api_cache_check' );
|
@@ -932,6 +974,7 @@ function ecwid_full_cache_reset()
|
|
932 |
EcwidPlatform::invalidate_profile_cache_from( time() );
|
933 |
EcwidPlatform::cache_reset( Ecwid_Api_V3::PROFILE_CACHE_NAME );
|
934 |
EcwidPlatform::cache_reset( 'all_categories' );
|
|
|
935 |
|
936 |
update_option( 'ecwid_last_api_cache_check', time() );
|
937 |
}
|
@@ -1666,7 +1709,8 @@ function ecwid_shortcode($attributes)
|
|
1666 |
'minicart_layout' => 'MiniAttachToProductBrowser',
|
1667 |
'default_category_id' => 0,
|
1668 |
'default_product_id' => 0,
|
1669 |
-
'lang' => ''
|
|
|
1670 |
)
|
1671 |
, $attributes
|
1672 |
);
|
@@ -1876,13 +1920,9 @@ function ecwid_plugin_activation_redirect( $plugin ) {
|
|
1876 |
|
1877 |
add_action('in_admin_header', 'ecwid_disable_other_notices');
|
1878 |
function ecwid_disable_other_notices() {
|
1879 |
-
|
1880 |
-
$pages = array('toplevel_page_' . Ecwid_Admin::ADMIN_SLUG, 'toplevel_page_ec_store', 'admin_page_ecwid-help');
|
1881 |
-
|
1882 |
-
$is_admin_subpage = strpos(get_current_screen()->base, 'admin_page_' . Ecwid_Admin::ADMIN_SLUG) !== false
|
1883 |
-
|| strpos(get_current_screen()->base, 'admin_page_' . Ecwid_Admin::ADMIN_SLUG) !== false;
|
1884 |
|
1885 |
-
if (!$is_admin_subpage
|
1886 |
|
1887 |
global $wp_filter;
|
1888 |
|
@@ -2064,6 +2104,13 @@ function ecwid_get_update_params_options() {
|
|
2064 |
'',
|
2065 |
'hide'
|
2066 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2067 |
)
|
2068 |
);
|
2069 |
|
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.5
|
9 |
Author URI: https://ecwid.to/ecwid-site
|
10 |
*/
|
11 |
|
146 |
}
|
147 |
|
148 |
if ( strpos( $version, '5.0' ) === 0 || version_compare( $version, '5.0' ) > 0 ) {
|
149 |
+
require_once ECWID_PLUGIN_DIR . 'includes/gutenberg/class-ecwid-gutenberg.php';
|
150 |
}
|
151 |
|
152 |
// Needs to be in both front-end and back-end to allow admin zone recognize the shortcode
|
169 |
'beaver-builder-lite-version/fl-builder.php' => 'beaver-builder',
|
170 |
'bb-plugin/fl-builder.php' => 'beaver-builder',
|
171 |
'elementor/elementor.php' => 'elementor'
|
|
|
172 |
);
|
173 |
|
174 |
|
381 |
if (current_user_can('manage_options')) {
|
382 |
wp_enqueue_style('ecwid-fonts-css', ECWID_PLUGIN_URL . 'css/fonts.css', array(), get_option('ecwid_plugin_version'));
|
383 |
}
|
384 |
+
|
385 |
+
if ( Ecwid_Store_Page::is_store_page() && ( current_user_can( Ecwid_Admin::get_capability() ) || is_admin_bar_showing() ) ) {
|
386 |
+
$is_post_edit_replace = true;
|
387 |
+
|
388 |
+
if( Ecwid_Config::is_wl() && !Ecwid_Api_V3::is_available() ) {
|
389 |
+
$is_post_edit_replace = false;
|
390 |
+
}
|
391 |
+
|
392 |
+
if( $is_post_edit_replace ) {
|
393 |
+
|
394 |
+
$post_edit_url = 'https://my.ecwid.com/#';
|
395 |
+
$is_api_available = false;
|
396 |
+
|
397 |
+
if( Ecwid_Config::is_wl() || Ecwid_Api_V3::is_available() ) {
|
398 |
+
$post_edit_url = get_admin_url() . 'admin.php?page=ec-store&ec-store-page=';
|
399 |
+
$is_api_available = true;
|
400 |
+
}
|
401 |
+
|
402 |
+
wp_enqueue_script( 'ecwid-admin-bar-js', ECWID_PLUGIN_URL . 'js/admin-bar.js', array( 'jquery' ), get_option( 'ecwid_plugin_version' ) );
|
403 |
+
wp_localize_script( 'ecwid-admin-bar-js', 'ecwidEditPostLinkParams', array(
|
404 |
+
'languages' => array(
|
405 |
+
'editProduct' => __('Edit Product', 'ecwid-shopping-cart'),
|
406 |
+
'editCategory' => __('Edit Category', 'ecwid-shopping-cart')
|
407 |
+
),
|
408 |
+
'url' => $post_edit_url,
|
409 |
+
'admin_url' => admin_url(),
|
410 |
+
'is_api_available' => $is_api_available
|
411 |
+
));
|
412 |
+
}
|
413 |
+
}
|
414 |
}
|
415 |
|
416 |
function ecwid_print_inline_js_config() {
|
424 |
|
425 |
HTML;
|
426 |
|
427 |
+
$plugins_disabling_interactive = array(
|
428 |
+
'shiftnav-pro/shiftnav.php',
|
429 |
+
'easymega/easymega.php'
|
430 |
+
);
|
431 |
+
|
432 |
+
foreach ( $plugins_disabling_interactive as $plugin ) {
|
433 |
+
if ( is_plugin_active( $plugin ) ) {
|
434 |
+
$js = ecwid_disable_interactive( $js );
|
435 |
+
break;
|
436 |
+
}
|
437 |
}
|
438 |
|
439 |
$js = apply_filters( 'ecwid_inline_js_config', $js );
|
738 |
// Since 6.4.9+
|
739 |
add_option( 'ecwid_remove_emoji', 'Y' );
|
740 |
|
741 |
+
// Since 6.4.14+
|
742 |
+
add_option( Ecwid_Store_Page::OPTION_REPLACE_TITLE, $fresh_install ? 'Y' : '' );
|
743 |
+
|
744 |
do_action( 'ecwid_on_plugin_update' );
|
745 |
|
746 |
Ecwid_Store_Page::add_store_page( get_option('ecwid_store_page_id') );
|
920 |
|
921 |
function ecwid_admin_check_api_cache()
|
922 |
{
|
923 |
+
if ( wp_doing_ajax() || @$_SERVER['REQUEST_METHOD'] != 'GET' ) return;
|
924 |
+
|
925 |
EcwidPlatform::cache_log_record( 'admin_init', array() );
|
926 |
|
927 |
$last_cache = get_option( 'ecwid_last_api_cache_check' );
|
974 |
EcwidPlatform::invalidate_profile_cache_from( time() );
|
975 |
EcwidPlatform::cache_reset( Ecwid_Api_V3::PROFILE_CACHE_NAME );
|
976 |
EcwidPlatform::cache_reset( 'all_categories' );
|
977 |
+
EcwidPlatform::cache_reset( 'nav_categories_posts' );
|
978 |
|
979 |
update_option( 'ecwid_last_api_cache_check', time() );
|
980 |
}
|
1709 |
'minicart_layout' => 'MiniAttachToProductBrowser',
|
1710 |
'default_category_id' => 0,
|
1711 |
'default_product_id' => 0,
|
1712 |
+
'lang' => '',
|
1713 |
+
'no_html_catalog' => 0
|
1714 |
)
|
1715 |
, $attributes
|
1716 |
);
|
1920 |
|
1921 |
add_action('in_admin_header', 'ecwid_disable_other_notices');
|
1922 |
function ecwid_disable_other_notices() {
|
1923 |
+
$is_admin_subpage = strpos(get_current_screen()->base, Ecwid_Admin::ADMIN_SLUG) !== false;
|
|
|
|
|
|
|
|
|
1924 |
|
1925 |
+
if (!$is_admin_subpage) return;
|
1926 |
|
1927 |
global $wp_filter;
|
1928 |
|
2104 |
'',
|
2105 |
'hide'
|
2106 |
)
|
2107 |
+
),
|
2108 |
+
|
2109 |
+
Ecwid_Store_Page::OPTION_REPLACE_TITLE => array(
|
2110 |
+
'values' => array(
|
2111 |
+
'',
|
2112 |
+
'Y'
|
2113 |
+
)
|
2114 |
)
|
2115 |
);
|
2116 |
|
images/gutenberg/button-preview.png
ADDED
Binary file
|
images/gutenberg/cart-page-preview.png
ADDED
Binary file
|
images/gutenberg/category1.png
ADDED
Binary file
|
images/gutenberg/category2.png
ADDED
Binary file
|
images/gutenberg/category3.png
ADDED
Binary file
|
images/gutenberg/category4.png
ADDED
Binary file
|
images/gutenberg/category5.png
ADDED
Binary file
|
images/gutenberg/category6.png
ADDED
Binary file
|
images/gutenberg/filter-preview.png
ADDED
Binary file
|
images/gutenberg/full-store-preview.png
ADDED
Binary file
|
images/gutenberg/minicart-preview.png
ADDED
Binary file
|
images/gutenberg/product-page-preview.png
ADDED
Binary file
|
images/gutenberg/search-preview.png
ADDED
Binary file
|
images/gutenberg/store1.png
ADDED
Binary file
|
images/gutenberg/store2.png
ADDED
Binary file
|
images/gutenberg/store3.png
ADDED
Binary file
|
images/gutenberg/store4.png
ADDED
Binary file
|
images/gutenberg/store5.png
ADDED
Binary file
|
images/gutenberg/store6.png
ADDED
Binary file
|
includes/class-ecwid-admin.php
CHANGED
@@ -227,6 +227,8 @@ class Ecwid_Admin {
|
|
227 |
}
|
228 |
}
|
229 |
|
|
|
|
|
230 |
// Yeah, in some case there might be a collision between the wp slug and ecwid hash if some hashes collide into the same slug
|
231 |
ecwid_admin_do_page( $hash );
|
232 |
}
|
227 |
}
|
228 |
}
|
229 |
|
230 |
+
|
231 |
+
|
232 |
// Yeah, in some case there might be a collision between the wp slug and ecwid hash if some hashes collide into the same slug
|
233 |
ecwid_admin_do_page( $hash );
|
234 |
}
|
includes/class-ecwid-customizer.php
CHANGED
@@ -27,7 +27,8 @@ class Ecwid_Customizer
|
|
27 |
|
28 |
$wp_customize->add_panel( $panel, array(
|
29 |
'title' => Ecwid_Config::get_brand(),
|
30 |
-
'capability' => Ecwid_Admin::get_capability()
|
|
|
31 |
) );
|
32 |
|
33 |
$wp_customize->add_section( self::SECTION_MINICART, array(
|
@@ -138,6 +139,17 @@ class Ecwid_Customizer
|
|
138 |
|
139 |
public function preview_init() {
|
140 |
EcwidPlatform::enqueue_script( 'minicart-customize', array(), true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
}
|
143 |
|
27 |
|
28 |
$wp_customize->add_panel( $panel, array(
|
29 |
'title' => Ecwid_Config::get_brand(),
|
30 |
+
'capability' => Ecwid_Admin::get_capability(),
|
31 |
+
'priority' => 2000
|
32 |
) );
|
33 |
|
34 |
$wp_customize->add_section( self::SECTION_MINICART, array(
|
139 |
|
140 |
public function preview_init() {
|
141 |
EcwidPlatform::enqueue_script( 'minicart-customize', array(), true );
|
142 |
+
|
143 |
+
add_filter( 'the_content', array($this, 'add_shortcodes_to_content') );
|
144 |
+
}
|
145 |
+
|
146 |
+
public function add_shortcodes_to_content($content){
|
147 |
+
|
148 |
+
if ( !has_shortcode( $content, 'ecwid' ) && Ecwid_Store_Page::is_store_page() && is_page() ) {
|
149 |
+
$content .= do_shortcode('[ecwid]');
|
150 |
+
}
|
151 |
+
|
152 |
+
return $content;
|
153 |
}
|
154 |
}
|
155 |
|
includes/class-ecwid-product-browser.php
CHANGED
@@ -204,6 +204,13 @@ class Ecwid_Product_Browser
|
|
204 |
'default' => 0
|
205 |
),
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
'product_details_layout' => array(
|
208 |
'name' => 'product_details_layout',
|
209 |
'title' => __( 'Product page layout', 'ecwid-shopping-cart' ),
|
@@ -332,6 +339,23 @@ class Ecwid_Product_Browser
|
|
332 |
'default' => get_option( 'ecwid_chameleon_colors_background' )
|
333 |
),
|
334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
);
|
336 |
|
337 |
}
|
204 |
'default' => 0
|
205 |
),
|
206 |
|
207 |
+
'default_product_id' => array(
|
208 |
+
'name' => 'default_product_id',
|
209 |
+
'title' => __( 'Default product_ID', 'ecwid-shopping-cart' ),
|
210 |
+
'type' => 'default_product_id',
|
211 |
+
'default' => 0
|
212 |
+
),
|
213 |
+
|
214 |
'product_details_layout' => array(
|
215 |
'name' => 'product_details_layout',
|
216 |
'title' => __( 'Product page layout', 'ecwid-shopping-cart' ),
|
339 |
'default' => get_option( 'ecwid_chameleon_colors_background' )
|
340 |
),
|
341 |
|
342 |
+
'product_filters_position_search_page' => array(
|
343 |
+
'name' => 'product_filters_position_search_page',
|
344 |
+
'title' => __( 'Filters panel position', 'ecwid-shopping-cart' ),
|
345 |
+
'values' => array(
|
346 |
+
array(
|
347 |
+
'value' => 'LEFT',
|
348 |
+
'title' => __( 'On the left', 'ecwid-shopping-cart' )
|
349 |
+
),
|
350 |
+
array(
|
351 |
+
'value' => 'RIGHT',
|
352 |
+
'title' => __( 'On the right', 'ecwid-shopping-cart' )
|
353 |
+
)
|
354 |
+
),
|
355 |
+
'default' => 'LEFT',
|
356 |
+
'is_storefront_api' => true
|
357 |
+
),
|
358 |
+
|
359 |
);
|
360 |
|
361 |
}
|
includes/class-ecwid-product-popup.php
CHANGED
@@ -91,7 +91,7 @@ class Ecwid_Product_Popup {
|
|
91 |
$output['items'][] = array(
|
92 |
'id' => $product->id,
|
93 |
'name' => $product->name,
|
94 |
-
'thumb' => $product->
|
95 |
'sku' => $product->sku
|
96 |
);
|
97 |
}
|
91 |
$output['items'][] = array(
|
92 |
'id' => $product->id,
|
93 |
'name' => $product->name,
|
94 |
+
'thumb' => $product->thumbnailUrl,
|
95 |
'sku' => $product->sku
|
96 |
);
|
97 |
}
|
includes/class-ecwid-store-page.php
CHANGED
@@ -6,6 +6,7 @@ class Ecwid_Store_Page {
|
|
6 |
const OPTION_MAIN_STORE_PAGE_ID = 'ecwid_store_page_id';
|
7 |
const OPTION_LAST_STORE_PAGE_ID = 'ecwid_last_store_page_id';
|
8 |
const OPTION_FLUSH_REWRITES = 'ecwid_flush_rewrites';
|
|
|
9 |
const WARMUP_ACTION = 'ecwid_warmup_store';
|
10 |
|
11 |
const META_STORE_DATA = 'ecwid_store';
|
@@ -135,7 +136,9 @@ class Ecwid_Store_Page {
|
|
135 |
protected static function _get_store_page_data_key( $page_id = 0 )
|
136 |
{
|
137 |
$post = get_post( $page_id );
|
138 |
-
|
|
|
|
|
139 |
return get_ecwid_store_id() . '_' . $post->ID . '_' . $post->post_modified_gmt;
|
140 |
|
141 |
}
|
@@ -239,7 +242,7 @@ class Ecwid_Store_Page {
|
|
239 |
$new_page = $pages[0];
|
240 |
// we prefer pages, not posts
|
241 |
foreach( $pages as $page ) {
|
242 |
-
if ( get_post($page)->post_type == 'page' ) {
|
243 |
$new_page = $page;
|
244 |
}
|
245 |
}
|
@@ -419,23 +422,30 @@ class Ecwid_Store_Page {
|
|
419 |
|
420 |
/* If you figure out a better place to put this the_title functionality, go ahead, move it =) */
|
421 |
|
422 |
-
static $
|
423 |
static public function enqueue_original_page_title( )
|
424 |
{
|
|
|
|
|
|
|
|
|
425 |
$script = 'dynamic-title';
|
426 |
EcwidPlatform::enqueue_script( $script, array( 'jquery' ), true );
|
427 |
wp_localize_script( EcwidPlatform::make_handle( $script ), 'ecwidOriginalTitle', array(
|
428 |
-
'
|
|
|
429 |
) );
|
430 |
}
|
431 |
|
432 |
static public function the_title( $title )
|
433 |
{
|
434 |
-
if ( ! self::is_store_page() ) return $title;
|
435 |
|
436 |
$params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
|
437 |
|
438 |
-
|
|
|
|
|
439 |
return $title;
|
440 |
}
|
441 |
|
@@ -443,12 +453,12 @@ class Ecwid_Store_Page {
|
|
443 |
|
444 |
if ( $params['mode'] == 'product' ) {
|
445 |
$p = Ecwid_Product::get_by_id( $params['id'] );
|
446 |
-
$ecwid_title = isset( $p->seoTitle ) ? $p->seoTitle : $p->name;
|
447 |
} else if ( $params['mode'] == 'category' ) {
|
448 |
$c = Ecwid_Category::get_by_id( $params['id'] );
|
449 |
$ecwid_title = $c->name;
|
450 |
}
|
451 |
-
|
452 |
if ( empty( $ecwid_title ) ) {
|
453 |
return $title;
|
454 |
}
|
@@ -457,9 +467,9 @@ class Ecwid_Store_Page {
|
|
457 |
}
|
458 |
|
459 |
add_action( 'init', array( 'Ecwid_Store_Page', 'flush_rewrites' ) );
|
460 |
-
//add_action( 'wp_enqueue_scripts', array( 'Ecwid_Store_Page', 'enqueue_original_page_title' ) );
|
461 |
add_action( 'save_post', array( 'Ecwid_Store_Page', 'on_save_post' ) );
|
462 |
add_action( 'wp_ajax_' . Ecwid_Store_Page::WARMUP_ACTION, array( 'Ecwid_Store_Page', 'warmup_store' ) );
|
463 |
add_action( 'update_option_page_on_front', array( 'Ecwid_Store_Page', 'schedule_flush_rewrites' ) );
|
464 |
|
465 |
-
|
|
6 |
const OPTION_MAIN_STORE_PAGE_ID = 'ecwid_store_page_id';
|
7 |
const OPTION_LAST_STORE_PAGE_ID = 'ecwid_last_store_page_id';
|
8 |
const OPTION_FLUSH_REWRITES = 'ecwid_flush_rewrites';
|
9 |
+
const OPTION_REPLACE_TITLE = 'ecwid_replace_title';
|
10 |
const WARMUP_ACTION = 'ecwid_warmup_store';
|
11 |
|
12 |
const META_STORE_DATA = 'ecwid_store';
|
136 |
protected static function _get_store_page_data_key( $page_id = 0 )
|
137 |
{
|
138 |
$post = get_post( $page_id );
|
139 |
+
|
140 |
+
if ( !$post ) return;
|
141 |
+
|
142 |
return get_ecwid_store_id() . '_' . $post->ID . '_' . $post->post_modified_gmt;
|
143 |
|
144 |
}
|
242 |
$new_page = $pages[0];
|
243 |
// we prefer pages, not posts
|
244 |
foreach( $pages as $page ) {
|
245 |
+
if ( get_post($page) && get_post($page)->post_type == 'page' ) {
|
246 |
$new_page = $page;
|
247 |
}
|
248 |
}
|
422 |
|
423 |
/* If you figure out a better place to put this the_title functionality, go ahead, move it =) */
|
424 |
|
425 |
+
static $main_page_title = '';
|
426 |
static public function enqueue_original_page_title( )
|
427 |
{
|
428 |
+
if ( !get_option( self::OPTION_REPLACE_TITLE, false ) ) {
|
429 |
+
return;
|
430 |
+
}
|
431 |
+
|
432 |
$script = 'dynamic-title';
|
433 |
EcwidPlatform::enqueue_script( $script, array( 'jquery' ), true );
|
434 |
wp_localize_script( EcwidPlatform::make_handle( $script ), 'ecwidOriginalTitle', array(
|
435 |
+
'initialTitle' => get_the_title(),
|
436 |
+
'mainPageTitle' => self::$main_page_title
|
437 |
) );
|
438 |
}
|
439 |
|
440 |
static public function the_title( $title )
|
441 |
{
|
442 |
+
if ( ! self::is_store_page() || !get_option( self::OPTION_REPLACE_TITLE, false ) ) return $title;
|
443 |
|
444 |
$params = Ecwid_Seo_Links::maybe_extract_html_catalog_params();
|
445 |
|
446 |
+
self::$main_page_title = $title;
|
447 |
+
|
448 |
+
if ( !isset($params['mode']) ) {
|
449 |
return $title;
|
450 |
}
|
451 |
|
453 |
|
454 |
if ( $params['mode'] == 'product' ) {
|
455 |
$p = Ecwid_Product::get_by_id( $params['id'] );
|
456 |
+
$ecwid_title = isset( $p->seoTitle ) && !empty( $p->seoTitle ) ? $p->seoTitle : $p->name;
|
457 |
} else if ( $params['mode'] == 'category' ) {
|
458 |
$c = Ecwid_Category::get_by_id( $params['id'] );
|
459 |
$ecwid_title = $c->name;
|
460 |
}
|
461 |
+
|
462 |
if ( empty( $ecwid_title ) ) {
|
463 |
return $title;
|
464 |
}
|
467 |
}
|
468 |
|
469 |
add_action( 'init', array( 'Ecwid_Store_Page', 'flush_rewrites' ) );
|
|
|
470 |
add_action( 'save_post', array( 'Ecwid_Store_Page', 'on_save_post' ) );
|
471 |
add_action( 'wp_ajax_' . Ecwid_Store_Page::WARMUP_ACTION, array( 'Ecwid_Store_Page', 'warmup_store' ) );
|
472 |
add_action( 'update_option_page_on_front', array( 'Ecwid_Store_Page', 'schedule_flush_rewrites' ) );
|
473 |
|
474 |
+
add_action( 'wp_enqueue_scripts', array( 'Ecwid_Store_Page', 'enqueue_original_page_title' ) );
|
475 |
+
add_filter( 'the_title', array( 'Ecwid_Store_Page', 'the_title' ) );
|
includes/gutenberg/class-ecwid-gutenberg-block-base.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Ecwid_Gutenberg_Block_Base {
|
4 |
+
|
5 |
+
protected $_name;
|
6 |
+
protected $_block_prefix = 'ec-store';
|
7 |
+
protected $_editor_script = 'ecwid-gutenberg-store';
|
8 |
+
|
9 |
+
abstract public function render_callback( $params );
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
}
|
13 |
+
|
14 |
+
public function register() {
|
15 |
+
|
16 |
+
register_block_type( $this->get_block_name(),
|
17 |
+
array(
|
18 |
+
'editor_script' => $this->_editor_script,
|
19 |
+
'render_callback' => array( $this, 'render_callback' ),
|
20 |
+
)
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
protected function _get_common_block_params()
|
25 |
+
{
|
26 |
+
return array(
|
27 |
+
'blockName' => $this->get_block_name()
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function get_block_name() {
|
32 |
+
return $this->_block_prefix . '/' . $this->_name;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function get_params() {
|
36 |
+
return array();
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-buynow.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Buynow extends Ecwid_Gutenberg_Block_Product {
|
6 |
+
|
7 |
+
protected $_name = 'buynow';
|
8 |
+
|
9 |
+
public function get_block_name() {
|
10 |
+
return Ecwid_Gutenberg_Block_Base::get_block_name();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function render_callback( $params ) {
|
14 |
+
|
15 |
+
if ( !@$params['id'] ) return '';
|
16 |
+
|
17 |
+
$params = wp_parse_args(
|
18 |
+
$params,
|
19 |
+
array(
|
20 |
+
'show_price_on_button' => true,
|
21 |
+
'center_align' => true,
|
22 |
+
'show_border' => false,
|
23 |
+
'id' => 0,
|
24 |
+
'show_picture' => false,
|
25 |
+
'show_title' => false,
|
26 |
+
'show_price' => true,
|
27 |
+
'show_options' => false,
|
28 |
+
'show_qty' => false,
|
29 |
+
'show_addtobag' => true
|
30 |
+
)
|
31 |
+
);
|
32 |
+
|
33 |
+
$params['show_price'] = $params['show_price_on_button'];
|
34 |
+
|
35 |
+
$result = Ecwid_Gutenberg_Block_Product::render_callback( $params );
|
36 |
+
|
37 |
+
return $result;
|
38 |
+
}
|
39 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-cart-page.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Gutenberg_Block_Cart_Page extends Ecwid_Gutenberg_Block_Store {
|
4 |
+
protected $_name = 'cart-page';
|
5 |
+
|
6 |
+
public function get_block_name() {
|
7 |
+
return Ecwid_Gutenberg_Block_Base::get_block_name();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function get_attributes_for_editor() {
|
11 |
+
$attributes = parent::get_attributes_for_editor();
|
12 |
+
|
13 |
+
$overrides = array(
|
14 |
+
'show_footer_menu' => false
|
15 |
+
);
|
16 |
+
|
17 |
+
foreach ( $overrides as $name => $editor_default ) {
|
18 |
+
$attributes[$name]['profile_default'] = $attributes[$name]['default'];
|
19 |
+
$attributes[$name]['default'] = $editor_default;
|
20 |
+
}
|
21 |
+
|
22 |
+
return $attributes;
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
public function render_callback( $params ) {
|
27 |
+
|
28 |
+
$params['no_html_catalog'] = 1;
|
29 |
+
|
30 |
+
$result = parent::render_callback( $params );
|
31 |
+
|
32 |
+
$result .= <<<HTML
|
33 |
+
<script>
|
34 |
+
Ecwid.OnAPILoaded.add(function() {
|
35 |
+
Ecwid.OnPageLoad.add(function(page) {
|
36 |
+
if ("CATEGORY" == page.type && 0 == page.categoryId && !page.hasPrevious) {
|
37 |
+
Ecwid.openPage("cart");
|
38 |
+
}
|
39 |
+
})
|
40 |
+
});
|
41 |
+
</script>
|
42 |
+
HTML;
|
43 |
+
|
44 |
+
return $result;
|
45 |
+
}
|
46 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-categories.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Categories extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
+
protected $_name = 'categories';
|
8 |
+
|
9 |
+
public function render_callback( $params ) {
|
10 |
+
|
11 |
+
$params = wp_parse_args(
|
12 |
+
$params,
|
13 |
+
array(
|
14 |
+
'is_ecwid_shortcode' => true
|
15 |
+
)
|
16 |
+
);
|
17 |
+
|
18 |
+
$shortcode = new Ecwid_Shortcode_Categories( $params );
|
19 |
+
|
20 |
+
return $shortcode->render();
|
21 |
+
}
|
22 |
+
|
23 |
+
public function get_params() {
|
24 |
+
$params = parent::get_params();
|
25 |
+
|
26 |
+
$params['has_categories'] = true;
|
27 |
+
if ( ecwid_is_demo_store() ) {
|
28 |
+
$params['has_categories'] = false;
|
29 |
+
} else {
|
30 |
+
$api = new Ecwid_Api_V3();
|
31 |
+
$params['has_categories'] = $api->has_public_categories();
|
32 |
+
}
|
33 |
+
|
34 |
+
return $params;
|
35 |
+
}
|
36 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-category-page.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Gutenberg_Block_Category_Page extends Ecwid_Gutenberg_Block_Store {
|
4 |
+
protected $_name = 'category-page';
|
5 |
+
|
6 |
+
public function get_block_name() {
|
7 |
+
return Ecwid_Gutenberg_Block_Base::get_block_name();
|
8 |
+
}
|
9 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-filters-page.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Gutenberg_Block_Filters_Page extends Ecwid_Gutenberg_Block_Store {
|
4 |
+
protected $_name = 'filters-page';
|
5 |
+
|
6 |
+
public function get_block_name() {
|
7 |
+
return Ecwid_Gutenberg_Block_Base::get_block_name();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function get_params() {
|
11 |
+
$params = parent::get_params();
|
12 |
+
|
13 |
+
$api = new Ecwid_Api_V3();
|
14 |
+
$settings = $api->get_store_profile();
|
15 |
+
|
16 |
+
|
17 |
+
$params['filtersEnabled'] = true;
|
18 |
+
if ( isset( $settings->productFiltersSettings ) && isset( $settings->productFiltersSettings->enabledInStorefront ) ) {
|
19 |
+
$params['filtersEnabled'] = $settings->productFiltersSettings->enabledInStorefront;
|
20 |
+
}
|
21 |
+
return $params;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function get_attributes_for_editor() {
|
25 |
+
$attributes = parent::get_attributes_for_editor();
|
26 |
+
|
27 |
+
$overrides = array(
|
28 |
+
'show_breadcrumbs' => false
|
29 |
+
);
|
30 |
+
|
31 |
+
foreach ( $overrides as $name => $editor_default ) {
|
32 |
+
$attributes[$name]['profile_default'] = $attributes[$name]['default'];
|
33 |
+
$attributes[$name]['default'] = $editor_default;
|
34 |
+
}
|
35 |
+
|
36 |
+
return $attributes;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function render_callback( $params ) {
|
40 |
+
$params['no_html_catalog'] = 1;
|
41 |
+
|
42 |
+
$result = parent::render_callback( $params );
|
43 |
+
|
44 |
+
$result .= <<<HTML
|
45 |
+
<script>
|
46 |
+
Ecwid.OnAPILoaded.add(function() {
|
47 |
+
Ecwid.OnPageLoad.add(function(page) {
|
48 |
+
if ("CATEGORY" == page.type && 0 == page.categoryId && !page.hasPrevious) {
|
49 |
+
Ecwid.openPage("search");
|
50 |
+
}
|
51 |
+
})
|
52 |
+
});
|
53 |
+
</script>
|
54 |
+
HTML;
|
55 |
+
|
56 |
+
return $result;
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-minicart.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Minicart extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
+
protected $_name = 'minicart';
|
8 |
+
|
9 |
+
public function render_callback( $params ) {
|
10 |
+
|
11 |
+
$params = wp_parse_args(
|
12 |
+
$params,
|
13 |
+
array(
|
14 |
+
'is_ecwid_shortcode' => true
|
15 |
+
)
|
16 |
+
);
|
17 |
+
|
18 |
+
ob_start();
|
19 |
+
?>
|
20 |
+
<!-- noptimize -->
|
21 |
+
<?php
|
22 |
+
|
23 |
+
echo ecwid_get_scriptjs_code();
|
24 |
+
echo ecwid_get_product_browser_url_script();
|
25 |
+
|
26 |
+
$attributes = $this->get_attributes_for_editor();
|
27 |
+
|
28 |
+
foreach ( array( 'fixed_shape', 'layout', 'icon' ) as $param ) {
|
29 |
+
if ( !@$params[$param] ) {
|
30 |
+
$params[$param] = $attributes[$param]['default'];
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
?>
|
35 |
+
|
36 |
+
<div class='ec-cart-widget'
|
37 |
+
data-fixed='false'
|
38 |
+
data-fixed-shape='<?php echo @$params['fixed_shape']; ?>'
|
39 |
+
data-layout='<?php echo @$params['layout']; ?>'
|
40 |
+
data-icon='<?php echo @$params['icon']; ?>'
|
41 |
+
></div>
|
42 |
+
|
43 |
+
<script>
|
44 |
+
Ecwid.init();
|
45 |
+
</script>
|
46 |
+
<!-- /noptimize -->
|
47 |
+
<?php
|
48 |
+
|
49 |
+
$contents = ob_get_contents();
|
50 |
+
ob_end_clean();
|
51 |
+
|
52 |
+
$align = @$params['align'];
|
53 |
+
if ( $align == 'right' || $align == "left" ) {
|
54 |
+
$contents = '<div class="align' . $align . '">' . $contents . '</div>';
|
55 |
+
}
|
56 |
+
|
57 |
+
return $contents;
|
58 |
+
}
|
59 |
+
|
60 |
+
public function get_attributes_for_editor() {
|
61 |
+
|
62 |
+
$minicart_attributes = array(
|
63 |
+
'layout' => array(
|
64 |
+
'name' => 'layout',
|
65 |
+
'title' => __( 'Layout', 'ecwid-shopping-cart' ),
|
66 |
+
'values' => Ecwid_Floating_Minicart::get_layouts(),
|
67 |
+
'default' => 'BIG_ICON_TITLE_SUBTOTAL'
|
68 |
+
),
|
69 |
+
'icon' => array(
|
70 |
+
'name' => 'icon',
|
71 |
+
'title' => __( 'Cart icon', 'ecwid-shopping-cart' ),
|
72 |
+
'values' => Ecwid_Floating_Minicart::get_icons(),
|
73 |
+
'default' => 'BAG'
|
74 |
+
),
|
75 |
+
'fixed_shape' => array(
|
76 |
+
'name' => 'fixed_shape',
|
77 |
+
'title' => __( 'Border', 'ecwid-shopping-cart' ),
|
78 |
+
'values' => Ecwid_Floating_Minicart::get_fixed_shapes(),
|
79 |
+
'default' => 'RECT'
|
80 |
+
)
|
81 |
+
);
|
82 |
+
|
83 |
+
$attributes = array();
|
84 |
+
|
85 |
+
foreach ( $minicart_attributes as $name => $attr ) {
|
86 |
+
$result = array();
|
87 |
+
$result['name'] = $attr['name'];
|
88 |
+
$result['title'] = $attr['title'];
|
89 |
+
$result['default'] = $attr['default'];
|
90 |
+
$result['values'] = array();
|
91 |
+
|
92 |
+
foreach ( $attr['values'] as $value => $title ) {
|
93 |
+
$result['values'][] = array(
|
94 |
+
'value' => $value,
|
95 |
+
'title' => $title
|
96 |
+
);
|
97 |
+
}
|
98 |
+
|
99 |
+
$attributes[$name] = $result;
|
100 |
+
}
|
101 |
+
|
102 |
+
return $attributes;
|
103 |
+
}
|
104 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-product-page.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ecwid_Gutenberg_Block_Product_Page extends Ecwid_Gutenberg_Block_Store {
|
4 |
+
protected $_name = 'product-page';
|
5 |
+
|
6 |
+
public function get_block_name() {
|
7 |
+
return Ecwid_Gutenberg_Block_Base::get_block_name();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function render_callback( $params ) {
|
11 |
+
if ( ! @$params['default_product_id'] ) {
|
12 |
+
return '';
|
13 |
+
}
|
14 |
+
|
15 |
+
return parent::render_callback( $params );
|
16 |
+
}
|
17 |
+
|
18 |
+
public function get_attributes_for_editor() {
|
19 |
+
$attributes = parent::get_attributes_for_editor();
|
20 |
+
|
21 |
+
$overrides = array(
|
22 |
+
'show_footer_menu' => false,
|
23 |
+
'product_details_show_breadcrumbs' => false
|
24 |
+
);
|
25 |
+
|
26 |
+
foreach ( $overrides as $name => $editor_default ) {
|
27 |
+
$attributes[$name]['profile_default'] = $attributes[$name]['default'];
|
28 |
+
$attributes[$name]['default'] = $editor_default;
|
29 |
+
}
|
30 |
+
|
31 |
+
return $attributes;
|
32 |
+
}
|
33 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-product.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Product extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
+
protected $_name = 'product';
|
8 |
+
|
9 |
+
public function get_block_name() {
|
10 |
+
return 'ecwid/product-block';
|
11 |
+
}
|
12 |
+
|
13 |
+
public function render_callback( $params ) {
|
14 |
+
|
15 |
+
if ( !@$params['id'] ) return '';
|
16 |
+
|
17 |
+
$params = wp_parse_args(
|
18 |
+
$params,
|
19 |
+
array(
|
20 |
+
'id' => 0,
|
21 |
+
'show_picture' => true,
|
22 |
+
'show_title' => true,
|
23 |
+
'show_price' => true,
|
24 |
+
'show_options' => true,
|
25 |
+
'show_addtobag' => true,
|
26 |
+
'show_border' => true,
|
27 |
+
'center_align' => true,
|
28 |
+
'show_price_on_button' => true
|
29 |
+
)
|
30 |
+
);
|
31 |
+
|
32 |
+
$display = array(
|
33 |
+
'picture', 'title', 'price', 'options', 'qty', 'addtobag'
|
34 |
+
);
|
35 |
+
|
36 |
+
$params['display'] = '';
|
37 |
+
$display_string = '';
|
38 |
+
foreach ( $display as $name ) {
|
39 |
+
if ( @$params['show_' . $name] ) {
|
40 |
+
$params['display'] .= ' ' . $name;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
$params['version'] = 2;
|
45 |
+
|
46 |
+
$shortcode = new Ecwid_Shortcode_Product( $params );
|
47 |
+
|
48 |
+
$contents = $shortcode->render();
|
49 |
+
|
50 |
+
$align = @$params['align'];
|
51 |
+
if ( $align == 'right' || $align == "left" ) {
|
52 |
+
$contents = '<div class="align' . $align . '">' . $contents . '</div>';
|
53 |
+
}
|
54 |
+
|
55 |
+
return $contents;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function get_icon_path()
|
59 |
+
{
|
60 |
+
return '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
|
61 |
+
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
|
62 |
+
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
|
63 |
+
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
|
64 |
+
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
|
65 |
+
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
|
66 |
+
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';
|
67 |
+
}
|
68 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-search.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Search extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
+
protected $_name = 'search';
|
8 |
+
|
9 |
+
public function render_callback( $params ) {
|
10 |
+
$params = wp_parse_args(
|
11 |
+
$params,
|
12 |
+
array(
|
13 |
+
'is_ecwid_shortcode' => true
|
14 |
+
)
|
15 |
+
);
|
16 |
+
|
17 |
+
$shortcode = new Ecwid_Shortcode_Search( $params );
|
18 |
+
|
19 |
+
return $shortcode->render();
|
20 |
+
}
|
21 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg-block-store.php
ADDED
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class-ecwid-gutenberg-block-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg_Block_Store extends Ecwid_Gutenberg_Block_Base {
|
6 |
+
|
7 |
+
protected $_name = 'store';
|
8 |
+
|
9 |
+
public function get_block_name() {
|
10 |
+
return 'ecwid/store-block';
|
11 |
+
}
|
12 |
+
|
13 |
+
public function get_params() {
|
14 |
+
$params = array(
|
15 |
+
'attributes' => $this->get_attributes_for_editor(),
|
16 |
+
'isNewProductList' => $this->_is_new_product_list(),
|
17 |
+
'isNewDetailsPage' => $this->_is_new_details_page(),
|
18 |
+
'storeBlockTitle' => _x( 'Store', 'gutenberg-store-block-stub', 'ecwid-shopping-cart' ),
|
19 |
+
'shortcodeName' => Ecwid_Shortcode_Base::get_current_store_shortcode_name(),
|
20 |
+
'title' => __( 'Store Home Page', 'ecwid-shopping-cart' ),
|
21 |
+
'icon'=> self::get_icon_path(),
|
22 |
+
'isDemoStore' => ecwid_is_demo_store(),
|
23 |
+
'customizeMinicartText' =>
|
24 |
+
sprintf(
|
25 |
+
__(
|
26 |
+
'You can enable an extra shopping bag icon widget that will appear on your site pages. Open “<a href="%1$s">Appearance → Customize → %2$s</a>” menu to enable it.',
|
27 |
+
'ecwid-shopping-cart'
|
28 |
+
),
|
29 |
+
'customize.php?autofocus[section]=' . Ecwid_Customizer::SECTION_MINICART . '&return=' . urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
30 |
+
),
|
31 |
+
Ecwid_Config::get_brand()
|
32 |
+
)
|
33 |
+
|
34 |
+
);
|
35 |
+
|
36 |
+
$params = array_merge(
|
37 |
+
$params,
|
38 |
+
$this->_get_common_block_params()
|
39 |
+
);
|
40 |
+
|
41 |
+
return $params;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function render_callback( $params ) {
|
45 |
+
|
46 |
+
if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
|
47 |
+
return '';
|
48 |
+
}
|
49 |
+
|
50 |
+
$result = "[ecwid";
|
51 |
+
|
52 |
+
$params['widgets'] = 'productbrowser';
|
53 |
+
if ( @$params['show_categories'] ) {
|
54 |
+
$params['widgets'] .= ' categories';
|
55 |
+
}
|
56 |
+
if ( @$params['show_search'] ) {
|
57 |
+
$params['widgets'] .= ' search';
|
58 |
+
}
|
59 |
+
|
60 |
+
foreach ($params as $key => $value) {
|
61 |
+
$result .= " $key='$value'";
|
62 |
+
}
|
63 |
+
|
64 |
+
$result .= ']';
|
65 |
+
|
66 |
+
$result .= <<<HTML
|
67 |
+
<script type="text/javascript">
|
68 |
+
window.ec = window.ec || Object();
|
69 |
+
window.ec.storefront = window.ec.storefront || Object();
|
70 |
+
HTML;
|
71 |
+
|
72 |
+
$attributes = $this->get_attributes_for_editor();
|
73 |
+
|
74 |
+
$store_page_data = array();
|
75 |
+
|
76 |
+
foreach ( $attributes as $key => $attribute ) {
|
77 |
+
|
78 |
+
$name = $attribute['name'];
|
79 |
+
if ( !isset( $params[$name] ) ) {
|
80 |
+
$store_page_data[$name] = $attribute['default'];
|
81 |
+
}
|
82 |
+
|
83 |
+
$value = null;
|
84 |
+
|
85 |
+
if ( isset( $params[$name] ) ) {
|
86 |
+
$value = $params[$name];
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( $name == 'show_description_under_image' ) {
|
90 |
+
$attribute['is_storefront_api'] = true;
|
91 |
+
$value = !@$params[$name];
|
92 |
+
|
93 |
+
$layout = @$params['product_details_layout'];
|
94 |
+
if ( is_null( $layout ) ) {
|
95 |
+
$layout = $attributes['product_details_layout']['default'];
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT' ) {
|
99 |
+
$name = 'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar';
|
100 |
+
} else if ( $layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT' ) {
|
101 |
+
$name = 'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar';
|
102 |
+
} else {
|
103 |
+
unset( $attribute['is_storefront_api'] );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( @$attribute['is_storefront_api'] ) {
|
108 |
+
|
109 |
+
if ( is_null( $value ) ) {
|
110 |
+
$value = $attribute['default'];
|
111 |
+
}
|
112 |
+
$profile_default = isset( $attribute['profile_default'] )
|
113 |
+
? $attribute['profile_default']
|
114 |
+
: $attribute['default'];
|
115 |
+
$is_profile_default = $profile_default == $value;
|
116 |
+
|
117 |
+
if ( !$is_profile_default ) {
|
118 |
+
if ( @$attribute['type'] == 'boolean') {
|
119 |
+
$result .= 'window.ec.storefront.' . $name . "=" . ( $value ? 'true' : 'false' ) . ";" . PHP_EOL;
|
120 |
+
} else {
|
121 |
+
$result .= 'window.ec.storefront.' . $name . "='" . $value . "';" . PHP_EOL;
|
122 |
+
}
|
123 |
+
$store_page_data[$name] = $value;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
$colors = array();
|
129 |
+
foreach ( array( 'foreground', 'background', 'link', 'price', 'button' ) as $kind ) {
|
130 |
+
$color = @$params['chameleon_color_' . $kind];
|
131 |
+
if ( $color ) {
|
132 |
+
$colors['color-' . $kind] = $color;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( empty( $colors ) ) {
|
137 |
+
$colors = 'auto';
|
138 |
+
}
|
139 |
+
|
140 |
+
$colors = json_encode($colors);
|
141 |
+
|
142 |
+
$chameleon = apply_filters( 'ecwid_chameleon_settings', array( 'colors' => $colors ) );
|
143 |
+
|
144 |
+
if ( !is_array($chameleon ) ) {
|
145 |
+
$chameleon = array(
|
146 |
+
'colors' => $colors,
|
147 |
+
);
|
148 |
+
}
|
149 |
+
|
150 |
+
if ( !isset( $chameleon['colors'] ) ) {
|
151 |
+
$chameleon['colors'] = json_encode($colors);
|
152 |
+
}
|
153 |
+
|
154 |
+
$store_page_data['chameleon-colors'] = $chameleon['colors'];
|
155 |
+
|
156 |
+
Ecwid_Store_Page::save_store_page_params( $store_page_data );
|
157 |
+
|
158 |
+
if ( $chameleon['colors'] != 'auto' ) {
|
159 |
+
$result .= <<<JS
|
160 |
+
window.ec.config.chameleon = window.ec.config.chameleon || Object();
|
161 |
+
window.ec.config.chameleon.colors = $chameleon[colors];
|
162 |
+
JS;
|
163 |
+
}
|
164 |
+
$result .= "
|
165 |
+
Ecwid.OnAPILoaded.add(function() {
|
166 |
+
Ecwid.refreshConfig();
|
167 |
+
});
|
168 |
+
</script>";
|
169 |
+
|
170 |
+
return $result;
|
171 |
+
}
|
172 |
+
|
173 |
+
public function get_attributes_for_editor() {
|
174 |
+
$api = new Ecwid_Api_V3();
|
175 |
+
|
176 |
+
if ( $api->is_available() && $api->get_store_profile() ) {
|
177 |
+
$settings = $api->get_store_profile()->designSettings;
|
178 |
+
} else {
|
179 |
+
$settings = new stdClass();
|
180 |
+
}
|
181 |
+
|
182 |
+
$attributes = Ecwid_Product_Browser::get_attributes();
|
183 |
+
|
184 |
+
$to_remove = array(
|
185 |
+
'product_details_two_columns_with_left_sidebar_show_product_description_on_sidebar',
|
186 |
+
'product_details_two_columns_with_right_sidebar_show_product_description_on_sidebar'
|
187 |
+
);
|
188 |
+
foreach ( $to_remove as $name ) {
|
189 |
+
unset( $attributes[ $name ] );
|
190 |
+
}
|
191 |
+
|
192 |
+
$attributes['show_description_under_image'] = array(
|
193 |
+
'name' => 'show_description_under_image',
|
194 |
+
'title' => __( 'Show description under the image', 'ecwid-shopping-cart' ),
|
195 |
+
'default' => false,
|
196 |
+
'type' => 'boolean'
|
197 |
+
);
|
198 |
+
|
199 |
+
foreach ( $attributes as $key => $attribute ) {
|
200 |
+
$name = $attribute['name'];
|
201 |
+
|
202 |
+
$default = null;
|
203 |
+
if ( property_exists( $settings, $name ) ) {
|
204 |
+
$default = $settings->$name;
|
205 |
+
}
|
206 |
+
|
207 |
+
$prop_to_default_exceptions = array(
|
208 |
+
'product_list_category_image_aspect_ratio' => 'product_list_image_aspect_ratio',
|
209 |
+
'product_list_category_image_size' => 'product_list_image_size'
|
210 |
+
);
|
211 |
+
|
212 |
+
if ( array_key_exists( $name, $prop_to_default_exceptions ) ) {
|
213 |
+
$another_name = $prop_to_default_exceptions[ $name ];
|
214 |
+
if ( property_exists( $settings, $another_name ) ) {
|
215 |
+
$default = $settings->$another_name;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
if ( $default !== null ) {
|
220 |
+
$attributes[$key]['profile_default'] = $attributes[ $key ]['default'] = $default;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
$categories = ecwid_get_categories_for_selector();
|
225 |
+
|
226 |
+
if ( $categories ) {
|
227 |
+
$attributes['default_category_id']['values'] = array(
|
228 |
+
array(
|
229 |
+
'value' => '0',
|
230 |
+
'title' => __( 'Store root category', 'ecwid-shopping-cart' )
|
231 |
+
)
|
232 |
+
);
|
233 |
+
foreach ( $categories as $category ) {
|
234 |
+
$attributes['default_category_id']['values'][] = array(
|
235 |
+
'value' => $category->id,
|
236 |
+
'title' => $category->name
|
237 |
+
);
|
238 |
+
}
|
239 |
+
|
240 |
+
$attributes['default_category_id']['default'] = '';
|
241 |
+
} else {
|
242 |
+
$api = new Ecwid_Api_V3();
|
243 |
+
$cats = $api->get_categories( array() );
|
244 |
+
|
245 |
+
if ( $cats && $cats->total == 0 ) {
|
246 |
+
unset( $attributes['default_category_id'] );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
$attributes['widgets'] = array( 'type' => 'string', 'default' => '', 'name' => 'widgets' );
|
251 |
+
|
252 |
+
return $attributes;
|
253 |
+
}
|
254 |
+
|
255 |
+
protected function _is_new_product_list() {
|
256 |
+
$api = new Ecwid_Api_V3();
|
257 |
+
|
258 |
+
return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_PRODUCT_LIST );
|
259 |
+
}
|
260 |
+
|
261 |
+
protected function _is_new_details_page() {
|
262 |
+
$api = new Ecwid_Api_V3();
|
263 |
+
|
264 |
+
return ecwid_is_demo_store() || !Ecwid_Api_V3::is_available() || $api->is_store_feature_enabled( Ecwid_Api_V3::FEATURE_NEW_DETAILS_PAGE );
|
265 |
+
}
|
266 |
+
|
267 |
+
public function get_icon_path()
|
268 |
+
{
|
269 |
+
return 'M15.32,15.58c-0.37,0-0.66,0.3-0.66,0.67c0,0.37,0.3,0.67,0.66,0.67c0.37,0,0.67-0.3,0.67-0.67
|
270 |
+
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
|
271 |
+
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
|
272 |
+
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
|
273 |
+
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
|
274 |
+
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
|
275 |
+
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
|
276 |
+
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
|
277 |
+
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
|
278 |
+
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
|
279 |
+
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
|
280 |
+
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
|
281 |
+
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
|
282 |
+
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
|
283 |
+
S4.96,15.5,4.6,15.5z';
|
284 |
+
}
|
285 |
+
|
286 |
+
}
|
includes/gutenberg/class-ecwid-gutenberg.php
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-product-browser.php';
|
4 |
+
|
5 |
+
class Ecwid_Gutenberg {
|
6 |
+
|
7 |
+
const STORE_BLOCK = 'ecwid/store-block';
|
8 |
+
const PRODUCT_BLOCK = 'ecwid/product-block';
|
9 |
+
const BUYNOW_BLOCK = 'ec-store/buynow';
|
10 |
+
const PRODUCT_PAGE_BLOCK = 'ec-store/product-page';
|
11 |
+
|
12 |
+
public $_blocks = array();
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
|
16 |
+
if ( isset( $_GET['classic-editor'] ) ) return;
|
17 |
+
|
18 |
+
$blocks = array(
|
19 |
+
'store',
|
20 |
+
'minicart',
|
21 |
+
'product',
|
22 |
+
'categories',
|
23 |
+
'search',
|
24 |
+
'buynow',
|
25 |
+
'product-page',
|
26 |
+
'filters-page',
|
27 |
+
'category-page',
|
28 |
+
'cart-page'
|
29 |
+
);
|
30 |
+
|
31 |
+
foreach ( $blocks as $block ) {
|
32 |
+
require_once dirname( __FILE__ ) . "/class-ecwid-gutenberg-block-$block.php";
|
33 |
+
$className = "Ecwid_Gutenberg_Block_" . str_replace('-', '_', ucfirst( $block ) );
|
34 |
+
|
35 |
+
$this->_blocks[] = new $className();
|
36 |
+
}
|
37 |
+
|
38 |
+
foreach ( $this->_blocks as $block ) {
|
39 |
+
$block->register();
|
40 |
+
}
|
41 |
+
|
42 |
+
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
|
43 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
44 |
+
|
45 |
+
add_action( "rest_insert_post", array( $this, 'on_save_post' ), 10, 3 );
|
46 |
+
add_action( "rest_insert_page", array( $this, 'on_save_post' ), 10, 3 );
|
47 |
+
|
48 |
+
add_filter( 'block_categories', array( $this, 'block_categories' ) );
|
49 |
+
}
|
50 |
+
|
51 |
+
public function admin_enqueue_scripts()
|
52 |
+
{
|
53 |
+
wp_enqueue_script( 'gutenberg-store' );
|
54 |
+
EcwidPlatform::enqueue_style( 'store-popup' );
|
55 |
+
}
|
56 |
+
|
57 |
+
public function block_categories( $categories ) {
|
58 |
+
|
59 |
+
$store_block = new Ecwid_Gutenberg_Block_Store();
|
60 |
+
return array_merge(
|
61 |
+
$categories,
|
62 |
+
array(
|
63 |
+
array(
|
64 |
+
'slug' => 'ec-store',
|
65 |
+
'title' => sprintf( __( '%s', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ),
|
66 |
+
'icon' => '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="#555d66" d="' . $store_block->get_icon_path() . '"/><path d="M19 13H5v-2h14v2z" /></svg>'
|
67 |
+
),
|
68 |
+
)
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function on_save_post( $post, $request, $creating ) {
|
73 |
+
if (strpos( $post->post_content, '<!-- wp:' . self::STORE_BLOCK ) !== false ) {
|
74 |
+
Ecwid_Store_Page::add_store_page( $post->ID );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
public function enqueue_block_editor_assets() {
|
79 |
+
|
80 |
+
wp_enqueue_script( 'ecwid-gutenberg-store', ECWID_PLUGIN_URL . 'js/gutenberg/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), get_option('ecwid_plugin_version') );
|
81 |
+
wp_enqueue_style( 'ecwid-gutenberg-block', ECWID_PLUGIN_URL . 'css/gutenberg/blocks.editor.build.css', array(), get_option('ecwid_plugin_version') );
|
82 |
+
|
83 |
+
$locale_data = '';
|
84 |
+
if ( function_exists( 'gutenberg_get_jed_locale_data' ) ) {
|
85 |
+
$locale_data = gutenberg_get_jed_locale_data( 'ecwid-shopping-cart' );
|
86 |
+
} else if ( function_exists( 'wp_get_jed_locale_data' ) ) {
|
87 |
+
$locale_data = wp_get_jed_locale_data( 'ecwid-shopping-cart' );
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
if ( $locale_data ) {
|
92 |
+
wp_add_inline_script(
|
93 |
+
'ecwid-gutenberg-store',
|
94 |
+
'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ', "ecwid-shopping-cart"' . ');',
|
95 |
+
'before'
|
96 |
+
);
|
97 |
+
}
|
98 |
+
|
99 |
+
$store_block = new Ecwid_Gutenberg_Block_Store();
|
100 |
+
|
101 |
+
$api = new Ecwid_Api_V3();
|
102 |
+
wp_localize_script( 'ecwid-gutenberg-store', 'EcwidGutenbergStoreBlockParams',
|
103 |
+
$store_block->get_params()
|
104 |
+
);
|
105 |
+
|
106 |
+
$blockParams = array();
|
107 |
+
foreach ( $this->_blocks as $block ) {
|
108 |
+
$blockParams[$block->get_block_name()] = $block->get_params();
|
109 |
+
}
|
110 |
+
|
111 |
+
$minicart_block = new Ecwid_Gutenberg_Block_Minicart();
|
112 |
+
$is_demo_store = ecwid_is_demo_store();
|
113 |
+
wp_localize_script( 'ecwid-gutenberg-store', 'EcwidGutenbergParams',
|
114 |
+
array(
|
115 |
+
'blockParams' => $blockParams,
|
116 |
+
'minicartAttributes' => $minicart_block->get_attributes_for_editor(),
|
117 |
+
'ecwid_pb_defaults' => ecwid_get_default_pb_size(),
|
118 |
+
'storeImageUrl' => site_url('?file=ecwid_store_svg.svg'),
|
119 |
+
'storeBlock' => self::STORE_BLOCK,
|
120 |
+
'productBlockTitle' => sprintf( __( '%s product', 'ecwid-shopping-cart'), Ecwid_Config::get_brand() ),
|
121 |
+
'productShortcodeName' => Ecwid_Shortcode_Product::get_shortcode_name(),
|
122 |
+
'productBlock' => self::PRODUCT_BLOCK,
|
123 |
+
'storeId' => get_ecwid_store_id(),
|
124 |
+
'chooseProduct' => __( 'Choose product', 'ecwid-shopping-cart' ),
|
125 |
+
'editAppearance' => __( 'Edit Appearance', 'ecwid-shopping-cart' ),
|
126 |
+
'yourStoreWill' => __( 'Your store will be shown here', 'ecwid-shopping-cart' ),
|
127 |
+
'storeIdLabel' => __( 'Store ID', 'ecwid-shopping-cart' ),
|
128 |
+
'yourProductLabel' => __( 'Your product', 'ecwid-shopping-cart' ),
|
129 |
+
'isDemoStore' => $is_demo_store,
|
130 |
+
'isApiAvailable' => Ecwid_Api_V3::is_available(),
|
131 |
+
'products' => $this->_get_products_data(),
|
132 |
+
'hasCategories' => $api->has_public_categories(),
|
133 |
+
'imagesUrl' => ECWID_PLUGIN_URL . '/images/gutenberg/'
|
134 |
+
)
|
135 |
+
);
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
protected function _get_products_data() {
|
140 |
+
|
141 |
+
$blocks = self::get_blocks_on_page();
|
142 |
+
|
143 |
+
$productIds = array();
|
144 |
+
|
145 |
+
$product_block = new Ecwid_Gutenberg_Block_Product();
|
146 |
+
$buynow_block = new Ecwid_Gutenberg_Block_Buynow();
|
147 |
+
$product_page_block = new Ecwid_Gutenberg_Block_Product_Page();
|
148 |
+
foreach ( $blocks as $block ) {
|
149 |
+
if (
|
150 |
+
in_array(
|
151 |
+
$block['blockName'],
|
152 |
+
array(
|
153 |
+
$product_block->get_block_name(),
|
154 |
+
$buynow_block->get_block_name(),
|
155 |
+
)
|
156 |
+
)
|
157 |
+
&& @$block['attrs']['id']
|
158 |
+
) {
|
159 |
+
$productIds[] = $block['attrs']['id'];
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( $block['blockName'] == $product_page_block->get_block_name() && @$block['attrs']['default_product_id'] ) {
|
163 |
+
$productIds[] = $block['attrs']['default_product_id'];
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( empty( $productIds ) ) {
|
168 |
+
return array();
|
169 |
+
}
|
170 |
+
|
171 |
+
$result = array();
|
172 |
+
foreach ( $productIds as $id ) {
|
173 |
+
$product = Ecwid_Product::get_by_id( $id );
|
174 |
+
|
175 |
+
$result[$id] = array(
|
176 |
+
'name' => $product->name,
|
177 |
+
'imageUrl' => $product->thumbnailUrl
|
178 |
+
);
|
179 |
+
}
|
180 |
+
|
181 |
+
return $result;
|
182 |
+
}
|
183 |
+
|
184 |
+
public static function get_block_names() {
|
185 |
+
return array(
|
186 |
+
self::STORE_BLOCK,
|
187 |
+
self::PRODUCT_BLOCK,
|
188 |
+
self::BUYNOW_BLOCK,
|
189 |
+
self::PRODUCT_PAGE_BLOCK
|
190 |
+
);
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* @param $post
|
195 |
+
*
|
196 |
+
* @return array
|
197 |
+
*/
|
198 |
+
public static function get_blocks_on_page() {
|
199 |
+
$post = get_post();
|
200 |
+
|
201 |
+
if ( !$post ) return array();
|
202 |
+
|
203 |
+
if ( function_exists( 'gutenberg_parse_blocks' ) ) {
|
204 |
+
$blocks = gutenberg_parse_blocks( $post->post_content );
|
205 |
+
} else {
|
206 |
+
$blocks = parse_blocks( $post->post_content );
|
207 |
+
}
|
208 |
+
|
209 |
+
if ( empty( $blocks ) ) {
|
210 |
+
return array();
|
211 |
+
}
|
212 |
+
|
213 |
+
$result = array();
|
214 |
+
|
215 |
+
$ecwid_blocks = self::get_block_names();
|
216 |
+
foreach ( $blocks as $block ) {
|
217 |
+
if ( in_array( $block['blockName'], $ecwid_blocks ) ) {
|
218 |
+
$result[$block['blockName']] = $block;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
return $result;
|
223 |
+
}
|
224 |
+
|
225 |
+
protected function _get_version_for_assets( $asset_file_path )
|
226 |
+
{
|
227 |
+
if ( $_SERVER['HTTP_HOST'] == 'localhost' ) {
|
228 |
+
return filemtime( ECWID_PLUGIN_DIR . '/' . $asset_file_path );
|
229 |
+
}
|
230 |
+
|
231 |
+
return get_option( 'ecwid_plugin_version' );
|
232 |
+
}
|
233 |
+
|
234 |
+
public static function get_store_block_data_from_current_page() {
|
235 |
+
|
236 |
+
$blocks = self::get_blocks_on_page();
|
237 |
+
|
238 |
+
$store_block = null;
|
239 |
+
foreach ( $blocks as $block ) {
|
240 |
+
if ( $block['blockName'] == self::STORE_BLOCK ) {
|
241 |
+
$store_block = $block;
|
242 |
+
break;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
if ( !$store_block ) return array();
|
247 |
+
|
248 |
+
return $store_block['atts'];
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
$ecwid_gutenberg = new Ecwid_Gutenberg();
|
includes/importer/class-ecwid-importer.php
CHANGED
@@ -46,11 +46,6 @@ class Ecwid_Importer
|
|
46 |
|
47 |
public function tick()
|
48 |
{
|
49 |
-
|
50 |
-
$task = Ecwid_Importer_Task_Create_Product::build(array('woo_id' => '596'));
|
51 |
-
$t = new Ecwid_Importer_Task_Create_Product();
|
52 |
-
$t->execute($this, $task);
|
53 |
-
|
54 |
set_time_limit(0);
|
55 |
$results = array();
|
56 |
|
46 |
|
47 |
public function tick()
|
48 |
{
|
|
|
|
|
|
|
|
|
|
|
49 |
set_time_limit(0);
|
50 |
$results = array();
|
51 |
|
includes/shortcodes/class-ecwid-shortcode-productbrowser.php
CHANGED
@@ -32,7 +32,7 @@ class Ecwid_Shortcode_ProductBrowser extends Ecwid_Shortcode_Base {
|
|
32 |
$default_render = parent::render();
|
33 |
|
34 |
$data = Ecwid_Static_Home_Page::get_data_for_current_page();
|
35 |
-
if ( !$data ) {
|
36 |
return $default_render;
|
37 |
}
|
38 |
|
@@ -56,7 +56,7 @@ HTML;
|
|
56 |
$code .= <<<HTML
|
57 |
<script language="JavaScript">
|
58 |
EcwidStaticPageLoader.processStaticHomePage('static-ecwid', 'dynamic-ecwid');
|
59 |
-
if ( location.hash != '' ) {
|
60 |
EcwidStaticPageLoader.switchToDynamicMode();
|
61 |
}
|
62 |
</script>
|
@@ -66,12 +66,12 @@ HTML;
|
|
66 |
}
|
67 |
|
68 |
public function render_placeholder( ) {
|
69 |
-
|
70 |
$store_id = get_ecwid_store_id();
|
71 |
|
72 |
$plain_content = '';
|
73 |
|
74 |
$html_catalog_params = false;
|
|
|
75 |
|
76 |
if ( Ecwid_Api_V3::is_available() && !Ecwid_Static_Home_Page::get_data_for_current_page() ) {
|
77 |
|
@@ -82,8 +82,13 @@ HTML;
|
|
82 |
}
|
83 |
|
84 |
$html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
|
|
|
85 |
|
86 |
-
if (
|
|
|
|
|
|
|
|
|
87 |
$plain_content = $this->_build_html_catalog($store_id, $html_catalog_params);
|
88 |
}
|
89 |
}
|
@@ -103,8 +108,14 @@ HTML;
|
|
103 |
$result = '';
|
104 |
|
105 |
$classname = $this->_get_html_class_name();
|
|
|
|
|
106 |
$result .= <<<HTML
|
107 |
-
|
|
|
|
|
|
|
|
|
108 |
<script>
|
109 |
function createClass(name,rules){
|
110 |
var style = document.createElement('style');
|
@@ -117,6 +128,10 @@ HTML;
|
|
117 |
}
|
118 |
createClass('#ecwid-html-catalog-$store_id','display:none;');
|
119 |
</script>
|
|
|
|
|
|
|
|
|
120 |
<div id="ecwid-html-catalog-$store_id">{$plain_content}</div>
|
121 |
</div>
|
122 |
HTML;
|
@@ -161,16 +176,21 @@ HTML;
|
|
161 |
|
162 |
} else {
|
163 |
|
164 |
-
$
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
168 |
}
|
169 |
|
170 |
-
$
|
|
|
|
|
|
|
|
|
171 |
}
|
172 |
|
173 |
-
if ( $url && !$
|
174 |
$parsed = parse_url($url);
|
175 |
|
176 |
if ($parsed['fragment']) {
|
@@ -256,7 +276,11 @@ HTML;
|
|
256 |
if (isset($shortcode_params['default_product_id'])) {
|
257 |
$input_params['defaultProductId'] = $shortcode_params['default_product_id'];
|
258 |
}
|
259 |
-
|
|
|
|
|
|
|
|
|
260 |
$this->_params = $input_params;
|
261 |
}
|
262 |
|
32 |
$default_render = parent::render();
|
33 |
|
34 |
$data = Ecwid_Static_Home_Page::get_data_for_current_page();
|
35 |
+
if ( !$data || @$this->_params['noHTMLCatalog'] ) {
|
36 |
return $default_render;
|
37 |
}
|
38 |
|
56 |
$code .= <<<HTML
|
57 |
<script language="JavaScript">
|
58 |
EcwidStaticPageLoader.processStaticHomePage('static-ecwid', 'dynamic-ecwid');
|
59 |
+
if ( location.hash != '' && location.hash.indexOf('#!/c/0/') !== 0) {
|
60 |
EcwidStaticPageLoader.switchToDynamicMode();
|
61 |
}
|
62 |
</script>
|
66 |
}
|
67 |
|
68 |
public function render_placeholder( ) {
|
|
|
69 |
$store_id = get_ecwid_store_id();
|
70 |
|
71 |
$plain_content = '';
|
72 |
|
73 |
$html_catalog_params = false;
|
74 |
+
|
75 |
|
76 |
if ( Ecwid_Api_V3::is_available() && !Ecwid_Static_Home_Page::get_data_for_current_page() ) {
|
77 |
|
82 |
}
|
83 |
|
84 |
$html_catalog_params['default_category_id'] = @ (int)$this->_params['defaultCategoryId'];
|
85 |
+
$html_catalog_params['default_product_id'] = @ (int)$this->_params['defaultProductId'];
|
86 |
|
87 |
+
if (
|
88 |
+
$html_catalog_params !== false
|
89 |
+
&& get_option('ecwid_print_html_catalog', 'Y')
|
90 |
+
&& !@$this->_params['noHTMLCatalog']
|
91 |
+
) {
|
92 |
$plain_content = $this->_build_html_catalog($store_id, $html_catalog_params);
|
93 |
}
|
94 |
}
|
108 |
$result = '';
|
109 |
|
110 |
$classname = $this->_get_html_class_name();
|
111 |
+
|
112 |
+
|
113 |
$result .= <<<HTML
|
114 |
+
<div id="ecwid-store-$store_id" class="ecwid-shopping-cart-$classname" data-ecwid-default-category-id="$html_catalog_params[default_category_id]">
|
115 |
+
HTML;
|
116 |
+
|
117 |
+
if ( ! @$this->_params['noHTMLCatalog'] )
|
118 |
+
$result .= <<<HTML
|
119 |
<script>
|
120 |
function createClass(name,rules){
|
121 |
var style = document.createElement('style');
|
128 |
}
|
129 |
createClass('#ecwid-html-catalog-$store_id','display:none;');
|
130 |
</script>
|
131 |
+
HTML;
|
132 |
+
|
133 |
+
|
134 |
+
$result .= <<<HTML
|
135 |
<div id="ecwid-html-catalog-$store_id">{$plain_content}</div>
|
136 |
</div>
|
137 |
HTML;
|
176 |
|
177 |
} else {
|
178 |
|
179 |
+
$cat_id = intval( $this->_get_param_default_category_id( $params ) );
|
180 |
+
if ( $cat_id ) {
|
181 |
+
$plain_content = $catalog->get_category( $cat_id );
|
182 |
+
} else if ( @$this->_params['defaultProductId'] ) {
|
183 |
+
$plain_content = $catalog->get_product( $this->_params['defaultProductId'] );
|
184 |
}
|
185 |
|
186 |
+
if ( empty( $plain_content ) ) {
|
187 |
+
$plain_content = $catalog->get_category( 0 );
|
188 |
+
} else {
|
189 |
+
$is_default_catalog = true;
|
190 |
+
}
|
191 |
}
|
192 |
|
193 |
+
if ( $url && !$is_default_catalog && !Ecwid_Seo_Links::is_product_browser_url() ) {
|
194 |
$parsed = parse_url($url);
|
195 |
|
196 |
if ($parsed['fragment']) {
|
276 |
if (isset($shortcode_params['default_product_id'])) {
|
277 |
$input_params['defaultProductId'] = $shortcode_params['default_product_id'];
|
278 |
}
|
279 |
+
|
280 |
+
if (isset($shortcode_params['no_html_catalog'])) {
|
281 |
+
$input_params['noHTMLCatalog'] = $shortcode_params['no_html_catalog'];
|
282 |
+
}
|
283 |
+
|
284 |
$this->_params = $input_params;
|
285 |
}
|
286 |
|
includes/themes.php
CHANGED
@@ -68,7 +68,8 @@ function ecwid_apply_theme($theme_name = null)
|
|
68 |
'Divi' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
69 |
'themify-music' => array( Ecwid_Theme_Base::PROP_AJAX_DEFER_RENDERING ),
|
70 |
'bridge' => array( Ecwid_Theme_Base::PROP_AJAX_DEFER_RENDERING ),
|
71 |
-
'Parallax-One' => array( 'css' )
|
|
|
72 |
);
|
73 |
$generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
|
74 |
|
@@ -86,7 +87,9 @@ function ecwid_apply_theme($theme_name = null)
|
|
86 |
'twentyseventeen',
|
87 |
'themify-music',
|
88 |
'Avada',
|
89 |
-
'twentynineteen'
|
|
|
|
|
90 |
);
|
91 |
|
92 |
$custom_themes = apply_filters( 'ecwid_custom_themes', $custom_themes );
|
68 |
'Divi' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
69 |
'themify-music' => array( Ecwid_Theme_Base::PROP_AJAX_DEFER_RENDERING ),
|
70 |
'bridge' => array( Ecwid_Theme_Base::PROP_AJAX_DEFER_RENDERING ),
|
71 |
+
'Parallax-One' => array( 'css' ),
|
72 |
+
'vantage' => array( 'js' )
|
73 |
);
|
74 |
$generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
|
75 |
|
87 |
'twentyseventeen',
|
88 |
'themify-music',
|
89 |
'Avada',
|
90 |
+
'twentynineteen',
|
91 |
+
'woodiex',
|
92 |
+
'enfold'
|
93 |
);
|
94 |
|
95 |
$custom_themes = apply_filters( 'ecwid_custom_themes', $custom_themes );
|
includes/themes/class-ecwid-theme-enfold.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
3 |
+
require_once ECWID_PLUGIN_DIR . '/includes/class-ecwid-stub-renderer.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_Enfold extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
$__ecwid_integration_enfold_builder = new Ecwid_Integration_Enfold_Builder();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
class Ecwid_Integration_Enfold_Builder extends Ecwid_Stub_Renderer
|
16 |
+
{
|
17 |
+
protected function _should_apply() {
|
18 |
+
return isset($_REQUEST['avia_request']);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
return new Ecwid_Theme_Enfold();
|
includes/themes/class-ecwid-theme-woodiex.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once ECWID_THEMES_DIR . '/class-ecwid-theme-base.php';
|
4 |
+
|
5 |
+
class Ecwid_Theme_Woodiex extends Ecwid_Theme_Base
|
6 |
+
{
|
7 |
+
|
8 |
+
public function __construct()
|
9 |
+
{
|
10 |
+
parent::__construct();
|
11 |
+
|
12 |
+
add_filter('wp_get_nav_menu_items', array( $this, 'process_menu_items' ));
|
13 |
+
}
|
14 |
+
|
15 |
+
public function process_menu_items($items)
|
16 |
+
{
|
17 |
+
|
18 |
+
if( is_array($items) ) {
|
19 |
+
foreach($items as $key => $item) {
|
20 |
+
if( !isset($item->ecwid_page_type) || $item->ecwid_page_type != 'category' ) {
|
21 |
+
continue;
|
22 |
+
}
|
23 |
+
|
24 |
+
$items[$key]->ID = 0;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
return $items;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
return new Ecwid_Theme_Woodiex();
|
includes/widgets/class-ecwid-widget-products-base.php
CHANGED
@@ -74,6 +74,8 @@ abstract class Ecwid_Widget_Products_List_Base extends Ecwid_Widget_Base {
|
|
74 |
$this->_print_widget_content( $instance );
|
75 |
$html .= ob_get_contents();
|
76 |
ob_end_clean();
|
|
|
|
|
77 |
|
78 |
return $html;
|
79 |
}
|
74 |
$this->_print_widget_content( $instance );
|
75 |
$html .= ob_get_contents();
|
76 |
ob_end_clean();
|
77 |
+
|
78 |
+
$html .= '</div>';
|
79 |
|
80 |
return $html;
|
81 |
}
|
js/admin-bar.js
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
|
3 |
+
if ( typeof Ecwid != 'undefined' ) {
|
4 |
+
var $post_edit_links = jQuery('[href*="'+ecwidEditPostLinkParams.admin_url+'post.php"]').filter('[href*="action=edit"]'),
|
5 |
+
url = ( $post_edit_links.length ) ? $post_edit_links.eq(0).attr( 'href' ) : false,
|
6 |
+
$bar,
|
7 |
+
text;
|
8 |
+
|
9 |
+
$post_edit_links.each( function() {
|
10 |
+
if( jQuery( this ).closest('#wpadminbar').length ) {
|
11 |
+
$bar = jQuery( this );
|
12 |
+
text = $bar.text();
|
13 |
+
}
|
14 |
+
});
|
15 |
+
|
16 |
+
if( url ) {
|
17 |
+
Ecwid.OnPageLoad.add(function(page){
|
18 |
+
var is_product = ( page.type == 'PRODUCT' ),
|
19 |
+
is_subcategory = ( page.type == 'CATEGORY' && page.categoryId > 0 ),
|
20 |
+
new_url = url;
|
21 |
+
|
22 |
+
if( typeof text != 'undefined' ) new_text = text;
|
23 |
+
|
24 |
+
if( is_product || is_subcategory ) {
|
25 |
+
if( typeof $bar != 'undefined' ) {
|
26 |
+
new_text = ( is_product ) ? ecwidEditPostLinkParams.languages.editProduct : ( is_subcategory ) ? ecwidEditPostLinkParams.languages.editCategory : text;
|
27 |
+
}
|
28 |
+
|
29 |
+
var id = ( is_product ) ? page.productId : page.categoryId,
|
30 |
+
hash = page.type.toLowerCase() + ':mode=edit&id=' + id;
|
31 |
+
|
32 |
+
if( ecwidEditPostLinkParams.is_api_available ) {
|
33 |
+
hash = encodeURIComponent( hash );
|
34 |
+
}
|
35 |
+
|
36 |
+
new_url = ecwidEditPostLinkParams.url + hash;
|
37 |
+
}
|
38 |
+
|
39 |
+
if( typeof $bar != 'undefined' ) {
|
40 |
+
$bar.text( new_text );
|
41 |
+
}
|
42 |
+
|
43 |
+
if( $post_edit_links.length ) {
|
44 |
+
$post_edit_links.attr( 'href', new_url );
|
45 |
+
}
|
46 |
+
});
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
});
|
js/admin-menu.js
CHANGED
@@ -25,6 +25,19 @@ function ecwidRefreshEcwidMenuItemSelection(slug)
|
|
25 |
.closest('li')
|
26 |
.addClass('current')
|
27 |
.closest('.wp-has-submenu3').addClass('wp-has-current-submenu3');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
function ecwidGetCurrentMenuSlug()
|
@@ -151,7 +164,7 @@ jQuery(document).ready(function() {
|
|
151 |
if ( e.data.action == 'pageLoad' ) {
|
152 |
var page = e.data.data.page.path;
|
153 |
|
154 |
-
jQuery('*[data-ecwid-menu-slug=ec-store-admin-' + page + ']').eq(0).click();
|
155 |
} else if (
|
156 |
e.data.action
|
157 |
&& e.data.action == 'navigationMenuUpdated'
|
25 |
.closest('li')
|
26 |
.addClass('current')
|
27 |
.closest('.wp-has-submenu3').addClass('wp-has-current-submenu3');
|
28 |
+
|
29 |
+
ecwidSetCurrentPageTitle( selector );
|
30 |
+
}
|
31 |
+
|
32 |
+
function ecwidSetCurrentPageTitle(selector) {
|
33 |
+
var delimiter = String.fromCharCode(8249),
|
34 |
+
title_splited = document.title.split( delimiter ),
|
35 |
+
title = jQuery(selector).last().text();
|
36 |
+
|
37 |
+
if( title_splited.length ) {
|
38 |
+
title += ' ' + delimiter + ' ' + title_splited[title_splited.length-1];
|
39 |
+
}
|
40 |
+
document.title = title;
|
41 |
}
|
42 |
|
43 |
function ecwidGetCurrentMenuSlug()
|
164 |
if ( e.data.action == 'pageLoad' ) {
|
165 |
var page = e.data.data.page.path;
|
166 |
|
167 |
+
jQuery('*[data-ecwid-menu-slug="ec-store-admin-' + page + '"]').eq(0).click();
|
168 |
} else if (
|
169 |
e.data.action
|
170 |
&& e.data.action == 'navigationMenuUpdated'
|
js/dynamic-title.js
CHANGED
@@ -2,20 +2,39 @@ jQuery(document).ready(function() {
|
|
2 |
if ( jQuery( '.entry-title' ).length > 0 && typeof Ecwid !== 'undefined' ) {
|
3 |
Ecwid.OnPageLoaded.add(function(page) {
|
4 |
|
5 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
if ( el.length === 0 ) return;
|
7 |
|
8 |
var isCategory = page.type === 'CATEGORY';
|
9 |
var isProduct = page.type === 'PRODUCT';
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
var newTitle = jQuery('title').html();
|
14 |
-
|
15 |
-
if ( isCategory && page.categoryId === 0 || newTitle.length === 0 ) {
|
16 |
-
newTitle = ecwidOriginalTitle.title;
|
17 |
-
}
|
18 |
-
|
19 |
el.html( newTitle );
|
20 |
});
|
21 |
}
|
2 |
if ( jQuery( '.entry-title' ).length > 0 && typeof Ecwid !== 'undefined' ) {
|
3 |
Ecwid.OnPageLoaded.add(function(page) {
|
4 |
|
5 |
+
var alreadyFoundEl = jQuery('h1[data-ecwid-found-title]');
|
6 |
+
var el = false;
|
7 |
+
|
8 |
+
if ( alreadyFoundEl .length > 0 ) {
|
9 |
+
el = alreadyFoundEl;
|
10 |
+
} else {
|
11 |
+
el = jQuery('h1').filter(
|
12 |
+
function(idx, el) {
|
13 |
+
if ( el.innerText == ecwidOriginalTitle.initialTitle )
|
14 |
+
return true;
|
15 |
+
}
|
16 |
+
);
|
17 |
+
|
18 |
+
if ( el.length > 0 ) {
|
19 |
+
el.attr('data-ecwid-found-title', 'true');
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
if ( el.length === 0 ) return;
|
24 |
|
25 |
var isCategory = page.type === 'CATEGORY';
|
26 |
var isProduct = page.type === 'PRODUCT';
|
27 |
|
28 |
+
var isNotPbPage = !isCategory && !isProduct;
|
29 |
+
var isHomePage = isCategory && page.categoryId === 0;
|
30 |
+
|
31 |
+
var newTitle = '';
|
32 |
+
if ( isNotPbPage || isHomePage ) {
|
33 |
+
newTitle = ecwidOriginalTitle.mainPageTitle;
|
34 |
+
} else {
|
35 |
+
newTitle = jQuery('title').html();
|
36 |
+
}
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
el.html( newTitle );
|
39 |
});
|
40 |
}
|
js/frontend.js
CHANGED
@@ -37,4 +37,5 @@ jQuery(document).ready(function() {
|
|
37 |
};
|
38 |
|
39 |
ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
|
|
|
40 |
});
|
37 |
};
|
38 |
|
39 |
ecwidShoppingCartMakeStoreLinksUseApiCall(jQuery("a[data-ecwid-page]"));
|
40 |
+
|
41 |
});
|
js/gutenberg/blocks.build.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){function t(r){if(n[r])return n[r].exports;var l=n[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1),n(5)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=n(2),o=(n.n(l),n(3)),i=(n.n(o),n(4)),a=wp.i18n,c=a.__,s=(a._x,i.a,wp.blocks),p=(s.BlockControls,s.registerBlockType),u=wp.editor,m=u.InspectorControls,d=(u.AlignmentToolbar,u.withColors,wp.components),w=d.PanelBody,g=d.PanelRow,h=d.ToggleControl,_=d.ButtonGroup,f=d.Button,b=(d.IconButton,d.BaseControl),E=d.Toolbar,v=d.ColorPalette,y=d.ColorIndicator,x=wp.compose.withState;wp.element.Fragment;p("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:"ec-store",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,n){return wp.element.createElement(h,{label:n,checked:e.attributes[t],onChange:function(){return e.setAttributes(r({},t,!e.attributes[t]))}})}function n(e,t,n,l){return wp.element.createElement(b,{label:n},wp.element.createElement(E,{controls:l.map(function(n){return{icon:i.a[n.icon],title:n.title,isActive:e.attributes[t]===n.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(r({},t,n.value))}}})}))}function l(e,t,n,l){return wp.element.createElement(b,{label:n},wp.element.createElement("select",{onChange:function(n){e.setAttributes(r({},t,n.target.value))}},l.map(function(n){return wp.element.createElement("option",{value:n.value,selected:e.attributes[t]==n.value},n.title)})))}function o(e,t,n){return wp.element.createElement(b,{label:n},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(n){e.setAttributes(r({},t,n.target.value))}}))}function a(e,t,n,l){return wp.element.createElement(b,{label:n},wp.element.createElement(_,null,l.map(function(n){return wp.element.createElement(f,{isDefault:!0,isButton:!0,isPrimary:P[t]==n.value,onClick:function(){return e.setAttributes(r({},t,n.value))}},n.title)})))}function s(e,t){return wp.element.createElement(b,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}function p(e,r,i){var c=EcwidGutenbergStoreBlockParams.attributes[r];return"undefined"===typeof i&&(i=c.type),"default_category_id"===i&&(i=c.values&&c.values.length>1?"select":"textbox"),"buttonGroup"===i?a(e,c.name,c.title,c.values):"toolbar"===i?n(e,c.name,c.title,c.values):"select"===i?l(e,c.name,c.title,c.values):"colorPalette"===i?u(e,c.name,c.title):"text"===i?s(c.title,c.message):"textbox"===i?o(e,c.name,c.title):t(e,c.name,c.title)}function u(e,t,n){var l=wp.element.createElement("span",null,n,wp.element.createElement(y,{colorValue:P[t]}));return wp.element.createElement(b,{label:l,className:"ec-store-color-picker"},wp.element.createElement(v,{value:P[t],colors:B,onChange:function(n){return e.setAttributes(r({},t,n))}}))}function d(e){function t(e){o(function(t){return{manual:"manual",color:e}}),a.setAttributes(r({},i,e))}var n=e.manual,l=e.color,o=e.setState,i=arguments[0].name,a=arguments[0].props,s=EcwidGutenbergStoreBlockParams.attributes[i].title,p=null===n&&null!==a.attributes[i]&&""!==a.attributes[i]||"manual"===n;p?null!==l&&a.setAttributes(r({},i,l)):a.setAttributes(r({},i,null));var u=a.attributes[i],m=wp.element.createElement("span",null,s,null!==u&&wp.element.createElement(y,{colorValue:P[i]}));return wp.element.createElement(b,{label:m,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:!p},c("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:p},c("Set manually","ecwid-shopping-cart"))),p&&wp.element.createElement(v,{value:u,colors:B,onChange:t}))}function k(e){var t=e.count,n=e.setState;return wp.element.createElement("div",null,wp.element.createElement("button",{onClick:function(){return n(function(e){return{count:e.count+1}})}},"text ",t," ",arguments[0].color))}var P=e.attributes;e.setAttributes({widgets:""});var C=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")))),B=[{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"}],G=x({manual:null,color:null})(d),N=(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"))),S=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),A=EcwidGutenbergStoreBlockParams.is_new_details_page,T=EcwidGutenbergStoreBlockParams.attributes.default_category_id&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values&&EcwidGutenbergStoreBlockParams.attributes.default_category_id.values.length>0;return[C,wp.element.createElement(m,null,T&&wp.element.createElement(w,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&p(e,"product_list_category_title_behavior","select"),O&&"SHOW_TEXT_ONLY"!==P.product_list_category_title_behavior&&p(e,"product_list_category_image_size","buttonGroup"),O&&"SHOW_TEXT_ONLY"!==P.product_list_category_title_behavior&&p(e,"product_list_category_image_aspect_ratio","toolbar"),!O&&N),wp.element.createElement(w,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},O&&p(e,"product_list_show_product_images","toggle"),O&&P.product_list_show_product_images&&p(e,"product_list_image_size","buttonGroup"),O&&P.product_list_show_product_images&&p(e,"product_list_image_aspect_ratio","toolbar"),O&&p(e,"product_list_product_info_layout","toolbar"),O&&p(e,"product_list_title_behavior","select"),O&&p(e,"product_list_price_behavior","select"),O&&p(e,"product_list_sku_behavior","select"),O&&p(e,"product_list_buybutton_behavior","select"),O&&p(e,"product_list_show_additional_image_on_hover","toggle"),O&&p(e,"product_list_show_frame","toggle"),!O&&N),wp.element.createElement(w,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},A&&p(e,"product_details_layout","select"),A&&("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"==P.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"==P.product_details_layout)&&p(e,"show_description_under_image","toggle"),A&&p(e,"product_details_gallery_layout","toolbar"),A&&wp.element.createElement(g,null,wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Product sidebar content","ecwid-shopping-cart"))),A&&p(e,"product_details_show_product_name","toggle"),A&&p(e,"product_details_show_breadcrumbs","toggle"),A&&p(e,"product_details_show_product_sku","toggle"),A&&p(e,"product_details_show_product_price","toggle"),A&&p(e,"product_details_show_qty","toggle"),A&&p(e,"product_details_show_number_of_items_in_stock","toggle"),A&&p(e,"product_details_show_in_stock_label","toggle"),A&&p(e,"product_details_show_wholesale_prices","toggle"),A&&p(e,"product_details_show_share_buttons","toggle"),!A&&N),T&&wp.element.createElement(w,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},p(e,"default_category_id","default_category_id")),wp.element.createElement(w,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},p(e,"show_categories","toggle"),p(e,"show_search","toggle"),p(e,"show_breadcrumbs","toggle"),O&&p(e,"show_footer_menu","toggle"),p(e,"show_signin_link","toggle"),p(e,"product_list_show_sort_viewas_options","toggle"),S),wp.element.createElement(w,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},wp.element.createElement(G,{props:e,name:"chameleon_color_button"}),wp.element.createElement(G,{props:e,name:"chameleon_color_foreground"}),wp.element.createElement(G,{props:e,name:"chameleon_color_price"}),wp.element.createElement(G,{props:e,name:"chameleon_color_link"}),wp.element.createElement(G,{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 n={widgets:t.join(" "),default_category_id:"undefined"!=typeof e.attributes.default_category_id?e.attributes.default_category_id:0};return new wp.shortcode({tag:EcwidGutenbergParams.storeShortcodeName,attrs:n,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={},n=["widgets","default_category_id"],r=0;r<n.length;r++)t[n[r]]=e.attributes[n[r]];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"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],transforms:{from:[{type:"shortcode",tag:["ecwid","ec_store"],attributes:{default_category_id:{type:"integer",shortcode:function(e){return e.default_category_id}},show_categories:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("categories")}},show_search:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("search")}}},priority:10}]}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r={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"})))),galleryLayoutHorizontal:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.000000, 20.500000) rotate(-180.000000) translate(-20.000000, -20.500000) translate(10.000000, 11.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"14",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"6"})))),galleryLayoutVertical:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(19.500000, 20.000000) rotate(-270.000000) translate(-19.500000, -20.000000) translate(9.500000, 10.500000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"-1.13686838e-13",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"-1.13686838e-13",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"13",width:"5",height:"6"})))),galleryLayoutFeed:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.500000, 12.500000) rotate(-270.000000) translate(-20.500000, -12.500000) translate(14.000000, 3.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})),wp.element.createElement("g",{transform:"translate(20.500000, 27.500000) rotate(-270.000000) translate(-20.500000, -27.500000) translate(14.000000, 18.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}))))}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=n(6),o=(n.n(l),n(7));n.n(o);if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,a=i.__,c=i._x,s=wp.blocks,p=(s.BlockControls,s.registerBlockType),u=wp.editor,m=u.InspectorControls,d=(u.AlignmentToolbar,u.withColors,wp.components),w=d.PanelBody,g=(d.PanelRow,d.ToggleControl);d.ButtonGroup,d.Button,d.IconButton,d.BaseControl,d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,wp.element.Fragment;p("ecwid/product-block",{title:EcwidGutenbergParams.productBlockTitle,icon:wp.element.createElement("svg",{className:"dashicon",viewBox:"0 0 20 20",width:"20",height:"20"},wp.element.createElement("path",{d:EcwidGutenbergParams.productIcon})),category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:a("Display product with a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,n){return wp.element.createElement(g,{label:n,checked:e.attributes[t],onChange:function(){return e.setAttributes(r({},t,!e.attributes[t]))}})}function n(e){ecwid_open_product_popup({saveCallback:o,props:e})}var l=e.attributes,o=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block"},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.productIcon})),EcwidGutenbergParams.yourProductLabel),EcwidGutenbergParams.products&&l.id&&EcwidGutenbergParams.products[l.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[l.id].imageUrl})),EcwidGutenbergParams.products&&l.id&&EcwidGutenbergParams.products[l.id]&&wp.element.createElement("div",{className:"ec-store-block-title"},EcwidGutenbergParams.products[l.id].name),!l.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:o,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(m,null,l.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},a("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[l.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[l.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return n(e)}},a("Change","ecwid-shopping-cart")))),!l.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return n(e)}},a("Choose product","ecwid-shopping-cart"))),wp.element.createElement(w,{title:c("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",a("Picture","ecwid-shopping-cart")),t(e,"show_title",a("Title","ecwid-shopping-cart")),t(e,"show_price",a("Price","ecwid-shopping-cart")),t(e,"show_options",a("Options","ecwid-shopping-cart")),t(e,"show_qty",a("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",a("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(w,{title:a("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",a("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",a("Add border","ecwid-shopping-cart")),t(e,"center_align",a("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){}]);
|
1 |
+
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n={ecwid: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"})),store:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"store-icon",transform:"translate(234.000000, 324.000000)"},wp.element.createElement("path",{d:"M9,20.4893188 L7,20.4893188 L7,14 C7,13.4477153 7.44771525,13 8,13 L16,13 C16.5522847,13 17,13.4477153 17,14 L17,20.4893188 C16.260376,20.4893188 15.5929565,20.4893188 15,20.4893188 L15,15 L9,15 L9,20.4893188 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M20,10 L22,10 L22,21.0006104 C22,21.5528951 21.5522847,22.0006104 21,22.0006104 L3,22.0006104 C2.44771525,22.0006104 2,21.5528951 2,21.0006104 L2,10 L4,10 L4,20.0006104 L20,20.0006104 L20,10 Z",id:"Rectangle-3"}),wp.element.createElement("path",{d:"M2,6.5 C2,7.88071187 3.11928813,9 4.5,9 C5.18185515,9 5.81786053,8.72707728 6.28575907,8.24959145 L7,7.52071565 L7.71424093,8.24959145 C8.18213947,8.72707728 8.81814485,9 9.5,9 C10.1818552,9 10.8178605,8.72707728 11.2857591,8.24959145 L12,7.52071565 L12.7142409,8.24959145 C13.1821395,8.72707728 13.8181448,9 14.5,9 C15.1818552,9 15.8178605,8.72707728 16.2857591,8.24959145 L17,7.52071565 L17.7142409,8.24959145 C18.1821395,8.72707728 18.8181448,9 19.5,9 C20.8807119,9 22,7.88071187 22,6.5 C22,5.81342077 21.7917279,4.97737648 21.3637104,4 L2.63518632,4 C2.20791709,4.97255801 2,5.80837301 2,6.5 Z M4.5,11 C2.01471863,11 4.4408921e-16,8.98528137 0,6.5 C0,5.33310646 0.374574518,4.02209564 1.10468286,2.55457075 L1.38058736,2 L22.6207487,2 L22.8961752,2.55629959 C23.6256977,4.02977127 24,5.33982925 24,6.5 C24,8.98528137 21.9852814,11 19.5,11 C18.5937006,11 17.7289225,10.73006 17,10.2422809 C16.2710775,10.73006 15.4062994,11 14.5,11 C13.5937006,11 12.7289225,10.73006 12,10.2422809 C11.2710775,10.73006 10.4062994,11 9.5,11 C8.59370056,11 7.72892246,10.73006 7,10.2422809 C6.27107754,10.73006 5.40629944,11 4.5,11 Z",id:"Combined-Shape"}))))),product:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"icon-product",transform:"translate(352.000000, 324.000000)"},wp.element.createElement("path",{d:"M4,9 L4,20 L20,20 L20,9 L4,9 Z M2,7 L22,7 L22,22 L2,22 L2,7 Z",id:"Rectangle-2-Copy-2"}),wp.element.createElement("path",{d:"M9,7 L15,7 L15,15 L12.0361633,14 L9,15 L9,7 Z M11,9 L11,12 L12.0361633,11.5393066 L13,12 L13,9 L11,9 Z",id:"Combined-Shape"}),wp.element.createElement("polygon",{id:"Line-3",points:"13 9 11 9 11 2 13 2"}),wp.element.createElement("polygon",{id:"Rectangle-2-Copy-2",points:"17.0387503 4 19.4387503 7 22 7 18 2 6 2 2 7 4.56124969 7 6.96124969 4"}))))),aspect169:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"9",y:"14",width:"22",height:"12",rx:"2"}))),aspect916:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"}," ",wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"14",y:"9",width:"12",height:"22",rx:"2"}))),aspect11:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"12",width:"16",height:"16",rx:"2"}))),aspect34:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"12",y:"10",width:"16",height:"20",rx:"2"}))),aspect43:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"10",y:"12",width:"20",height:"16",rx:"2"}))),textalignleft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textaligncenter:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"16",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"12",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"16",y:"22",width:"8",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignright:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"16",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"14",y:"19",width:"13",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"22",width:"9",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),textalignjustify:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",zoomAndPan:"1.5",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"13",y:"13",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"16",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"19",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"22",width:"14",height:"2"}),wp.element.createElement("rect",{fill:"#000000",x:"13",y:"25",width:"14",height:"2"}))),productLayout3Columns:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",transform:"translate(13.000000, 19.500000) rotate(-270.000000) translate(-13.000000, -19.500000) ",x:"3.5",y:"16.5",width:"19",height:"6",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"18",y:"10",width:"5",height:"19"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"10",width:"5",height:"8"}),wp.element.createElement("rect",{fill:"#000000",x:"25",y:"19",width:"5",height:"10"}))),productLayout2ColumnsLeft:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("rect",{fill:"#000000",x:"17",y:"10",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"10",width:"5",height:"5"}),wp.element.createElement("rect",{fill:"#000000",x:"10",y:"17",width:"5",height:"12"}))),productLayout2ColumnsRight:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"12"})))),productLayout2ColumnsBottom:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(10.000000, 10.000000)",fill:"#000000"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"12",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"12"}),wp.element.createElement("rect",{x:"0",y:"14",width:"20",height:"5"})))),galleryLayoutHorizontal:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.000000, 20.500000) rotate(-180.000000) translate(-20.000000, -20.500000) translate(10.000000, 11.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"0",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"14",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"6"})))),galleryLayoutVertical:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(19.500000, 20.000000) rotate(-270.000000) translate(-19.500000, -20.000000) translate(9.500000, 10.500000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"-1.13686838e-13",width:"13",height:"19",rx:"1"}),wp.element.createElement("rect",{x:"15",y:"-1.13686838e-13",width:"5",height:"6"}),wp.element.createElement("rect",{x:"15",y:"7",width:"5",height:"5"}),wp.element.createElement("rect",{x:"15",y:"13",width:"5",height:"6"})))),galleryLayoutFeed:wp.element.createElement("svg",{width:"40px",height:"40px",viewBox:"0 0 40 40",version:"1.1"},wp.element.createElement("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{transform:"translate(20.500000, 12.500000) rotate(-270.000000) translate(-20.500000, -12.500000) translate(14.000000, 3.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})),wp.element.createElement("g",{transform:"translate(20.500000, 27.500000) rotate(-270.000000) translate(-20.500000, -27.500000) translate(14.000000, 18.000000)",fill:"#000000","fill-rule":"nonzero"},wp.element.createElement("rect",{x:"0",y:"0",width:"13",height:"19",rx:"1"})))),cart:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-352.000000, -415.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(352.000000, 415.000000)"},wp.element.createElement("path",{d:"M4.5269723,4 L2,4 C1.44771525,4 1,3.55228475 1,3 C1,2.44771525 1.44771525,2 2,2 L5.33333333,2 C5.80393835,2 6.21086155,2.32812702 6.31061146,2.788039 L7.22413999,7 L21,7 C21.6640252,7 22.143636,7.63527258 21.9617572,8.27390353 L19.968471,15.272927 C19.8460922,15.7026358 19.4535094,15.9990234 19.0067139,15.9990234 L7.93579102,15.9990234 C7.465186,15.9990234 7.0582628,15.6708964 6.95851289,15.2109844 L4.5269723,4 Z M7.65791824,9 L8.74215205,13.9990234 L18.2517453,13.9990234 L19.6754416,9 L7.65791824,9 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"9",cy:"20",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"18",cy:"20",r:"2"}))))),search:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-469.000000, -324.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"search-icon",transform:"translate(469.000000, 324.000000)"},wp.element.createElement("path",{d:"M3.83470744,16.348799 C3.83470744,15.7965143 4.28242269,15.348799 4.83470744,15.348799 C5.38699219,15.348799 5.83470744,15.7965143 5.83470744,16.348799 L5.81335241,21.7511152 C5.81335241,22.3033999 5.36563716,22.7511152 4.81335241,22.7511152 C4.26106766,22.7511152 3.81335241,22.3033999 3.81335241,21.7511152 L3.83470744,16.348799 Z",id:"Line-2",transform:"translate(4.824030, 19.049957) scale(-1, 1) rotate(-45.000000) translate(-4.824030, -19.049957) "}),wp.element.createElement("path",{d:"M13,18 C16.8659932,18 20,14.8659932 20,11 C20,7.13400675 16.8659932,4 13,4 C9.13400675,4 6,7.13400675 6,11 C6,14.8659932 9.13400675,18 13,18 Z M13,20 C8.02943725,20 4,15.9705627 4,11 C4,6.02943725 8.02943725,2 13,2 C17.9705627,2 22,6.02943725 22,11 C22,15.9705627 17.9705627,20 13,20 Z",id:"Oval",transform:"translate(13.000000, 11.000000) scale(-1, 1) translate(-13.000000, -11.000000) "}),wp.element.createElement("path",{d:"M17,6 C17.5522847,6 18,6.44771525 18,7 C18,7.55228475 17.5522847,8 17,8 C15.0670034,8 13.5,9.56700338 13.5,11.5 C13.5,12.0522847 13.0522847,12.5 12.5,12.5 C11.9477153,12.5 11.5,12.0522847 11.5,11.5 C11.5,8.46243388 13.9624339,6 17,6 Z",id:"Oval",transform:"translate(14.750000, 9.250000) scale(-1, 1) translate(-14.750000, -9.250000) "}))))),categories:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-234.000000, -416.000000)"},wp.element.createElement("g",{id:"categories-icon",transform:"translate(234.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Triangle",fill:"#555D66",points:"3 2 5.5 7 0.5 7"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 6 8 4 23 4 23 6"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 13 8 11 23 11 23 13"}),wp.element.createElement("polygon",{id:"Line",fill:"#555D66","fill-rule":"nonzero",points:"8 20 8 18 23 18 23 20"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"11",width:"2",height:"2"}),wp.element.createElement("rect",{id:"Rectangle",stroke:"#555D66","stroke-width":"2",fill:"#FFFFFF",x:"2",y:"18",width:"2",height:"2",rx:"1"}))))),category:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -416.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"category-icon",transform:"translate(470.000000, 416.000000)"},wp.element.createElement("polygon",{id:"Line-4",points:"3 4 3 2 21 2 21 4"}),wp.element.createElement("path",{d:"M5,17 L5,20 L9,20 L9,17 L5,17 Z M3,15 L11,15 L11,22 L3,22 L3,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M5,8 L5,11 L9,11 L9,8 L5,8 Z M3,6 L11,6 L11,13 L3,13 L3,6 Z",id:"Rectangle-2-Copy"}),wp.element.createElement("path",{d:"M15,17 L15,20 L19,20 L19,17 L15,17 Z M13,15 L21,15 L21,22 L13,22 L13,15 Z",id:"Rectangle-2"}),wp.element.createElement("path",{d:"M15,8 L15,11 L19,11 L19,8 L15,8 Z M13,6 L21,6 L21,13 L13,13 L13,6 Z",id:"Rectangle-2-Copy-3"}))))),button:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-345.000000, -280.000000)",fill:"#555D66","fill-rule":"nonzero"},wp.element.createElement("g",{id:"button-icon",transform:"translate(345.000000, 280.000000)"},wp.element.createElement("path",{d:"M4,8 L4,16 L20,16 L20,8 L4,8 Z M4,6 L20,6 C21.1045695,6 22,6.8954305 22,8 L22,16 C22,17.1045695 21.1045695,18 20,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,8 C2,6.8954305 2.8954305,6 4,6 Z",id:"Rectangle-5"}),wp.element.createElement("path",{d:"M13.8320367,9.8101295 C14.2137832,9.41102047 14.8467917,9.3969454 15.2459008,9.77869195 C15.6450098,10.1604385 15.6590849,10.793447 15.2773383,11.192556 L12.2122748,14.3970238 C11.8300377,14.7966458 11.1960253,14.8101668 10.7970986,14.427204 L9.5128579,13.1943549 C9.11444327,12.8118837 9.10151859,12.1788506 9.48398981,11.780436 C9.86646103,11.3820214 10.4994941,11.3690967 10.8979087,11.7515679 L11.4594438,12.290632 L13.8320367,9.8101295 Z",id:"Line-6"}))))),productPreview:wp.element.createElement("svg",{width:"72px",height:"72px",viewBox:"0 0 72 72",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets",transform:"translate(-625.000000, -811.000000)",fill:"#AAAAAA"},wp.element.createElement("g",{id:"Group-2",transform:"translate(571.000000, 756.000000)"},wp.element.createElement("g",{id:"product-preview",transform:"translate(54.000000, 55.000000)"},wp.element.createElement("path",{d:"M6,25 L6,69 L66,69 L66,25 L6,25 Z M4,23 L68,23 L68,71 L4,71 L4,23 Z",id:"Rectangle-2-Copy-2","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M36.5,23.5 L65.836706,23.5 L67.2237665,22.8226349 L55.0328393,7.34740904 L39.8812213,0.895706316 L40.7501329,7.5 L17.0403124,7.5 L5.04031242,22.5 L6.32093727,22.5 L17.5209373,8.5 L36.5,8.5 L36.5,23.5 Z M42.9573255,16.6099474 L41.1011835,2.50206036 L54.4056315,8.16722056 L66.5284549,23.5566573 L42.9573255,16.6099474 Z",id:"Combined-Shape",stroke:"#AAAAAA"}),wp.element.createElement("path",{d:"M29.8056641,41.53125 C29.9375,38.2060547 32.2080078,35.6865234 36.4560547,35.6865234 C40.3232422,35.6865234 42.9306641,37.9863281 42.9306641,41.1210938 C42.9306641,43.3916016 41.7880859,44.9882812 39.8544922,46.1455078 C37.9648438,47.2587891 37.4228516,48.0351562 37.4228516,49.5439453 L37.4228516,50.4375 L34.390625,50.4375 L34.3759766,49.265625 C34.3027344,47.2001953 35.1962891,45.8818359 37.203125,44.6806641 C38.9755859,43.6113281 39.6054688,42.7617188 39.6054688,41.2529297 C39.6054688,39.5976562 38.3017578,38.3818359 36.2949219,38.3818359 C34.2734375,38.3818359 32.9697266,39.5976562 32.8378906,41.53125 L29.8056641,41.53125 Z M35.9287109,57.2197266 C34.859375,57.2197266 34.0097656,56.3994141 34.0097656,55.3300781 C34.0097656,54.2607422 34.859375,53.4404297 35.9287109,53.4404297 C37.0273438,53.4404297 37.8623047,54.2607422 37.8623047,55.3300781 C37.8623047,56.3994141 37.0273438,57.2197266 35.9287109,57.2197266 Z",id:"?"})))))),filters:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"square"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-354.000000, -500.000000)",stroke:"#555D66","stroke-width":"2"},wp.element.createElement("g",{id:"filter-icon",transform:"translate(354.000000, 500.000000)"},wp.element.createElement("path",{d:"M3,6 L21,6",id:"Line-5"}),wp.element.createElement("path",{d:"M7,12 L17,12",id:"Line-5"}),wp.element.createElement("path",{d:"M10,18 L14,18",id:"Line-5"}))))),cartPage:wp.element.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1"},wp.element.createElement("g",{id:"Typography",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},wp.element.createElement("g",{id:"gutenberg-widgets-icons",transform:"translate(-470.000000, -500.000000)",fill:"#555D66"},wp.element.createElement("g",{id:"cart-icon",transform:"translate(470.000000, 500.000000)"},wp.element.createElement("g",{id:"Group-6",transform:"translate(2.000000, 3.000000)"},wp.element.createElement("path",{d:"M2.5269723,1 L0,1 C-0.55228475,1 -1,0.55228475 -1,-1.11022302e-16 C-1,-0.55228475 -0.55228475,-1 0,-1 L3.33333333,-1 C3.80393835,-1 4.21086155,-0.671872981 4.31061146,-0.211960997 L6.74215205,10.9990234 L16.2517453,10.9990234 L17.6754416,6 L17.0067139,6 C16.4544291,6 16.0067139,5.55228475 16.0067139,5 C16.0067139,4.44771525 16.4544291,4 17.0067139,4 L19,4 C19.6640252,4 20.143636,4.63527258 19.9617572,5.27390353 L17.968471,12.272927 C17.8460922,12.7026358 17.4535094,12.9990234 17.0067139,12.9990234 L5.93579102,12.9990234 C5.465186,12.9990234 5.0582628,12.6708964 4.95851289,12.2109844 L2.5269723,1 Z",id:"Path-3","fill-rule":"nonzero"}),wp.element.createElement("path",{d:"M13.6266547,1.30878828 C14.0084012,0.909679249 14.6414097,0.895604177 15.0405188,1.27735072 C15.4396278,1.65909727 15.4537029,2.29210579 15.0719563,2.69121482 L11.0068929,6.89568259 C10.6246557,7.29530459 9.99064332,7.30882561 9.59171662,6.92586281 L7.61584318,5.00113813 C7.21742856,4.61866691 7.20450388,3.98563386 7.5869751,3.58721924 C7.96944632,3.18880462 8.60247937,3.17587994 9.00089399,3.55835116 L10.2540618,4.78929076 L13.6266547,1.30878828 Z",id:"Line-6","fill-rule":"nonzero"}),wp.element.createElement("circle",{id:"Oval-2",cx:"7",cy:"17",r:"2"}),wp.element.createElement("circle",{id:"Oval-2",cx:"16",cy:"17",r:"2"}))))))}},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=t.attributes,o=function(e,t,o,l){return wp.element.createElement(u,{label:o},wp.element.createElement(d,null,l.map(function(o){return wp.element.createElement(m,{isDefault:!0,isButton:!0,isPrimary:r[t]===o.value,onClick:function(){return e.setAttributes(n({},t,o.value))}},o.title)})))},l=function(e,t,r){return wp.element.createElement(w,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})},a=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement("select",{onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:parseInt(e.attributes[t])==r.value},r.title)})))},i=function(e,t,r){return wp.element.createElement(u,{label:r},wp.element.createElement("input",{type:"text",value:e.attributes[t],onChange:function(r){e.setAttributes(n({},t,r.target.value))}}))},p=function(e,t,r,o){return wp.element.createElement(u,{label:r},wp.element.createElement(g,{controls:o.map(function(r){return{icon:c.a[r.icon],title:r.title,isActive:e.attributes[t]===r.value,className:"ecwid-toolbar-icon",onClick:function(){return e.setAttributes(n({},t,r.value))}}})}))};return{buttonGroup:function(r){var n=e[r];return o(t,n.name,n.title,n.values)},toggle:function(r){var n=e[r];return l(t,n.name,n.title)},select:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=e[r];return a(t,o.name,n||o.title,o.values)},textbox:function(r){var n=e[r];return builtTextbox(t,n.name,n.title)},toolbar:function(r){var n=e[r];return p(t,n.name,n.title,n.values)},color:function(r){return wp.element.createElement(s.a,{props:t,name:r,title:e[r].title})},defaultCategoryId:function(r){var n=e[r];return n.values&&n.values.length>1?a(t,n.name,n.title,n.values):i(t,n.name,n.title)}}}function l(e){return wp.element.createElement("div",{className:"ec-store-inspector-subheader-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},e))}function a(e){return wp.element.createElement("div",{className:"ec-store-block ec-store-generic-block"},wp.element.createElement("div",{className:"ec-store-block-header"},e.icon,e.title),wp.element.createElement("div",{className:"ec-store-block-content"},e.children),e.showDemoButton&&wp.element.createElement("div",null,wp.element.createElement("a",{className:"button button-primary",href:"admin.php?page=ec-store"},h("Set up your store","ecwid-shopping-cart"))))}function i(e){var t=EcwidGutenbergParams.imagesUrl+e.src;return wp.element.createElement("img",{src:t})}r.d(t,"a",function(){return o}),r.d(t,"c",function(){return l}),r.d(t,"b",function(){return i}),r.d(t,"d",function(){return a});var c=r(0),s=r(6),p=wp.components,d=p.ButtonGroup,m=p.Button,u=p.BaseControl,g=p.Toolbar,w=p.ToggleControl,h=wp.i18n.__},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(3),r(7),r(10),r(13),r(16),r(19),r(22),r(25),r(28),r(31)},function(e,t,r){"use strict";var n=r(4),o=(r.n(n),r(5)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=(d.PanelRow,d.ToggleControl,d.ButtonGroup,d.Button,d.BaseControl),g=(d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ecwid/store-block"]);s("ecwid/store-block",{title:g.title,icon:l.a.store,category:"ec-store",attributes:g.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){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.store,title:c("Store Home Page"),showDemoButton:g.isDemoStore},wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product1"}),wp.element.createElement("div",{className:"ec-store-product2"}),wp.element.createElement("div",{className:"ec-store-product3"})),wp.element.createElement("div",{className:"ec-store-products"},wp.element.createElement("div",{className:"ec-store-product4"}),wp.element.createElement("div",{className:"ec-store-product5"}),wp.element.createElement("div",{className:"ec-store-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),g.customizeMinicartText),s=(t("",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")),g.isNewProductList),d=g.isNewDetailsPage,w=g.attributes.default_category_id&&g.attributes.default_category_id.values&&g.attributes.default_category_id.values.length>0,h=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,w&&wp.element.createElement(m,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[h.buttonGroup("product_list_category_image_size"),h.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[h.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[h.buttonGroup("product_list_image_size"),h.toolbar("product_list_image_aspect_ratio")],h.toolbar("product_list_product_info_layout"),h.select("product_list_title_behavior"),h.select("product_list_price_behavior"),h.select("product_list_sku_behavior"),h.select("product_list_buybutton_behavior"),h.toggle("product_list_show_additional_image_on_hover"),h.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(m,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[h.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&h.toggle("show_description_under_image"),h.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),h.toggle("product_details_show_product_name"),h.toggle("product_details_show_breadcrumbs"),h.toggle("product_details_show_product_sku"),h.toggle("product_details_show_product_price"),h.toggle("product_details_show_qty"),h.toggle("product_details_show_number_of_items_in_stock"),h.toggle("product_details_show_in_stock_label"),h.toggle("product_details_show_wholesale_prices"),h.toggle("product_details_show_share_buttons")],!d&&o),w&&wp.element.createElement(m,{title:c("Store Front Page","ecwid-shopping-cart"),initialOpen:!1},h.defaultCategoryId("default_category_id")),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},h.toggle("show_categories"),h.toggle("show_search"),h.toggle("show_breadcrumbs"),s&&h.toggle("show_footer_menu"),h.toggle("show_signin_link"),h.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},h.color("chameleon_color_button"),h.color("chameleon_color_foreground"),h.color("chameleon_color_price"),h.color("chameleon_color_link"),h.color("chameleon_color_background")))]},save:function(e){var t=["productbrowser"];e.attributes.show_categories&&(t[t.length]="categories"),e.attributes.show_search&&(t[t.length]="search");var r={widgets:t.join(" "),default_category_id:"undefined"!==typeof e.attributes.default_category_id?e.attributes.default_category_id:0};return new wp.shortcode({tag:g.shortcodeName,attrs:r,type:"single"}).string()},deprecated:[{attributes:{widgets:{type:"string"},categories_per_row:{type:"integer"},grid:{type:"string"},list:{type:"integer"},table:{type:"integer"},default_category_id:{type:"integer"},default_product_id:{type:"integer"},category_view:{type:"string"},search_view:{type:"string"},minicart_layout:{type:"string"}},save:function(e){return null}},{attributes:{widgets:{type:"string",default:"productbrowser"},default_category_id:{type:"integer",default:0}},migrate:function(e){return{widgets:e.widgets,default_category_id:e.default_category_id}},save:function(e){for(var t={},r=["widgets","default_category_id"],n=0;n<r.length;n++)t[r[n]]=e.attributes[r[n]];return t.default_product_id=0,new wp.shortcode({tag:g.shortcodeName,attrs:t,type:"single"}).string()}},{save:function(e){return"[ecwid]"}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0" default_product_id="0"]'}},{save:function(e){return'[ecwid widgets="productbrowser" default_category_id="0"]'}}],transforms:{from:[{type:"shortcode",tag:["ecwid","ec_store"],attributes:{default_category_id:{type:"integer",shortcode:function(e){return e.default_category_id}},show_categories:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("categories")}},show_search:{type:"boolean",shortcode:function(e){return-1!==e.named.widgets.indexOf("search")}}},priority:10}]}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){function t(e){l(function(t){return{manual:"manual",color:e}}),m.setAttributes(n({},s,e))}var r=e.manual,o=e.color,l=e.setState,s=arguments[0].name,m=arguments[0].props,u=arguments[0].title,g=null===r&&null!==m.attributes[s]&&""!==m.attributes[s]||"manual"===r;g?null!==o&&m.setAttributes(n({},s,o)):m.setAttributes(n({},s,null));var w=m.attributes[s],h=wp.element.createElement("span",null,u,null!==w&&wp.element.createElement(c,{colorValue:m.attributes[s]}));return wp.element.createElement(a,{label:h,className:"ec-store-color-picker"},wp.element.createElement("select",{onChange:function(e){return l(function(e){return{manual:event.target.value,color:e.color}})}},wp.element.createElement("option",{value:"auto",selected:!g},p("Detect automatically","ecwid-shopping-cart")),wp.element.createElement("option",{value:"manual",selected:g},p("Set manually","ecwid-shopping-cart"))),g&&wp.element.createElement(i,{value:w,colors:d,onChange:t}))}r.d(t,"a",function(){return m});var l=wp.components,a=l.BaseControl,i=l.ColorPalette,c=l.ColorIndicator,s=wp.compose.withState,p=wp.i18n.__,d=[{name:p("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:p("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:p("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:p("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:p("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:p("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:p("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:p("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:p("Very light gray"),slug:"very-light-gray",color:"#eeeeee"},{name:p("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:p("Very dark gray"),slug:"very-dark-gray",color:"#313131"}],m=s({manual:null,color:null})(o)},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(8),l=(r.n(o),r(9)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=i._x,p=wp.blocks.registerBlockType,d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ecwid/product-block",{title:c("Product Card Small","ecwid-shopping-cart"),icon:a.a.product,category:"ec-store",attributes:{id:{type:"integer"},show_picture:{type:"boolean",default:!0},show_title:{type:"boolean",default:!0},show_price:{type:"boolean",default:!0},show_options:{type:"boolean",default:!0},show_qty:{type:"boolean",default:!1},show_addtobag:{type:"boolean",default:!0},show_price_on_button:{type:"boolean",default:!0},show_border:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display product with a buy button","ecwid-shopping-cart"),alignWide:!1,supports:{customClassName:!1,className:!1,html:!1,align:!0,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-product"},EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-block-image"},wp.element.createElement("img",{src:EcwidGutenbergParams.products[o.id].imageUrl})),EcwidGutenbergParams.products&&o.id&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("div",{className:"ec-store-product-title"},EcwidGutenbergParams.products[o.id].name),!o.id&&wp.element.createElement("div",{className:"ec-store-block-product-preview"},a.a.productPreview),!o.id&&wp.element.createElement("div",null,wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Displayed product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(u,{title:s("Content","gutenberg-product-block","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_picture",c("Picture","ecwid-shopping-cart")),t(e,"show_title",c("Title","ecwid-shopping-cart")),t(e,"show_price",c("Price","ecwid-shopping-cart")),t(e,"show_options",c("Options","ecwid-shopping-cart")),t(e,"show_qty",c("Quantity","ecwid-shopping-cart")),t(e,"show_addtobag",c("\xabBuy now\xbb button","ecwid-shopping-cart"))),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"show_border",c("Add border","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(11),l=(r.n(o),r(12)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.blocks),p=(s.BlockControls,s.registerBlockType),d=wp.editor.InspectorControls,m=wp.components,u=m.PanelBody,g=m.ToggleControl;wp.compose.withState,wp.element.Fragment;p("ec-store/buynow",{title:c("Buy Now Button","ecwid-shopping-cart"),icon:a.a.button,category:"ec-store",attributes:{id:{type:"integer"},show_price_on_button:{type:"boolean",default:!0},center_align:{type:"boolean",default:!0}},description:c("Display a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,align:!0,alignWide:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){function t(e,t,r){return wp.element.createElement(g,{label:r,checked:e.attributes[t],onChange:function(){return e.setAttributes(n({},t,!e.attributes[t]))}})}function r(e){ecwid_open_product_popup({saveCallback:l,props:e})}var o=e.attributes,l=function(e){var t={id:e.newProps.id};EcwidGutenbergParams.products[e.newProps.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)};return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-buynow"},!o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"image"}),wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:l,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),o.id&&wp.element.createElement("div",{className:"image"})),wp.element.createElement(d,null,o.id&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[o.id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[o.id].name),wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Change","ecwid-shopping-cart")))),!o.id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return r(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement("br",null),wp.element.createElement(u,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},t(e,"show_price_on_button",c("Show price inside the \xabBuy now\xbb button","ecwid-shopping-cart")),t(e,"center_align",c("Center align on a page","ecwid-shopping-cart"))))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(14),o=(r.n(n),r(15)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.i18n,i=a.__;a._x;(0,wp.blocks.registerBlockType)("ec-store/search",{title:i("Product Search Box","ecwid-shopping-cart"),icon:l.a.search,category:"ec-store",description:i("Display search box","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-search"},wp.element.createElement("div",{class:"image"}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(17),o=(r.n(n),r(18)),l=(r.n(o),r(0));if(!EcwidGutenbergParams.isDemoStore){var a=wp.editor.InspectorControls,i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=EcwidGutenbergParams.blockParams["ec-store/categories"];s("ec-store/categories",{title:c("Store Categories Menu","ecwid-shopping-cart"),icon:l.a.categories,category:"ec-store",description:c("Display categories menu","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable},edit:function(e){var t=(e.attributes,wp.element.createElement("div",{className:"ec-store-block ec-store-block-categories"},wp.element.createElement("div",{className:"ec-store-block-header"},l.a.categories,c("Categories","ecwid-shopping-cart")))),r=c('The block is hidden because you don\'t have categories in your store. <a target="_blank" href="admin.php?page=ec-store-admin-category-id-0-mode-edit">Add categories.</a>',"ecwid-shopping-cart");return[t,wp.element.createElement(a,null,wp.element.createElement("div",{style:{height:"10px"}}),!p.has_categories&&wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(20),l=(r.n(o),r(21)),a=(r.n(l),r(0));if(!EcwidGutenbergParams.isDemoStore){var i=wp.i18n,c=i.__,s=(i._x,wp.editor.InspectorControls),p=wp.components,d=p.PanelBody,m=p.BaseControl;(0,wp.blocks.registerBlockType)("ec-store/minicart",{title:c("Shopping Cart Icon","ecwid-shopping-cart"),icon:a.a.cart,category:"ec-store",description:c("Display shopping bag link and summary","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,isPrivate:!EcwidGutenbergParams.isApiAvailable,align:!0,alignWide:!1},attributes:EcwidGutenbergParams.minicartAttributes,edit:function(e){function t(e,t,r,o){return wp.element.createElement(m,{label:r},wp.element.createElement("select",{className:"ec-store-inspector-select",onChange:function(r){e.setAttributes(n({},t,r.target.value))}},o.map(function(r){return wp.element.createElement("option",{value:r.value,selected:e.attributes[t]==r.value},r.title)})))}function r(e,r,n){var o=EcwidGutenbergParams.minicartAttributes[r];return"undefined"===typeof n&&(n=o.type),t(e,o.name,o.title,o.values)}e.attributes;return[wp.element.createElement("div",{className:"ec-store-block ec-store-block-minicart"},wp.element.createElement("div",{className:"image"})),wp.element.createElement(s,null,wp.element.createElement(d,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!0},r(e,"layout","select"),r(e,"icon","select"),r(e,"fixed_shape","select")))]},save:function(e){return!1}})}},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(23),o=(r.n(n),r(24)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,l.a,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=EcwidGutenbergParams.blockParams["ec-store/category-page"];s("ec-store/category-page",{title:c("Store Category Page","ecwid-shopping-cart"),icon:l.a.category,category:"ec-store",attributes:EcwidGutenbergStoreBlockParams.attributes,description:c("Display category page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes;e.setAttributes({widgets:""});var n=wp.element.createElement(a.d,{icon:l.a.category,title:c("Store Category Page","ecwid-shopping-cart"),showDemoButton:g.isDemoStore},wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product1"}),wp.element.createElement("div",{className:"ec-store-category-product2"}),wp.element.createElement("div",{className:"ec-store-category-product3"})),wp.element.createElement("div",{className:"ec-store-category-products"},wp.element.createElement("div",{className:"ec-store-category-product4"}),wp.element.createElement("div",{className:"ec-store-category-product5"}),wp.element.createElement("div",{className:"ec-store-category-product6"}))),o=t("",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")),i=t(c("Display cart icon","ecwid-shopping-cart"),g.customizeMinicartText),s=g.isNewProductList,d=g.isNewDetailsPage,w=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement("div",{style:{height:"10px"}}),!EcwidGutenbergParams.hasCategories&&wp.element.createElement("div",{style:{margin:"10px"}},wp.element.createElement("a",{href:"admin.php?page=ec-store-admin-category-id-0-mode-edit",target:"_blank",class:"button button-primary"},c("Add categories","ecwid-shopping-cart"))),EcwidGutenbergParams.hasCategories&&[!e.attributes.default_category_id&&w.select("default_category_id",c("Select category","ecwid-shopping-cart")),e.attributes.default_category_id&&w.select("default_category_id",c("Selected category","ecwid-shopping-cart"))],wp.element.createElement(m,{title:c("Category List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.select("product_list_category_title_behavior"),"SHOW_TEXT_ONLY"!==r.product_list_category_title_behavior&&[w.buttonGroup("product_list_category_image_size"),w.toolbar("product_list_category_image_aspect_ratio")]],!s&&o),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[w.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[w.buttonGroup("product_list_image_size"),w.toolbar("product_list_image_aspect_ratio")],w.toolbar("product_list_product_info_layout"),w.select("product_list_title_behavior"),w.select("product_list_price_behavior"),w.select("product_list_sku_behavior"),w.select("product_list_buybutton_behavior"),w.toggle("product_list_show_additional_image_on_hover"),w.toggle("product_list_show_frame")],!s&&o),wp.element.createElement(m,{title:c("Product Page Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===r.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===r.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&productDetailsMigrationWarning),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},w.toggle("show_categories"),w.toggle("show_search"),w.toggle("show_breadcrumbs"),s&&w.toggle("show_footer_menu"),w.toggle("show_signin_link"),w.toggle("product_list_show_sort_viewas_options"),i),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(26),o=(r.n(n),r(27)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=d.BaseControl,g=(wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/product-page"]);s("ec-store/product-page",{title:c("Product Card Large","ecwid-shopping-cart"),icon:l.a.product,category:"ec-store",attributes:g.attributes,description:c("Display product page with description and a buy button","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e){ecwid_open_product_popup({saveCallback:o,props:e})}function r(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var n=e.attributes,o=function(e){var t={default_product_id:e.newProps.product.id};EcwidGutenbergParams.products[e.newProps.product.id]={name:e.newProps.product.name,imageUrl:e.newProps.product.thumb},e.originalProps.setAttributes(t)},i=wp.element.createElement(a.d,{icon:l.a.product,title:c("Product Card Large")},wp.element.createElement(a.b,{src:"product-page-preview.png"}),!n.default_product_id&&wp.element.createElement("div",{className:"button-container"},wp.element.createElement("button",{className:"button ec-store-block-button",onClick:function(){var t={saveCallback:o,props:e};ecwid_open_product_popup(t)}},EcwidGutenbergParams.chooseProduct))),s=r("",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")),d=(r("",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")),g.isNewDetailsPage),w=Object(a.a)(g.attributes,e);return[i,wp.element.createElement(p,null,n.default_product_id>0&&wp.element.createElement("div",null,wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("label",{className:"ec-store-inspector-subheader"},c("Linked product","ecwid-shopping-cart"))),wp.element.createElement("div",{className:"ec-store-inspector-row"},EcwidGutenbergParams.products&&EcwidGutenbergParams.products[n.default_product_id]&&wp.element.createElement("label",null,EcwidGutenbergParams.products[n.default_product_id].name),wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Change","ecwid-shopping-cart")))),!n.default_product_id&&wp.element.createElement("div",{className:"ec-store-inspector-row"},wp.element.createElement("button",{className:"button",onClick:function(){return t(e)}},c("Choose product","ecwid-shopping-cart"))),wp.element.createElement(m,{title:c("Appearance","ecwid-shopping-cart"),initialOpen:!1},d&&[w.select("product_details_layout"),("TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT"===n.product_details_layout||"TWO_COLUMNS_SIDEBAR_ON_THE_LEFT"===n.product_details_layout)&&w.toggle("show_description_under_image"),w.toolbar("product_details_gallery_layout"),Object(a.c)(c("Product sidebar content","ecwid-shopping-cart")),w.toggle("product_details_show_product_name"),w.toggle("product_details_show_breadcrumbs"),w.toggle("product_details_show_product_sku"),w.toggle("product_details_show_product_price"),w.toggle("product_details_show_qty"),w.toggle("product_details_show_number_of_items_in_stock"),w.toggle("product_details_show_in_stock_label"),w.toggle("product_details_show_wholesale_prices"),w.toggle("product_details_show_share_buttons")],!d&&s),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},w.color("chameleon_color_button"),w.color("chameleon_color_foreground"),w.color("chameleon_color_price"),w.color("chameleon_color_link"),w.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(29),o=(r.n(n),r(30)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=wp.editor.InspectorControls,d=wp.components,m=d.PanelBody,u=(d.PanelRow,d.ToggleControl,d.ButtonGroup,d.Button,d.BaseControl),g=(d.Toolbar,d.ColorPalette,d.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/filters-page"]);s("ec-store/filters-page",{title:c("Product Search and filters","ecwid-shopping-cart"),icon:l.a.filters,category:"ec-store",attributes:g.attributes,description:c("Display search page with filters on a side","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){function t(e,t){return wp.element.createElement(u,{label:e},wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:t}}))}var r=e.attributes,n=wp.element.createElement(a.d,{icon:l.a.filters,title:c("Search and Filters")},wp.element.createElement(a.b,{src:"filter-preview.png"})),o=t("",c('You can enable filters in the store settings: (\u201c<a target="_blank" href="admin.php?page=ec-store-admin-product-filters-mode-main">Settings \u2192 Product Filters</a>\u201d).',"ecwid-shopping-cart")),i=t("",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")),s=g.isNewProductList,d=Object(a.a)(g.attributes,e);return[n,wp.element.createElement(p,null,wp.element.createElement(m,{title:c("Filters","ecwid-shopping-cart"),initialOpen:!1},!g.filtersEnabled&&o,g.filtersEnabled&&[d.select("product_filters_position_search_page")]),wp.element.createElement(m,{title:c("Product List Appearance","ecwid-shopping-cart"),initialOpen:!1},s&&[d.toggle("product_list_show_product_images"),r.product_list_show_product_images&&[d.buttonGroup("product_list_image_size"),d.toolbar("product_list_image_aspect_ratio")],d.toolbar("product_list_product_info_layout"),d.select("product_list_title_behavior"),d.select("product_list_price_behavior"),d.select("product_list_sku_behavior"),d.select("product_list_buybutton_behavior"),d.toggle("product_list_show_additional_image_on_hover"),d.toggle("product_list_show_frame")],!s&&i),wp.element.createElement(m,{title:c("Store Navigation","ecwid-shopping-cart"),initialOpen:!1},d.toggle("show_categories"),d.toggle("show_breadcrumbs"),s&&d.toggle("show_footer_menu"),d.toggle("show_signin_link"),d.toggle("product_list_show_sort_viewas_options")),wp.element.createElement(m,{title:c("Color settings","ecwid-shopping-cart"),initialOpen:!1},d.color("chameleon_color_button"),d.color("chameleon_color_foreground"),d.color("chameleon_color_price"),d.color("chameleon_color_link"),d.color("chameleon_color_background")))]},save:function(e){return null}})},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(32),o=(r.n(n),r(33)),l=(r.n(o),r(0)),a=r(1),i=wp.i18n,c=i.__,s=(i._x,wp.blocks.registerBlockType),p=(wp.editor.InspectorControls,wp.components),d=(p.PanelBody,p.PanelRow,p.ToggleControl,p.ButtonGroup,p.Button,p.BaseControl,p.Toolbar,p.ColorPalette,p.ColorIndicator,wp.compose.withState,EcwidGutenbergParams.blockParams["ec-store/cart-page"]);s("ec-store/cart-page",{title:c("Cart and Checkout","ecwid-shopping-cart"),icon:l.a.cartPage,category:"ec-store",attributes:d.attributes,description:c("Display shopping cart and checkout page","ecwid-shopping-cart"),supports:{customClassName:!1,className:!1,html:!1,multiple:!1},edit:function(e){e.attributes;return[wp.element.createElement(a.d,{icon:l.a.cartPage,title:c("Cart and Checkout")},wp.element.createElement(a.b,{src:"cart-page-preview.png"}))]},save:function(e){return null}})},function(e,t){},function(e,t){}]);
|
js/gutenberg/product.jsx
CHANGED
@@ -9,33 +9,23 @@
|
|
9 |
// Import CSS.
|
10 |
import './style.scss';
|
11 |
import './editor.scss';
|
|
|
12 |
|
13 |
if ( !EcwidGutenbergParams.isDemoStore ) {
|
14 |
|
15 |
const { __, _x } = wp.i18n; // Import __() from wp.i18n
|
16 |
|
17 |
const {
|
18 |
-
BlockControls,
|
19 |
registerBlockType,
|
20 |
} = wp.blocks;
|
21 |
|
22 |
const {
|
23 |
InspectorControls,
|
24 |
-
AlignmentToolbar,
|
25 |
-
withColors
|
26 |
} = wp.editor;
|
27 |
|
28 |
const {
|
29 |
PanelBody,
|
30 |
-
PanelRow,
|
31 |
ToggleControl,
|
32 |
-
ButtonGroup,
|
33 |
-
Button,
|
34 |
-
IconButton,
|
35 |
-
BaseControl,
|
36 |
-
Toolbar,
|
37 |
-
ColorPalette,
|
38 |
-
ColorIndicator
|
39 |
} = wp.components;
|
40 |
|
41 |
const { withState } = wp.compose;
|
@@ -59,12 +49,8 @@ const {
|
|
59 |
* registered; otherwise `undefined`.
|
60 |
*/
|
61 |
registerBlockType( 'ecwid/product-block', {
|
62 |
-
title:
|
63 |
-
icon:
|
64 |
-
<svg className="dashicon" viewBox="0 0 20 20" width="20" height="20">
|
65 |
-
<path d={ EcwidGutenbergParams.productIcon }></path>
|
66 |
-
</svg>
|
67 |
-
),
|
68 |
category: 'ec-store', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
69 |
attributes: {
|
70 |
id: {type: 'integer'},
|
@@ -79,10 +65,12 @@ registerBlockType( 'ecwid/product-block', {
|
|
79 |
center_align: {type: 'boolean', default: true}
|
80 |
},
|
81 |
description: __( 'Display product with a buy button', 'ecwid-shopping-cart' ),
|
|
|
82 |
supports: {
|
83 |
customClassName: false,
|
84 |
className: false,
|
85 |
html: false,
|
|
|
86 |
isPrivate: !EcwidGutenbergParams.isApiAvailable
|
87 |
},
|
88 |
|
@@ -101,10 +89,10 @@ registerBlockType( 'ecwid/product-block', {
|
|
101 |
const saveCallback = function( params ) {
|
102 |
|
103 |
const attributes = {
|
104 |
-
'id': params.newProps.id
|
105 |
};
|
106 |
|
107 |
-
EcwidGutenbergParams.products[params.newProps.id] = {
|
108 |
name: params.newProps.product.name,
|
109 |
imageUrl: params.newProps.product.thumb
|
110 |
};
|
@@ -112,25 +100,24 @@ registerBlockType( 'ecwid/product-block', {
|
|
112 |
params.originalProps.setAttributes(attributes);
|
113 |
}
|
114 |
|
115 |
-
const editor = <div className="ec-store-block">
|
116 |
-
|
117 |
-
<svg className="dashicon" viewBox="0 0 20 20" width="20" height="20">
|
118 |
-
<path d={ EcwidGutenbergParams.productIcon }></path>
|
119 |
-
</svg>
|
120 |
-
{ EcwidGutenbergParams.yourProductLabel }
|
121 |
-
</div>
|
122 |
-
|
123 |
-
{ EcwidGutenbergParams.products && attributes.id && EcwidGutenbergParams.products[attributes.id] &&
|
124 |
<div className="ec-store-block-image">
|
125 |
<img src={ EcwidGutenbergParams.products[attributes.id].imageUrl }/>
|
126 |
</div>
|
127 |
}
|
128 |
|
129 |
{ EcwidGutenbergParams.products && attributes.id && EcwidGutenbergParams.products[attributes.id] &&
|
130 |
-
<div className="ec-store-
|
131 |
{ EcwidGutenbergParams.products[attributes.id].name }
|
132 |
</div>
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
{ !attributes.id &&
|
136 |
<div>
|
9 |
// Import CSS.
|
10 |
import './style.scss';
|
11 |
import './editor.scss';
|
12 |
+
import {EcwidIcons} from '../icons.js';
|
13 |
|
14 |
if ( !EcwidGutenbergParams.isDemoStore ) {
|
15 |
|
16 |
const { __, _x } = wp.i18n; // Import __() from wp.i18n
|
17 |
|
18 |
const {
|
|
|
19 |
registerBlockType,
|
20 |
} = wp.blocks;
|
21 |
|
22 |
const {
|
23 |
InspectorControls,
|
|
|
|
|
24 |
} = wp.editor;
|
25 |
|
26 |
const {
|
27 |
PanelBody,
|
|
|
28 |
ToggleControl,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
} = wp.components;
|
30 |
|
31 |
const { withState } = wp.compose;
|
49 |
* registered; otherwise `undefined`.
|
50 |
*/
|
51 |
registerBlockType( 'ecwid/product-block', {
|
52 |
+
title: __( 'Product Card Small', 'ecwid-shopping-cart' ), // Block title.
|
53 |
+
icon: EcwidIcons.product,
|
|
|
|
|
|
|
|
|
54 |
category: 'ec-store', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
55 |
attributes: {
|
56 |
id: {type: 'integer'},
|
65 |
center_align: {type: 'boolean', default: true}
|
66 |
},
|
67 |
description: __( 'Display product with a buy button', 'ecwid-shopping-cart' ),
|
68 |
+
alignWide: false,
|
69 |
supports: {
|
70 |
customClassName: false,
|
71 |
className: false,
|
72 |
html: false,
|
73 |
+
align: true,
|
74 |
isPrivate: !EcwidGutenbergParams.isApiAvailable
|
75 |
},
|
76 |
|
89 |
const saveCallback = function( params ) {
|
90 |
|
91 |
const attributes = {
|
92 |
+
'id': params.newProps.product.id
|
93 |
};
|
94 |
|
95 |
+
EcwidGutenbergParams.products[params.newProps.product.id] = {
|
96 |
name: params.newProps.product.name,
|
97 |
imageUrl: params.newProps.product.thumb
|
98 |
};
|
100 |
params.originalProps.setAttributes(attributes);
|
101 |
}
|
102 |
|
103 |
+
const editor = <div className="ec-store-block ec-store-block-product">
|
104 |
+
{ EcwidGutenbergParams.products && attributes.id && EcwidGutenbergParams.products[attributes.id] &&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
<div className="ec-store-block-image">
|
106 |
<img src={ EcwidGutenbergParams.products[attributes.id].imageUrl }/>
|
107 |
</div>
|
108 |
}
|
109 |
|
110 |
{ EcwidGutenbergParams.products && attributes.id && EcwidGutenbergParams.products[attributes.id] &&
|
111 |
+
<div className="ec-store-product-title">
|
112 |
{ EcwidGutenbergParams.products[attributes.id].name }
|
113 |
</div>
|
114 |
}
|
115 |
+
|
116 |
+
{ !attributes.id &&
|
117 |
+
<div className="ec-store-block-product-preview">
|
118 |
+
{ EcwidIcons.productPreview }
|
119 |
+
</div>
|
120 |
+
}
|
121 |
|
122 |
{ !attributes.id &&
|
123 |
<div>
|
js/gutenberg/store.jsx
CHANGED
@@ -8,21 +8,17 @@
|
|
8 |
// Import CSS.
|
9 |
import './style.scss';
|
10 |
import './editor.scss';
|
11 |
-
import {EcwidIcons} from '
|
|
|
12 |
|
13 |
-
const { __, _x } = wp.i18n;
|
14 |
-
|
15 |
-
const ecwidIcons = EcwidIcons;
|
16 |
|
17 |
const {
|
18 |
-
BlockControls,
|
19 |
registerBlockType,
|
20 |
} = wp.blocks;
|
21 |
|
22 |
const {
|
23 |
InspectorControls,
|
24 |
-
AlignmentToolbar,
|
25 |
-
withColors
|
26 |
} = wp.editor;
|
27 |
|
28 |
const {
|
@@ -31,7 +27,6 @@ const {
|
|
31 |
ToggleControl,
|
32 |
ButtonGroup,
|
33 |
Button,
|
34 |
-
IconButton,
|
35 |
BaseControl,
|
36 |
Toolbar,
|
37 |
ColorPalette,
|
@@ -40,9 +35,9 @@ const {
|
|
40 |
|
41 |
const { withState } = wp.compose;
|
42 |
|
43 |
-
const
|
44 |
-
|
45 |
-
|
46 |
/**
|
47 |
* Register: aa Gutenberg Block.
|
48 |
*
|
@@ -56,15 +51,11 @@ const {
|
|
56 |
* @return {?WPBlock} The block, if it has been successfully
|
57 |
* registered; otherwise `undefined`.
|
58 |
*/
|
59 |
-
registerBlockType(
|
60 |
-
title:
|
61 |
-
icon:
|
62 |
-
<svg className="dashicon" viewBox="0 0 20 20" width="20" height="20">
|
63 |
-
<path d={ EcwidGutenbergParams.storeIcon }></path>
|
64 |
-
</svg>
|
65 |
-
),
|
66 |
category: 'ec-store', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
67 |
-
attributes:
|
68 |
description: __( 'Add storefront (product listing)', 'ecwid-shopping-cart' ),
|
69 |
supports: {
|
70 |
customClassName: false,
|
@@ -88,227 +79,24 @@ registerBlockType( 'ecwid/store-block', {
|
|
88 |
// legacy reset
|
89 |
props.setAttributes({widgets:''});
|
90 |
|
91 |
-
const editor =
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
{ EcwidGutenbergParams.isDemoStore && __( 'Demo store', 'ecwid-shopping-cart' ) }
|
98 |
-
{ !EcwidGutenbergParams.isDemoStore && EcwidGutenbergStoreBlockParams.storeBlockTitle }
|
99 |
-
</div>
|
100 |
-
{ EcwidGutenbergParams.isDemoStore &&
|
101 |
-
<div>
|
102 |
-
<a className="button button-primary" href="admin.php?page=ec-store">{ __( 'Set up your store', 'ecwid-shopping-cart') }</a>
|
103 |
</div>
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
/>
|
114 |
-
}
|
115 |
-
|
116 |
-
function buildToolbar(props, name, label, items) {
|
117 |
-
return <BaseControl label={label}>
|
118 |
-
<Toolbar
|
119 |
-
controls={ items.map( function(item) {
|
120 |
-
return {
|
121 |
-
icon: EcwidIcons[item.icon],
|
122 |
-
title: item.title,
|
123 |
-
isActive: props.attributes[name] === item.value,
|
124 |
-
className: 'ecwid-toolbar-icon',
|
125 |
-
onClick: () =>
|
126 |
-
props.setAttributes( { [name]: item.value } )
|
127 |
-
}
|
128 |
-
} ) }
|
129 |
-
/>
|
130 |
-
</BaseControl>;
|
131 |
-
}
|
132 |
-
|
133 |
-
function buildSelect(props, name, label, items) {
|
134 |
-
return <BaseControl label={ label }>
|
135 |
-
<select onChange={ (event) => { props.setAttributes( { [name]:event.target.value } ) } }>
|
136 |
-
{ items.map( function(item) {
|
137 |
-
return <option value={item.value} selected={ props.attributes[name] == item.value }>{item.title}</option>
|
138 |
-
})}
|
139 |
-
</select>
|
140 |
-
</BaseControl>;
|
141 |
-
}
|
142 |
-
|
143 |
-
function buildTextbox(props, name, label) {
|
144 |
-
return <BaseControl label={ label }>
|
145 |
-
<input type="text" value={props.attributes[name]} onChange={ (event) => { props.setAttributes( { [name]:event.target.value } ) } } />
|
146 |
-
</BaseControl>;
|
147 |
-
}
|
148 |
-
|
149 |
-
function buildButtonGroup(props, name, label, items) {
|
150 |
-
return <BaseControl label={label}>
|
151 |
-
<ButtonGroup>
|
152 |
-
{ items.map( function(item) {
|
153 |
-
return <Button isDefault isButton
|
154 |
-
isPrimary={ attributes[name] == item.value }
|
155 |
-
onClick={ () => props.setAttributes( { [name]: item.value } ) }>
|
156 |
-
{ item.title }
|
157 |
-
</Button>
|
158 |
-
} ) }
|
159 |
-
</ButtonGroup>
|
160 |
-
</BaseControl>;
|
161 |
-
}
|
162 |
-
|
163 |
-
|
164 |
-
function buildDangerousHTMLMessageWithTitle(title, message) {
|
165 |
-
return <BaseControl label={title}><div dangerouslySetInnerHTML={{ __html: message }} /></BaseControl>;
|
166 |
-
}
|
167 |
-
|
168 |
-
function buildItem(props, name, type) {
|
169 |
-
|
170 |
-
const item = EcwidGutenbergStoreBlockParams.attributes[name];
|
171 |
-
|
172 |
-
if ( typeof type === 'undefined' ) {
|
173 |
-
type = item.type;
|
174 |
-
}
|
175 |
-
|
176 |
-
if ( type === 'default_category_id' ) {
|
177 |
-
if ( item.values && item.values.length > 1 ) {
|
178 |
-
type = 'select';
|
179 |
-
} else {
|
180 |
-
type = 'textbox';
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
if ( type === 'buttonGroup' ) {
|
185 |
-
return buildButtonGroup( props, item.name, item.title, item.values );
|
186 |
-
} else if ( type === 'toolbar' ) {
|
187 |
-
return buildToolbar( props, item.name, item.title, item.values );
|
188 |
-
} else if ( type === 'select' ) {
|
189 |
-
return buildSelect( props, item.name, item.title, item.values );
|
190 |
-
} else if ( type === 'colorPalette' ) {
|
191 |
-
return buildColorPalette( props, item.name, item.title );
|
192 |
-
} else if ( type === 'text' ) {
|
193 |
-
return buildDangerousHTMLMessageWithTitle( item.title, item.message );
|
194 |
-
} else if ( type === 'textbox') {
|
195 |
-
return buildTextbox( props, item.name, item.title );
|
196 |
-
} else {
|
197 |
-
return buildToggle( props, item.name, item.title );
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
const colors = [{
|
202 |
-
name: __("Pale pink"),
|
203 |
-
slug: "pale-pink",
|
204 |
-
color: "#f78da7"
|
205 |
-
}, {
|
206 |
-
name: __("Vivid red"),
|
207 |
-
slug: "vivid-red",
|
208 |
-
color: "#cf2e2e"
|
209 |
-
}, {
|
210 |
-
name: __("Luminous vivid orange"),
|
211 |
-
slug: "luminous-vivid-orange",
|
212 |
-
color: "#ff6900"
|
213 |
-
}, {
|
214 |
-
name: __("Luminous vivid amber"),
|
215 |
-
slug: "luminous-vivid-amber",
|
216 |
-
color: "#fcb900"
|
217 |
-
}, {
|
218 |
-
name: __("Light green cyan"),
|
219 |
-
slug: "light-green-cyan",
|
220 |
-
color: "#7bdcb5"
|
221 |
-
}, {
|
222 |
-
name: __("Vivid green cyan"),
|
223 |
-
slug: "vivid-green-cyan",
|
224 |
-
color: "#00d084"
|
225 |
-
}, {
|
226 |
-
name: __("Pale cyan blue"),
|
227 |
-
slug: "pale-cyan-blue",
|
228 |
-
color: "#8ed1fc"
|
229 |
-
}, {
|
230 |
-
name: __("Vivid cyan blue"),
|
231 |
-
slug: "vivid-cyan-blue",
|
232 |
-
color: "#0693e3"
|
233 |
-
}, {
|
234 |
-
name: __("Very light gray"),
|
235 |
-
slug: "very-light-gray",
|
236 |
-
color: "#eeeeee"
|
237 |
-
}, {
|
238 |
-
name: __("Cyan bluish gray"),
|
239 |
-
slug: "cyan-bluish-gray",
|
240 |
-
color: "#abb8c3"
|
241 |
-
}, {
|
242 |
-
name: __("Very dark gray"),
|
243 |
-
slug: "very-dark-gray",
|
244 |
-
color: "#313131"
|
245 |
-
}];
|
246 |
-
|
247 |
-
function buildColorPalette(props, name, label ) {
|
248 |
-
|
249 |
-
const titleElement = <span>{ label }
|
250 |
-
<ColorIndicator colorValue={ attributes[name]} />
|
251 |
-
</span>;
|
252 |
-
|
253 |
-
return <BaseControl label={titleElement} className="ec-store-color-picker">
|
254 |
-
<ColorPalette
|
255 |
-
value={ attributes[name] }
|
256 |
-
colors={ colors }
|
257 |
-
onChange={ (color) => props.setAttributes( { [name]: color } ) }
|
258 |
-
/>
|
259 |
-
</BaseControl>;
|
260 |
}
|
261 |
-
|
262 |
-
function getChameleonColorControl( { manual, color, setState } ) {
|
263 |
-
const name = arguments[0].name;
|
264 |
-
const props = arguments[0].props;
|
265 |
-
const titleText = EcwidGutenbergStoreBlockParams.attributes[name].title;
|
266 |
|
267 |
-
const isManual = manual === null && props.attributes[name] !== null && props.attributes[name] !== ""
|
268 |
-
|| manual === 'manual';
|
269 |
-
if ( !isManual ) {
|
270 |
-
props.setAttributes( { [name]: null } )
|
271 |
-
} else if ( color !== null ) {
|
272 |
-
props.setAttributes( { [name]: color } );
|
273 |
-
}
|
274 |
-
|
275 |
-
const currentValue = props.attributes[name];
|
276 |
-
|
277 |
-
const titleElement = <span >{ titleText }
|
278 |
-
{ currentValue !== null && <ColorIndicator colorValue={ attributes[name] } /> }
|
279 |
-
</span>;
|
280 |
-
|
281 |
-
function colorPaletteChange( newColor ) {
|
282 |
-
setState( (state) => ( { manual: 'manual', color: newColor } ) );
|
283 |
-
props.setAttributes( { [name]: newColor } );
|
284 |
-
}
|
285 |
-
|
286 |
-
return <BaseControl label={titleElement} className="ec-store-color-picker">
|
287 |
-
<select onChange={ (value) => setState( ( state ) => ( { manual: event.target.value, color: state.color } ) ) }>
|
288 |
-
<option value="auto" selected={ !isManual }>{ __( 'Detect automatically', 'ecwid-shopping-cart' ) }</option>
|
289 |
-
<option value="manual" selected={ isManual }>{ __( 'Set manually', 'ecwid-shopping-cart' ) }</option>
|
290 |
-
</select>
|
291 |
-
{ isManual &&
|
292 |
-
<ColorPalette
|
293 |
-
value={ currentValue }
|
294 |
-
colors={ colors }
|
295 |
-
onChange={ colorPaletteChange }
|
296 |
-
>
|
297 |
-
</ColorPalette>
|
298 |
-
}
|
299 |
-
</BaseControl>;
|
300 |
-
}
|
301 |
-
|
302 |
-
const ChameleonColorControl = withState( {manual: null, color: null} ) ( getChameleonColorControl );
|
303 |
-
|
304 |
-
function simpleState( { count, setState } ) {
|
305 |
-
return <div>
|
306 |
-
<button onClick={ () => setState( (state) => ( { count: state.count+1 } ) ) }>text {count} {arguments[0].color}</button>
|
307 |
-
</div>
|
308 |
-
}
|
309 |
-
|
310 |
-
const Counter = withState( {count:0 } ) (simpleState);
|
311 |
-
|
312 |
const productMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
313 |
'',
|
314 |
__( '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' )
|
@@ -316,7 +104,7 @@ registerBlockType( 'ecwid/store-block', {
|
|
316 |
|
317 |
const cartIconMessage = buildDangerousHTMLMessageWithTitle(
|
318 |
__( 'Display cart icon', 'ecwid-shopping-cart' ),
|
319 |
-
|
320 |
);
|
321 |
|
322 |
const productDetailsMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
@@ -324,90 +112,97 @@ registerBlockType( 'ecwid/store-block', {
|
|
324 |
__( 'To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page 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' )
|
325 |
);
|
326 |
|
327 |
-
const isNewProductList =
|
328 |
-
const isNewDetailsPage =
|
329 |
|
330 |
-
const hasCategories =
|
|
|
|
|
331 |
|
332 |
return ([
|
333 |
editor,
|
334 |
<InspectorControls>
|
335 |
{ hasCategories &&
|
336 |
-
|
337 |
<PanelBody title={ __('Category List Appearance', 'ecwid-shopping-cart') } initialOpen={false}>
|
338 |
-
{ isNewProductList &&
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
343 |
{ !isNewProductList && productMigrationWarning }
|
344 |
</PanelBody>
|
345 |
-
|
346 |
}
|
|
|
347 |
<PanelBody title={ __( 'Product List Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
361 |
</PanelBody>
|
362 |
-
<PanelBody title={ __( 'Product Page Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
363 |
|
364 |
-
|
365 |
-
{
|
366 |
-
isNewDetailsPage
|
367 |
-
&& (
|
368 |
-
attributes.product_details_layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT'
|
369 |
-
|| attributes.product_details_layout == 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT'
|
370 |
-
) && buildItem( props, 'show_description_under_image', 'toggle' )
|
371 |
-
}
|
372 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_gallery_layout', 'toolbar' ) }
|
373 |
{ isNewDetailsPage &&
|
374 |
-
|
375 |
-
|
376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
}
|
378 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_product_name', 'toggle' ) }
|
379 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_breadcrumbs', 'toggle' ) }
|
380 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_product_sku', 'toggle' ) }
|
381 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_product_price', 'toggle' ) }
|
382 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_qty', 'toggle' ) }
|
383 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_number_of_items_in_stock', 'toggle' ) }
|
384 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_in_stock_label', 'toggle' ) }
|
385 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_wholesale_prices', 'toggle' ) }
|
386 |
-
{ isNewDetailsPage && buildItem( props, 'product_details_show_share_buttons', 'toggle' ) }
|
387 |
{ !isNewDetailsPage && productMigrationWarning }
|
388 |
</PanelBody>
|
|
|
389 |
{ hasCategories &&
|
390 |
|
391 |
<PanelBody title={ __('Store Front Page', 'ecwid-shopping-cart') } initialOpen={false}>
|
392 |
-
{
|
393 |
</PanelBody>
|
394 |
|
395 |
}
|
396 |
<PanelBody title={ __( 'Store Navigation', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
397 |
-
{
|
398 |
-
{
|
399 |
-
{
|
400 |
-
{ isNewProductList &&
|
401 |
-
{
|
402 |
-
{
|
403 |
{ cartIconMessage }
|
404 |
</PanelBody>
|
405 |
<PanelBody title={ __( 'Color settings', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
</PanelBody>
|
412 |
</InspectorControls>
|
413 |
]);
|
@@ -424,11 +219,11 @@ registerBlockType( 'ecwid/store-block', {
|
|
424 |
}
|
425 |
const shortcodeAttributes = {
|
426 |
'widgets': widgets.join(' '),
|
427 |
-
'default_category_id': typeof props.attributes.default_category_id
|
428 |
};
|
429 |
|
430 |
const shortcode = new wp.shortcode({
|
431 |
-
'tag':
|
432 |
'attrs': shortcodeAttributes,
|
433 |
'type': 'single'
|
434 |
});
|
@@ -476,7 +271,7 @@ registerBlockType( 'ecwid/store-block', {
|
|
476 |
shortcodeAttributes.default_product_id = 0;
|
477 |
|
478 |
var shortcode = new wp.shortcode({
|
479 |
-
'tag':
|
480 |
'attrs': shortcodeAttributes,
|
481 |
'type': 'single'
|
482 |
});
|
8 |
// Import CSS.
|
9 |
import './style.scss';
|
10 |
import './editor.scss';
|
11 |
+
import {EcwidIcons} from '../icons.js';
|
12 |
+
import { EcwidControls, EcwidInspectorSubheader, EcwidProductBrowserBlock } from '../includes/controls.js';
|
13 |
|
14 |
+
const { __, _x } = wp.i18n;
|
|
|
|
|
15 |
|
16 |
const {
|
|
|
17 |
registerBlockType,
|
18 |
} = wp.blocks;
|
19 |
|
20 |
const {
|
21 |
InspectorControls,
|
|
|
|
|
22 |
} = wp.editor;
|
23 |
|
24 |
const {
|
27 |
ToggleControl,
|
28 |
ButtonGroup,
|
29 |
Button,
|
|
|
30 |
BaseControl,
|
31 |
Toolbar,
|
32 |
ColorPalette,
|
35 |
|
36 |
const { withState } = wp.compose;
|
37 |
|
38 |
+
const blockName = 'ecwid/store-block';
|
39 |
+
|
40 |
+
const blockParams = EcwidGutenbergParams.blockParams[blockName];
|
41 |
/**
|
42 |
* Register: aa Gutenberg Block.
|
43 |
*
|
51 |
* @return {?WPBlock} The block, if it has been successfully
|
52 |
* registered; otherwise `undefined`.
|
53 |
*/
|
54 |
+
registerBlockType( blockName, {
|
55 |
+
title: blockParams.title, // Block title.
|
56 |
+
icon: EcwidIcons.store,
|
|
|
|
|
|
|
|
|
57 |
category: 'ec-store', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
|
58 |
+
attributes: blockParams.attributes,
|
59 |
description: __( 'Add storefront (product listing)', 'ecwid-shopping-cart' ),
|
60 |
supports: {
|
61 |
customClassName: false,
|
79 |
// legacy reset
|
80 |
props.setAttributes({widgets:''});
|
81 |
|
82 |
+
const editor =
|
83 |
+
<EcwidProductBrowserBlock icon={ EcwidIcons.store } title={ __( 'Store Home Page') } showDemoButton={ blockParams.isDemoStore }>
|
84 |
+
<div className="ec-store-products">
|
85 |
+
<div className="ec-store-product1"></div>
|
86 |
+
<div className="ec-store-product2"></div>
|
87 |
+
<div className="ec-store-product3"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
</div>
|
89 |
+
<div className="ec-store-products">
|
90 |
+
<div className="ec-store-product4"></div>
|
91 |
+
<div className="ec-store-product5"></div>
|
92 |
+
<div className="ec-store-product6"></div>
|
93 |
+
</div>
|
94 |
+
</EcwidProductBrowserBlock>;
|
95 |
+
|
96 |
+
function buildDangerousHTMLMessageWithTitle( title, message ) {
|
97 |
+
return <BaseControl label={ title }><div dangerouslySetInnerHTML={{ __html: message }} /></BaseControl>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
const productMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
101 |
'',
|
102 |
__( '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' )
|
104 |
|
105 |
const cartIconMessage = buildDangerousHTMLMessageWithTitle(
|
106 |
__( 'Display cart icon', 'ecwid-shopping-cart' ),
|
107 |
+
blockParams.customizeMinicartText
|
108 |
);
|
109 |
|
110 |
const productDetailsMigrationWarning = buildDangerousHTMLMessageWithTitle(
|
112 |
__( 'To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page 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' )
|
113 |
);
|
114 |
|
115 |
+
const isNewProductList = blockParams.isNewProductList;
|
116 |
+
const isNewDetailsPage = blockParams.isNewDetailsPage;
|
117 |
|
118 |
+
const hasCategories = blockParams.attributes.default_category_id && blockParams.attributes.default_category_id.values && blockParams.attributes.default_category_id.values.length > 0;
|
119 |
+
|
120 |
+
const controls = EcwidControls(blockParams.attributes, props);
|
121 |
|
122 |
return ([
|
123 |
editor,
|
124 |
<InspectorControls>
|
125 |
{ hasCategories &&
|
|
|
126 |
<PanelBody title={ __('Category List Appearance', 'ecwid-shopping-cart') } initialOpen={false}>
|
127 |
+
{ isNewProductList &&
|
128 |
+
[
|
129 |
+
controls.select('product_list_category_title_behavior'),
|
130 |
+
attributes.product_list_category_title_behavior !== 'SHOW_TEXT_ONLY' &&
|
131 |
+
[
|
132 |
+
controls.buttonGroup('product_list_category_image_size'),
|
133 |
+
controls.toolbar('product_list_category_image_aspect_ratio'),
|
134 |
+
]
|
135 |
+
]
|
136 |
+
}
|
137 |
{ !isNewProductList && productMigrationWarning }
|
138 |
</PanelBody>
|
|
|
139 |
}
|
140 |
+
|
141 |
<PanelBody title={ __( 'Product List Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
142 |
+
{ isNewProductList &&
|
143 |
+
[
|
144 |
+
controls.toggle( 'product_list_show_product_images' ),
|
145 |
+
attributes.product_list_show_product_images && [
|
146 |
+
controls.buttonGroup( 'product_list_image_size' ),
|
147 |
+
controls.toolbar( 'product_list_image_aspect_ratio' )
|
148 |
+
],
|
149 |
+
controls.toolbar( 'product_list_product_info_layout' ),
|
150 |
+
controls.select( 'product_list_title_behavior' ),
|
151 |
+
controls.select( 'product_list_price_behavior' ),
|
152 |
+
controls.select( 'product_list_sku_behavior' ),
|
153 |
+
controls.select( 'product_list_buybutton_behavior' ),
|
154 |
+
controls.toggle( 'product_list_show_additional_image_on_hover' ),
|
155 |
+
controls.toggle( 'product_list_show_frame' )
|
156 |
+
]
|
157 |
+
}
|
158 |
+
{ !isNewProductList && productMigrationWarning }
|
159 |
</PanelBody>
|
|
|
160 |
|
161 |
+
<PanelBody title={ __( 'Product Page Appearance', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
{ isNewDetailsPage &&
|
163 |
+
[
|
164 |
+
controls.select('product_details_layout'),
|
165 |
+
( attributes.product_details_layout === 'TWO_COLUMNS_SIDEBAR_ON_THE_RIGHT'
|
166 |
+
|| attributes.product_details_layout === 'TWO_COLUMNS_SIDEBAR_ON_THE_LEFT' ) &&
|
167 |
+
controls.toggle('show_description_under_image'),
|
168 |
+
controls.toolbar('product_details_gallery_layout'),
|
169 |
+
EcwidInspectorSubheader( __('Product sidebar content', 'ecwid-shopping-cart') ),
|
170 |
+
controls.toggle('product_details_show_product_name'),
|
171 |
+
controls.toggle('product_details_show_breadcrumbs'),
|
172 |
+
controls.toggle('product_details_show_product_sku'),
|
173 |
+
controls.toggle('product_details_show_product_price'),
|
174 |
+
controls.toggle('product_details_show_qty'),
|
175 |
+
controls.toggle('product_details_show_number_of_items_in_stock'),
|
176 |
+
controls.toggle('product_details_show_in_stock_label'),
|
177 |
+
controls.toggle('product_details_show_wholesale_prices'),
|
178 |
+
controls.toggle('product_details_show_share_buttons'),
|
179 |
+
]
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
{ !isNewDetailsPage && productMigrationWarning }
|
182 |
</PanelBody>
|
183 |
+
|
184 |
{ hasCategories &&
|
185 |
|
186 |
<PanelBody title={ __('Store Front Page', 'ecwid-shopping-cart') } initialOpen={false}>
|
187 |
+
{ controls.defaultCategoryId( 'default_category_id' ) }
|
188 |
</PanelBody>
|
189 |
|
190 |
}
|
191 |
<PanelBody title={ __( 'Store Navigation', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
192 |
+
{ controls.toggle( 'show_categories') }
|
193 |
+
{ controls.toggle( 'show_search') }
|
194 |
+
{ controls.toggle( 'show_breadcrumbs') }
|
195 |
+
{ isNewProductList && controls.toggle( 'show_footer_menu' ) }
|
196 |
+
{ controls.toggle( 'show_signin_link') }
|
197 |
+
{ controls.toggle( 'product_list_show_sort_viewas_options') }
|
198 |
{ cartIconMessage }
|
199 |
</PanelBody>
|
200 |
<PanelBody title={ __( 'Color settings', 'ecwid-shopping-cart' ) } initialOpen={false}>
|
201 |
+
{ controls.color( 'chameleon_color_button' ) }
|
202 |
+
{ controls.color( 'chameleon_color_foreground' ) }
|
203 |
+
{ controls.color( 'chameleon_color_price' ) }
|
204 |
+
{ controls.color( 'chameleon_color_link' ) }
|
205 |
+
{ controls.color( 'chameleon_color_background' ) }
|
206 |
</PanelBody>
|
207 |
</InspectorControls>
|
208 |
]);
|
219 |
}
|
220 |
const shortcodeAttributes = {
|
221 |
'widgets': widgets.join(' '),
|
222 |
+
'default_category_id': typeof props.attributes.default_category_id !== 'undefined' ? props.attributes.default_category_id : 0
|
223 |
};
|
224 |
|
225 |
const shortcode = new wp.shortcode({
|
226 |
+
'tag': blockParams.shortcodeName,
|
227 |
'attrs': shortcodeAttributes,
|
228 |
'type': 'single'
|
229 |
});
|
271 |
shortcodeAttributes.default_product_id = 0;
|
272 |
|
273 |
var shortcode = new wp.shortcode({
|
274 |
+
'tag': blockParams.shortcodeName,
|
275 |
'attrs': shortcodeAttributes,
|
276 |
'type': 'single'
|
277 |
});
|
js/themes/vantage.js
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(){
|
2 |
+
var originalAddClassMethod = jQuery.fn.addClass;
|
3 |
+
jQuery.fn.addClass = function(){
|
4 |
+
var result = originalAddClassMethod.apply( this, arguments );
|
5 |
+
jQuery(this).trigger('change');
|
6 |
+
return result;
|
7 |
+
}
|
8 |
+
|
9 |
+
var originalRemoveClassMethod = jQuery.fn.removeClass;
|
10 |
+
jQuery.fn.removeClass = function(){
|
11 |
+
var result = originalRemoveClassMethod.apply( this, arguments );
|
12 |
+
jQuery(this).trigger('change');
|
13 |
+
return result;
|
14 |
+
}
|
15 |
+
|
16 |
+
})();
|
17 |
+
|
18 |
+
jQuery(document).ready(function() {
|
19 |
+
if (typeof Ecwid == 'undefined') return;
|
20 |
+
|
21 |
+
var scroll = '#scroll-to-top',
|
22 |
+
minicart = '.ec-minicart';
|
23 |
+
|
24 |
+
var overlap = false,
|
25 |
+
overlap_init = false;
|
26 |
+
|
27 |
+
Ecwid.OnCartChanged.add( function( cart ) {
|
28 |
+
|
29 |
+
if( !jQuery( minicart ).parent().data('showEmptyCart') && !cart.productsQuantity ) {
|
30 |
+
jQuery( scroll ).unbind( 'change.Overlap' );
|
31 |
+
return;
|
32 |
+
}
|
33 |
+
|
34 |
+
jQuery( scroll ).on( 'change.Overlap', function() {
|
35 |
+
|
36 |
+
if( !jQuery( minicart ).length ) {
|
37 |
+
jQuery( scroll ).unbind( 'change.Overlap' );
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
var rect1 = jQuery( this ).get(0).getBoundingClientRect(),
|
42 |
+
rect2 = jQuery( minicart ).get(0).getBoundingClientRect();
|
43 |
+
|
44 |
+
if( !overlap_init ) {
|
45 |
+
overlap = !(rect1.right < rect2.left ||
|
46 |
+
rect1.left > rect2.right ||
|
47 |
+
rect1.bottom < rect2.top ||
|
48 |
+
rect1.top > rect2.bottom);
|
49 |
+
}
|
50 |
+
|
51 |
+
if( overlap ){
|
52 |
+
if( jQuery( this ).hasClass( 'displayed' ) ){
|
53 |
+
window.ec.storefront.cart_widget_vertical_indent = rect1.height + parseInt( jQuery( this ).css( 'bottom' ) ) + 10;
|
54 |
+
|
55 |
+
overlap_init = true;
|
56 |
+
} else {
|
57 |
+
window.ec.storefront.cart_widget_vertical_indent = jQuery( minicart ).parent().data( 'verticalIndent' );
|
58 |
+
}
|
59 |
+
Ecwid.refreshConfig();
|
60 |
+
}
|
61 |
+
});
|
62 |
+
|
63 |
+
setTimeout(function(){
|
64 |
+
if( jQuery( minicart ).length ) jQuery( document ).trigger('scroll');
|
65 |
+
}, 500);
|
66 |
+
|
67 |
+
});
|
68 |
+
|
69 |
+
});
|
languages/ecwid-shopping-cart-ru_RU.mo
CHANGED
Binary file
|
languages/ecwid-shopping-cart-ru_RU.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: Ecwid Shopping Cart 4.9.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ecwid-shopping-cart\n"
|
7 |
"POT-Creation-Date: 2017-05-30 19:04:12+00:00\n"
|
8 |
-
"PO-Revision-Date: 2019-03-
|
9 |
"Language: ru_RU\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
@@ -1638,10 +1638,19 @@ msgstr "Определять автоматически"
|
|
1638 |
msgid "Set manually"
|
1639 |
msgstr "Задать вручную"
|
1640 |
|
|
|
|
|
|
|
1641 |
msgctxt "gutenberg-store-block-stub"
|
1642 |
msgid "Store"
|
1643 |
msgstr "Витрина магазина"
|
1644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1645 |
msgid "To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page on the storefront” option in your store dashboard (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Settings → What’s New</a>)."
|
1646 |
msgstr "Чтобы обновить дизайн страницы товара и управлять настройками вида в редакторе, включите опцию “Обновленный внешний вид страницы товара” в панели управления магазина (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Настройки → Обновления</a>)"
|
1647 |
|
5 |
"Project-Id-Version: Ecwid Shopping Cart 4.9.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ecwid-shopping-cart\n"
|
7 |
"POT-Creation-Date: 2017-05-30 19:04:12+00:00\n"
|
8 |
+
"PO-Revision-Date: 2019-03-19 16:04+0400\n"
|
9 |
"Language: ru_RU\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
1638 |
msgid "Set manually"
|
1639 |
msgstr "Задать вручную"
|
1640 |
|
1641 |
+
msgid "Edit "
|
1642 |
+
msgstr "Задать вручную"
|
1643 |
+
|
1644 |
msgctxt "gutenberg-store-block-stub"
|
1645 |
msgid "Store"
|
1646 |
msgstr "Витрина магазина"
|
1647 |
|
1648 |
+
msgid "Edit Product"
|
1649 |
+
msgstr "Редактировать товар"
|
1650 |
+
|
1651 |
+
msgid "Edit Category"
|
1652 |
+
msgstr "Редактировать категорию"
|
1653 |
+
|
1654 |
msgid "To improve the look and feel of your product page and manage your its appearance here, please enable the “Next-gen look and feel of the product page on the storefront” option in your store dashboard (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Settings → What’s New</a>)."
|
1655 |
msgstr "Чтобы обновить дизайн страницы товара и управлять настройками вида в редакторе, включите опцию “Обновленный внешний вид страницы товара” в панели управления магазина (<a href=\"admin.php?page=ec-store-admin-whatsnew\">Настройки → Обновления</a>)"
|
1656 |
|
lib/ecwid_api_v3.php
CHANGED
@@ -20,6 +20,7 @@ class Ecwid_Api_V3
|
|
20 |
|
21 |
const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
|
22 |
const FEATURE_STATIC_HOME_PAGE = 'STATIC_HOME_PAGE';
|
|
|
23 |
|
24 |
public static function get_api_status_list()
|
25 |
{
|
@@ -141,8 +142,7 @@ class Ecwid_Api_V3
|
|
141 |
}
|
142 |
self::reset_api_status();
|
143 |
}
|
144 |
-
|
145 |
-
|
146 |
public function get_categories($input_params)
|
147 |
{
|
148 |
$params = array('token');
|
@@ -196,7 +196,14 @@ class Ecwid_Api_V3
|
|
196 |
return $result;
|
197 |
}
|
198 |
|
199 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
{
|
201 |
if (!isset($categoryId) || $categoryId == 0 ) {
|
202 |
return false;
|
@@ -473,6 +480,10 @@ class Ecwid_Api_V3
|
|
473 |
|
474 |
public function get_store_update_stats() {
|
475 |
|
|
|
|
|
|
|
|
|
476 |
$url = $this->_api_url . $this->store_id . '/latest-stats';
|
477 |
|
478 |
$params = array(
|
@@ -486,7 +497,9 @@ class Ecwid_Api_V3
|
|
486 |
return null;
|
487 |
}
|
488 |
|
489 |
-
|
|
|
|
|
490 |
}
|
491 |
|
492 |
public function get_store_profile() {
|
20 |
|
21 |
const FEATURE_NEW_PRODUCT_LIST = 'NEW_PRODUCT_LIST';
|
22 |
const FEATURE_STATIC_HOME_PAGE = 'STATIC_HOME_PAGE';
|
23 |
+
const FEATURE_PRODUCT_FILTERS = 'PRODUCT_FILTERS';
|
24 |
|
25 |
public static function get_api_status_list()
|
26 |
{
|
142 |
}
|
143 |
self::reset_api_status();
|
144 |
}
|
145 |
+
|
|
|
146 |
public function get_categories($input_params)
|
147 |
{
|
148 |
$params = array('token');
|
196 |
return $result;
|
197 |
}
|
198 |
|
199 |
+
public function has_public_categories()
|
200 |
+
{
|
201 |
+
$cats = $this->get_categories( array( 'limit' => 1 ) );
|
202 |
+
|
203 |
+
return $cats->total > 0;
|
204 |
+
}
|
205 |
+
|
206 |
+
public function get_category( $categoryId )
|
207 |
{
|
208 |
if (!isset($categoryId) || $categoryId == 0 ) {
|
209 |
return false;
|
480 |
|
481 |
public function get_store_update_stats() {
|
482 |
|
483 |
+
static $stats = null;
|
484 |
+
|
485 |
+
if ( $stats ) return $stats;
|
486 |
+
|
487 |
$url = $this->_api_url . $this->store_id . '/latest-stats';
|
488 |
|
489 |
$params = array(
|
497 |
return null;
|
498 |
}
|
499 |
|
500 |
+
$stats = json_decode($result['data']);
|
501 |
+
|
502 |
+
return $stats;
|
503 |
}
|
504 |
|
505 |
public function get_store_profile() {
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Ecwid Ecommerce Shopping Cart ===
|
2 |
Contributors: Ecwid
|
3 |
-
Tags: ecommerce,
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.1
|
6 |
-
Stable tag: 6.
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
@@ -141,7 +141,7 @@ To create a sitemap for your WordPress shop, we recommend using the fully compat
|
|
141 |
|
142 |
You can add the store categories menu to your site menu to help your customers easily navigate your online shop. Just open "Appearance > Menus" in your WordPress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site.
|
143 |
|
144 |
-
= How do I migrate my shop from Shopify or
|
145 |
|
146 |
You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://support.ecwid.com/hc/en-us/articles/360000049040-Migrating-to-Ecwid-from-WooCommerce).
|
147 |
|
@@ -149,9 +149,18 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
149 |
* [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
|
150 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
151 |
|
152 |
-
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
= 6.4.15 - Mar 19, 2019 =
|
154 |
-
- Fixed generation of sitemap for Yoast SEO plugin
|
155 |
|
156 |
= 6.4.14 - Mar 12, 2019 =
|
157 |
- Fixed a PHP error message ("Cannot use object of type Closure as array")
|
1 |
=== Ecwid Ecommerce Shopping Cart ===
|
2 |
Contributors: Ecwid
|
3 |
+
Tags: ecommerce, e-commerce, storefront, online store, sell
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.1
|
6 |
+
Stable tag: 6.5
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Sell on Facebook and Instagram. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
141 |
|
142 |
You can add the store categories menu to your site menu to help your customers easily navigate your online shop. Just open "Appearance > Menus" in your WordPress control panel and add the "Store with Categories Menu" item to your site menu. A drop-down menu containing your store categories will automatically appear on your site.
|
143 |
|
144 |
+
= How do I migrate my shop from Shopify, WooCommerce or BigCommerce? =
|
145 |
|
146 |
You can use Ecwid’s built-in import tools to copy your store products from any other shopping cart to Ecwid. Find more details in the [Import-Export article in the Ecwid shopping cart help center]( https://support.ecwid.com/hc/en-us/articles/360000049040-Migrating-to-Ecwid-from-WooCommerce).
|
147 |
|
149 |
* [Ecwid Help Center](http://help.ecwid.com/?source=wporg-plugin-site "Ecwid Help")
|
150 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
151 |
|
152 |
+
== Changelog ==
|
153 |
+
= 6.5 - Mar 28, 2019 =
|
154 |
+
- **Added 8 new Gutenberg blocks — 10 in total.** The Ecwid plugin now provides 10 ecommerce blocks for Gutenberg for adding online store functionality to your site pages. The blocks include: the store home page to display the whole storefront, the store category page to show a particular category, the large product card to show detailed product information, the small product card to display one or several product widgets, the buy now button to add buttons to blog posts, the search and filters page, the search input block, the shopping cart icon block and the cart and checkout block. To try the new blocks, open Gutenberg editor in your WordPress admin backend, click "Add block" and find the "Ecwid" blocks set there.
|
155 |
+
- **Added In-context "Edit Product" links.** You can now open store product editor quickly when browsing published store pages as an administrator. Just click the "Edit Product" link at the top of the page in the WordPress admin header or the "Edit" button at the bottom of the post and you will get redirected to the product details in your e-commerce store dashboard.
|
156 |
+
- **Added SEO improvement for the H1 tags on the product and category pages**. Ecwid puts product and categories ecommerce data in the page content in a SEO-friendly microdata format so that search engines can index your store well. On the other hand, Wordpress pages have their own data, specifically <h1> tags, which stay on product pages and visible to Google when it is indexing your site. So, in addition to a product title like "My cool product", Google may see your store page title on the same page like "Shop". We improved it: the product pages will now have more prominent and clear <h1> tags containing product titles. This should improve indexation and the way your products look in the search results in Google.
|
157 |
+
- **Added compatibility with the Enfold theme page builder (Avia Layout Builder)**. We learned that Ecwid didn't work well with the Avia page builder which is a part of the Enfold theme. Enfold users might notice it was difficult to add Ecwid blocks to a page. We fixed that — now Ecwid should work fine with Enfold theme.
|
158 |
+
- **Added Mega Menu plugin compatibility**. Added fixes and layout improvements to make the Ecwid e-commerce plugin compatible with the Mega Menu WordPress plugin. If you use the Mega Menu plugin, you might notice layout issues on your store page. We fixed that. If you find any trouble in how Ecwid works with your theme or plugin, please let us know.
|
159 |
+
- Minor fixes for the "Import products from WooCommerce to Ecwid" import tool.
|
160 |
+
- Ecwid is constantly updated with new features and tools which are of course available to WordPress users. One of the recent major updates is Dynamic AMP emails: we’ve collaborated with Google/Gmail to launch dynamic email for e-commerce merchants. It's available for the Ecwid plugin users now and you will be able to use it without dealing with custom code or any external plugin. Check it out in our [blog](https://www.ecwid.com/blog/e-commerce-email).
|
161 |
+
|
162 |
= 6.4.15 - Mar 19, 2019 =
|
163 |
+
- Fixed generation of sitemap for Yoast SEO plugin
|
164 |
|
165 |
= 6.4.14 - Mar 12, 2019 =
|
166 |
- Fixed a PHP error message ("Cannot use object of type Closure as array")
|