Version Description
- Mar 7, 2018 =
- Compatibility with the Yoast premium SEO plugin. Yoast recently updated their SEO plugins. We adjusted Ecwid plugin to work well with them. So, as usually, Ecwid should work well with Yoast products, feel free to use them to get your site and online store optimized for search engines.
- Fixed an issue with Ecwid buttons in the Elementor page builder toolbar. Ecwids Add store and Add product buttons didnt work well in the Elementor editor toolbar. We hid the Ecwid buttons from the toolbar as a workaround. To add a store or a single product to a page in the Elementor editor, please use [ec_store] and [ec_product] shortcodes or temporarily switch to the default WP editor.
- Fixed compatibility issues with Themify AJAX themes. If you use one of Themify themes with AJAX navigation enabled, you might notice that your store page didnt load sometimes. We fixed that. Ecwid should work well with any Wordpress theme.
- Fixed an issue with SEO-friendly description on store product pages. Ecwid ecommerce plugin renders your store pages in a special search engines friendly way so that they can index your products and display them better in search results. In some cases, product description wasnt displayed in that SEO version of store page. We fixed that, everything should work fine and your products should be displayed well in Google search.
- Minor fixes and improvements.
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 5.8.1 |
Comparing to | |
See all releases |
Code changes from version 5.8 to 5.8.1
- css/help.css +7 -2
- ecwid-shopping-cart.php +104 -84
- includes/class-ecwid-admin.php +2 -2
- includes/class-ecwid-ajax-defer-renderer.php +2 -1
- includes/class-ecwid-integration-wpseo.php +1 -1
- includes/class-ecwid-nav-menus.php +5 -2
- includes/class-ecwid-product-popup.php +7 -2
- includes/class-ecwid-products.php +30 -17
- includes/class-ecwid-store-editor.php +6 -2
- includes/class-ecwid-store-page.php +6 -1
- includes/faq_entries.php +9 -7
- includes/oembed.php +19 -19
- includes/themes.php +3 -1
- includes/themes/class-ecwid-theme-base.php +5 -0
- includes/widgets/class-ecwid-widget-vertical-categories-list.php +8 -5
- languages/ecwid-shopping-cart-ru_RU.mo +0 -0
- languages/ecwid-shopping-cart-ru_RU.po +29 -33
- lib/ecwid_api_v3.php +16 -16
- lib/html-catalog-templates/product.php +2 -1
- readme.txt +8 -1
- templates/advanced-settings.php +1 -5
- templates/connect.php +1 -1
- templates/help.php +3 -32
- templates/sync.php +2 -42
css/help.css
CHANGED
@@ -10,8 +10,7 @@ Author URI: http: //www.ecwid.com
|
|
10 |
/*------framework---------------------------------------------------------------------------------*/
|
11 |
html,
|
12 |
body {
|
13 |
-
font-
|
14 |
-
font-size: 16px;
|
15 |
line-height: 20px;
|
16 |
font-weight: 400;
|
17 |
text-rendering: optimizeLegibility;
|
@@ -673,6 +672,12 @@ textarea {
|
|
673 |
.block-search .hds-wrapper .btn .btn-text {
|
674 |
color: #fff;
|
675 |
display: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
|
677 |
/*------block-faq----------------------------------------------------------------------------*/
|
678 |
.block-faq {
|
10 |
/*------framework---------------------------------------------------------------------------------*/
|
11 |
html,
|
12 |
body {
|
13 |
+
font-size: 13px;
|
|
|
14 |
line-height: 20px;
|
15 |
font-weight: 400;
|
16 |
text-rendering: optimizeLegibility;
|
672 |
.block-search .hds-wrapper .btn .btn-text {
|
673 |
color: #fff;
|
674 |
display: none; }
|
675 |
+
.block-search.block-search-kb-link {
|
676 |
+
text-align: center;
|
677 |
+
margin-top: 25px; }
|
678 |
+
.block-search.block-search-kb-link a {
|
679 |
+
text-decoration: underline; }
|
680 |
+
|
681 |
|
682 |
/*------block-faq----------------------------------------------------------------------------*/
|
683 |
.block-faq {
|
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 Team
|
8 |
-
Version: 5.8
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
@@ -70,7 +70,7 @@ if ( is_admin() ){
|
|
70 |
add_action('init', 'ecwid_backward_compatibility');
|
71 |
add_action('send_headers', 'ecwid_503_on_store_closed');
|
72 |
add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
|
73 |
-
add_action('template_redirect', 'ecwid_apply_theme');
|
74 |
add_action('wp_enqueue_scripts', 'ecwid_enqueue_frontend');
|
75 |
add_action('wp', 'ecwid_seo_ultimate_compatibility', 0);
|
76 |
add_action('wp', 'ecwid_remove_default_canonical');
|
@@ -142,17 +142,18 @@ function ecwid_init_integrations()
|
|
142 |
{
|
143 |
if ( !function_exists( 'get_plugins' ) ) { require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); }
|
144 |
|
145 |
-
$integrations = array(
|
146 |
-
'
|
147 |
-
'
|
148 |
-
'
|
149 |
-
'
|
150 |
-
'
|
|
|
151 |
);
|
152 |
|
153 |
-
foreach ($integrations as $
|
154 |
-
if ( is_plugin_active($plugin) ) {
|
155 |
-
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-integration-' . $
|
156 |
}
|
157 |
}
|
158 |
}
|
@@ -633,6 +634,13 @@ function ecwid_check_version()
|
|
633 |
// Since 5.8
|
634 |
add_option( 'ecwid_print_html_catalog', 'Y' );
|
635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
Ecwid_Config::load_from_ini();
|
637 |
|
638 |
add_option( 'force_scriptjs_render', false );
|
@@ -982,16 +990,25 @@ function ecwid_ajax_crawling_fragment() {
|
|
982 |
function ecwid_meta() {
|
983 |
|
984 |
echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
995 |
} else {
|
996 |
$store_id = get_ecwid_store_id();
|
997 |
$params = ecwid_get_scriptjs_params();
|
@@ -1213,7 +1230,7 @@ function _ecwid_get_seo_title()
|
|
1213 |
|
1214 |
if ( $product ) {
|
1215 |
$ecwid_seo_title = $product->name;
|
1216 |
-
if ( $category ) {
|
1217 |
$ecwid_seo_title .= ' ' . $separator . $category->name;
|
1218 |
}
|
1219 |
}
|
@@ -1261,7 +1278,7 @@ function _ecwid_get_seo_title()
|
|
1261 |
|
1262 |
if ( $product->defaultCategoryId ) {
|
1263 |
$category = $api->get_category( $product->defaultCategoryId );
|
1264 |
-
if ( $category && isset( $category->name ) ) {
|
1265 |
$ecwid_seo_title .= ' ' . ecwid_get_title_separator() . ' ' . $category->name;
|
1266 |
}
|
1267 |
}
|
@@ -1875,41 +1892,12 @@ function ecwid_sync_do_page() {
|
|
1875 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
|
1876 |
|
1877 |
$prods = new Ecwid_Products();
|
1878 |
-
|
1879 |
$estimation = $prods->estimate_sync();
|
1880 |
|
1881 |
require_once ECWID_PLUGIN_DIR . 'templates/sync.php';
|
1882 |
}
|
1883 |
|
1884 |
-
function ecwid_get_categories($nocache = false) {
|
1885 |
-
$categories = EcwidPlatform::cache_get('all_categories');
|
1886 |
-
|
1887 |
-
if ( false == $categories || $nocache ) {
|
1888 |
-
|
1889 |
-
$request = Ecwid_Http::create_get(
|
1890 |
-
'get_categories_through_endpoint',
|
1891 |
-
ecwid_get_categories_js_url(),
|
1892 |
-
array( Ecwid_Http::POLICY_EXPECT_JSONP )
|
1893 |
-
);
|
1894 |
-
|
1895 |
-
if (!$request) {
|
1896 |
-
return array();
|
1897 |
-
}
|
1898 |
-
|
1899 |
-
$categories = $request->do_request();
|
1900 |
-
|
1901 |
-
if (!is_null($categories)) {
|
1902 |
-
EcwidPlatform::cache_set( 'all_categories', $categories, 60 * 60 * 2 );
|
1903 |
-
}
|
1904 |
-
}
|
1905 |
-
|
1906 |
-
if ( !is_array($categories) || !$categories ) {
|
1907 |
-
return array();
|
1908 |
-
}
|
1909 |
-
|
1910 |
-
return $categories;
|
1911 |
-
}
|
1912 |
-
|
1913 |
function ecwid_reset_categories_cache()
|
1914 |
{
|
1915 |
if (!current_user_can('manage_options')) {
|
@@ -2035,8 +2023,6 @@ function ecwid_common_admin_scripts() {
|
|
2035 |
'product_shortcode' => Ecwid_Shortcode_Product::get_shortcode_name(),
|
2036 |
'legacy_appearance' => ecwid_is_legacy_appearance_used()
|
2037 |
));
|
2038 |
-
|
2039 |
-
wp_enqueue_script('ecwid-sync', ECWID_PLUGIN_URL . 'js/sync.js', array(), get_option('ecwid_plugin_version'));
|
2040 |
}
|
2041 |
|
2042 |
function ecwid_is_legacy_appearance_used() {
|
@@ -2083,8 +2069,9 @@ function ecwid_get_register_link()
|
|
2083 |
|
2084 |
function ecwid_create_store() {
|
2085 |
$api = new Ecwid_Api_V3();
|
2086 |
-
$result = $api->create_store();
|
2087 |
|
|
|
|
|
2088 |
if ( is_array( $result ) && $result['response']['code'] == 200 ) {
|
2089 |
$data = json_decode( $result['body'] );
|
2090 |
|
@@ -2234,6 +2221,10 @@ function ecwid_admin_do_page( $page ) {
|
|
2234 |
$page = $_GET['ecwid_page'];
|
2235 |
}
|
2236 |
|
|
|
|
|
|
|
|
|
2237 |
if ($page == ecwid_get_admin_iframe_upgrade_page()) {
|
2238 |
update_option('ecwid_api_check_time', time() - ECWID_API_AVAILABILITY_CHECK_TIME + 10 * 60);
|
2239 |
}
|
@@ -2409,30 +2400,72 @@ function ecwid_test_oauth($force = false)
|
|
2409 |
|
2410 |
function ecwid_get_categories_for_selector() {
|
2411 |
|
2412 |
-
|
2413 |
-
if (empty($categories)) {
|
2414 |
-
return array();
|
2415 |
-
}
|
2416 |
-
$result = array();
|
2417 |
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
|
|
2424 |
|
2425 |
-
|
|
|
|
|
|
|
2426 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2427 |
|
2428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2430 |
return $result;
|
2431 |
}
|
2432 |
|
2433 |
function ecwid_advanced_settings_do_page() {
|
2434 |
-
$categories = ecwid_get_categories_for_selector();
|
2435 |
-
|
2436 |
$is_sso_enabled = ecwid_is_sso_enabled();
|
2437 |
|
2438 |
global $ecwid_oauth;
|
@@ -2745,7 +2778,6 @@ function ecwid_check_for_remote_connection_errors()
|
|
2745 |
global $ecwid_oauth;
|
2746 |
|
2747 |
$results = array();
|
2748 |
-
$results['https_get_error'] = wp_remote_get(ecwid_get_categories_js_url('abc'));
|
2749 |
$results['https_post_error'] = wp_remote_post($ecwid_oauth->get_test_post_url());
|
2750 |
|
2751 |
foreach ($results as $type => $value) {
|
@@ -2940,18 +2972,6 @@ function ecwid_embed_svg($name) {
|
|
2940 |
echo $code;
|
2941 |
}
|
2942 |
|
2943 |
-
function ecwid_get_categories_js_url($callback = null) {
|
2944 |
-
|
2945 |
-
$url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/categories.js?ownerid=' . get_ecwid_store_id();
|
2946 |
-
|
2947 |
-
if ($callback) {
|
2948 |
-
$url .= '&callback=' . $callback;
|
2949 |
-
}
|
2950 |
-
|
2951 |
-
return $url;
|
2952 |
-
}
|
2953 |
-
|
2954 |
-
|
2955 |
function ecwid_use_old_landing() {
|
2956 |
return version_compare(get_bloginfo('version'), '3.7') < 0;
|
2957 |
}
|
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 Team
|
8 |
+
Version: 5.8.1
|
9 |
Author URI: http://www.ecwid.com?source=wporg
|
10 |
*/
|
11 |
|
70 |
add_action('init', 'ecwid_backward_compatibility');
|
71 |
add_action('send_headers', 'ecwid_503_on_store_closed');
|
72 |
add_action('template_redirect', 'ecwid_404_on_broken_escaped_fragment');
|
73 |
+
add_action('template_redirect', 'ecwid_apply_theme'); // Why not init?
|
74 |
add_action('wp_enqueue_scripts', 'ecwid_enqueue_frontend');
|
75 |
add_action('wp', 'ecwid_seo_ultimate_compatibility', 0);
|
76 |
add_action('wp', 'ecwid_remove_default_canonical');
|
142 |
{
|
143 |
if ( !function_exists( 'get_plugins' ) ) { require_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); }
|
144 |
|
145 |
+
$integrations = array(
|
146 |
+
'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'aiosp',
|
147 |
+
'wordpress-seo/wp-seo.php' => 'wpseo',
|
148 |
+
'wordpress-seo-premium/wp-seo-premium.php' => 'wpseo',
|
149 |
+
'divi-builder/divi-builder.php' => 'divibuilder',
|
150 |
+
'autoptimize/autoptimize.php' => 'autoptimize',
|
151 |
+
'above-the-fold-optimization/abovethefold.php' => 'above-the-fold',
|
152 |
);
|
153 |
|
154 |
+
foreach ( $integrations as $plugin => $class ) {
|
155 |
+
if ( is_plugin_active( $plugin ) ) {
|
156 |
+
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-integration-' . $class . '.php';
|
157 |
}
|
158 |
}
|
159 |
}
|
634 |
// Since 5.8
|
635 |
add_option( 'ecwid_print_html_catalog', 'Y' );
|
636 |
|
637 |
+
// Since 5.8.x
|
638 |
+
add_option( 'ecwid_print_category_in_title', 'Y' );
|
639 |
+
|
640 |
+
|
641 |
+
// Since 5.8.1+
|
642 |
+
add_option( Ecwid_Products::OPTION_SYNC_LIMIT, 20 );
|
643 |
+
|
644 |
Ecwid_Config::load_from_ini();
|
645 |
|
646 |
add_option( 'force_scriptjs_render', false );
|
990 |
function ecwid_meta() {
|
991 |
|
992 |
echo '<meta http-equiv="x-dns-prefetch-control" content="on">' . PHP_EOL;
|
993 |
+
|
994 |
+
if (!Ecwid_Store_Page::is_store_page()) {
|
995 |
+
echo '<link href="https://d201eyh6wia12q.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
|
996 |
+
echo '<link href="https://d3fi9i0jj23cau.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
|
997 |
+
echo '<link href="https://dqzrr9k4bjpzk.cloudfront.net" rel="preconnect" crossorigin />' . PHP_EOL;
|
998 |
+
echo '<link href="https://ecwid-static-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
|
999 |
+
echo '<link href="https://ecwid-images-ru.gcdn.co" rel="preconnect" crossorigin />' . PHP_EOL;
|
1000 |
+
echo '<link href="https://app.ecwid.com" rel="preconnect" crossorigin />' . PHP_EOL;
|
1001 |
+
|
1002 |
+
if (ecwid_is_store_page_available()) {
|
1003 |
+
|
1004 |
+
$store_id = get_ecwid_store_id();
|
1005 |
+
$params = ecwid_get_scriptjs_params();
|
1006 |
+
$scriptjs_url = 'https://' . Ecwid_Config::get_scriptjs_domain() . '/script.js?' . $store_id . $params;
|
1007 |
+
echo '<link rel="prefetch" href="' . $scriptjs_url . '" />' . PHP_EOL;
|
1008 |
+
|
1009 |
+
$page_url = Ecwid_Store_Page::get_store_url();
|
1010 |
+
echo '<link rel="prerender" href="' . $page_url . '" />' . PHP_EOL;
|
1011 |
+
}
|
1012 |
} else {
|
1013 |
$store_id = get_ecwid_store_id();
|
1014 |
$params = ecwid_get_scriptjs_params();
|
1230 |
|
1231 |
if ( $product ) {
|
1232 |
$ecwid_seo_title = $product->name;
|
1233 |
+
if ( $category && get_option( 'ecwid_print_category_in_title', true ) ) {
|
1234 |
$ecwid_seo_title .= ' ' . $separator . $category->name;
|
1235 |
}
|
1236 |
}
|
1278 |
|
1279 |
if ( $product->defaultCategoryId ) {
|
1280 |
$category = $api->get_category( $product->defaultCategoryId );
|
1281 |
+
if ( $category && isset( $category->name ) && get_option( 'ecwid_print_category_in_title', true ) ) {
|
1282 |
$ecwid_seo_title .= ' ' . ecwid_get_title_separator() . ' ' . $category->name;
|
1283 |
}
|
1284 |
}
|
1892 |
require_once ECWID_PLUGIN_DIR . 'includes/class-ecwid-products.php';
|
1893 |
|
1894 |
$prods = new Ecwid_Products();
|
1895 |
+
|
1896 |
$estimation = $prods->estimate_sync();
|
1897 |
|
1898 |
require_once ECWID_PLUGIN_DIR . 'templates/sync.php';
|
1899 |
}
|
1900 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1901 |
function ecwid_reset_categories_cache()
|
1902 |
{
|
1903 |
if (!current_user_can('manage_options')) {
|
2023 |
'product_shortcode' => Ecwid_Shortcode_Product::get_shortcode_name(),
|
2024 |
'legacy_appearance' => ecwid_is_legacy_appearance_used()
|
2025 |
));
|
|
|
|
|
2026 |
}
|
2027 |
|
2028 |
function ecwid_is_legacy_appearance_used() {
|
2069 |
|
2070 |
function ecwid_create_store() {
|
2071 |
$api = new Ecwid_Api_V3();
|
|
|
2072 |
|
2073 |
+
$result = $api->create_store();
|
2074 |
+
|
2075 |
if ( is_array( $result ) && $result['response']['code'] == 200 ) {
|
2076 |
$data = json_decode( $result['body'] );
|
2077 |
|
2221 |
$page = $_GET['ecwid_page'];
|
2222 |
}
|
2223 |
|
2224 |
+
if (isset($_GET['ec-store-page']) && $_GET['ec-store-page']) {
|
2225 |
+
$page = $_GET['ec-store-page'];
|
2226 |
+
}
|
2227 |
+
|
2228 |
if ($page == ecwid_get_admin_iframe_upgrade_page()) {
|
2229 |
update_option('ecwid_api_check_time', time() - ECWID_API_AVAILABILITY_CHECK_TIME + 10 * 60);
|
2230 |
}
|
2400 |
|
2401 |
function ecwid_get_categories_for_selector() {
|
2402 |
|
2403 |
+
$cached = EcwidPlatform::get_from_categories_cache( 'ecwid_categories_for_selector' );
|
|
|
|
|
|
|
|
|
2404 |
|
2405 |
+
if ( $cached ) {
|
2406 |
+
return $cached;
|
2407 |
+
}
|
2408 |
+
|
2409 |
+
$api = new Ecwid_Api_V3();
|
2410 |
+
|
2411 |
+
$categories = $api->get_categories( array( 'hidden_categories' => true ) );
|
2412 |
|
2413 |
+
$all_categories = array();
|
2414 |
+
|
2415 |
+
foreach ( $categories->items as $category ) {
|
2416 |
+
$all_categories[$category->id] = $category;
|
2417 |
}
|
2418 |
+
|
2419 |
+
if ( $categories->total > $categories->count ) {
|
2420 |
+
$offset = 100;
|
2421 |
+
|
2422 |
+
$page = 0;
|
2423 |
+
while ( $categories->count + $offset * $page > $categories->total ) {
|
2424 |
+
$page++;
|
2425 |
+
$categories = $api->get_categories( array( 'offset' => $offset * $page, 'hidden_categories' => true ) );
|
2426 |
|
2427 |
+
foreach ( $categories->items as $category ) {
|
2428 |
+
$all_categories[$category->id] = $category;
|
2429 |
+
}
|
2430 |
+
}
|
2431 |
+
}
|
2432 |
+
|
2433 |
+
$parents = array();
|
2434 |
|
2435 |
+
$result = array();
|
2436 |
+
foreach ( $all_categories as $category ) {
|
2437 |
+
$result[$category->id] = $category;
|
2438 |
+
|
2439 |
+
if ( !@$category->parentId ) {
|
2440 |
+
$result[$category->id]->path = $category->name;
|
2441 |
+
} else {
|
2442 |
+
$current_parent_id = $category->parentId;
|
2443 |
+
|
2444 |
+
$path = $category->name;
|
2445 |
+
while ( $current_parent_id != 0 ) {
|
2446 |
+
$parent = $all_categories[$current_parent_id];
|
2447 |
+
|
2448 |
+
$path = $parent->name . ' > ' . $path;
|
2449 |
+
|
2450 |
+
$current_parent_id = isset( $parent->parentId ) ? $parent->parentId : 0;
|
2451 |
+
}
|
2452 |
+
|
2453 |
+
$result[$category->id]->path = $path;
|
2454 |
+
}
|
2455 |
+
}
|
2456 |
+
|
2457 |
+
function compare_categories($cat1, $cat2) {
|
2458 |
+
return strcasecmp( $cat1->path, $cat2->path );
|
2459 |
+
}
|
2460 |
+
|
2461 |
+
usort( $result, 'compare_categories' );
|
2462 |
+
|
2463 |
+
EcwidPlatform::store_in_categories_cache( 'ecwid_categories_for_selector', $result );
|
2464 |
+
|
2465 |
return $result;
|
2466 |
}
|
2467 |
|
2468 |
function ecwid_advanced_settings_do_page() {
|
|
|
|
|
2469 |
$is_sso_enabled = ecwid_is_sso_enabled();
|
2470 |
|
2471 |
global $ecwid_oauth;
|
2778 |
global $ecwid_oauth;
|
2779 |
|
2780 |
$results = array();
|
|
|
2781 |
$results['https_post_error'] = wp_remote_post($ecwid_oauth->get_test_post_url());
|
2782 |
|
2783 |
foreach ($results as $type => $value) {
|
2972 |
echo $code;
|
2973 |
}
|
2974 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2975 |
function ecwid_use_old_landing() {
|
2976 |
return version_compare(get_bloginfo('version'), '3.7') < 0;
|
2977 |
}
|
includes/class-ecwid-admin.php
CHANGED
@@ -322,11 +322,11 @@ class Ecwid_Admin {
|
|
322 |
|
323 |
static public function are_auto_menus_enabled()
|
324 |
{
|
325 |
-
if ( get_option( self::OPTION_ENABLE_AUTO_MENUS )
|
326 |
return false;
|
327 |
}
|
328 |
|
329 |
-
if ( get_option( self::OPTION_ENABLE_AUTO_MENUS )
|
330 |
return true;
|
331 |
}
|
332 |
|
322 |
|
323 |
static public function are_auto_menus_enabled()
|
324 |
{
|
325 |
+
if ( get_option( self::OPTION_ENABLE_AUTO_MENUS ) == self::OPTION_ENABLE_AUTO_MENUS_OFF ) {
|
326 |
return false;
|
327 |
}
|
328 |
|
329 |
+
if ( get_option( self::OPTION_ENABLE_AUTO_MENUS ) == self::OPTION_ENABLE_AUTO_MENUS_ON ) {
|
330 |
return true;
|
331 |
}
|
332 |
|
includes/class-ecwid-ajax-defer-renderer.php
CHANGED
@@ -24,8 +24,9 @@ class Ecwid_Ajax_Defer_Renderer {
|
|
24 |
protected function __construct()
|
25 |
{
|
26 |
add_option( self::OPTION_DEFER_RENDERING, self::AUTO );
|
27 |
-
$this->init();
|
28 |
|
|
|
|
|
29 |
add_action( 'ecwid_on_plugin_upgrade', array( $this, 'plugin_upgrade' ) );
|
30 |
}
|
31 |
|
24 |
protected function __construct()
|
25 |
{
|
26 |
add_option( self::OPTION_DEFER_RENDERING, self::AUTO );
|
|
|
27 |
|
28 |
+
add_action( 'template_redirect', array( $this, 'init' ) );// to make sure it is called after ecwid_apply_theme
|
29 |
+
add_action( 'admin_init', array( $this, 'init' ) );
|
30 |
add_action( 'ecwid_on_plugin_upgrade', array( $this, 'plugin_upgrade' ) );
|
31 |
}
|
32 |
|
includes/class-ecwid-integration-wpseo.php
CHANGED
@@ -17,6 +17,7 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
|
|
17 |
add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
|
18 |
if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
|
19 |
add_filter( 'wpseo_title', 'ecwid_seo_title' );
|
|
|
20 |
add_filter( 'wpseo_metadesc', '__return_false' );
|
21 |
|
22 |
add_filter( 'ecwid_og_tags', array( $this, 'filter_og_tags' ) );
|
@@ -39,7 +40,6 @@ class Ecwid_Integration_WordPress_SEO_By_Yoast
|
|
39 |
return $tags;
|
40 |
}
|
41 |
|
42 |
-
|
43 |
// Disable titles, descriptions and canonical link on ecwid _escaped_fragment_ pages
|
44 |
public function disable_seo_on_escaped_fragment()
|
45 |
{
|
17 |
add_filter( 'wpseo_do_sitemap_ecwid', array( $this, 'wpseo_hook_do_sitemap' ) );
|
18 |
if ( ecwid_is_applicable_escaped_fragment() || Ecwid_Seo_Links::is_product_browser_url() ) {
|
19 |
add_filter( 'wpseo_title', 'ecwid_seo_title' );
|
20 |
+
remove_filter( 'wp_title', 'ecwid_seo_title' , 10000, 3 );
|
21 |
add_filter( 'wpseo_metadesc', '__return_false' );
|
22 |
|
23 |
add_filter( 'ecwid_og_tags', array( $this, 'filter_og_tags' ) );
|
40 |
return $tags;
|
41 |
}
|
42 |
|
|
|
43 |
// Disable titles, descriptions and canonical link on ecwid _escaped_fragment_ pages
|
44 |
public function disable_seo_on_escaped_fragment()
|
45 |
{
|
includes/class-ecwid-nav-menus.php
CHANGED
@@ -209,9 +209,12 @@ class Ecwid_Nav_Menus {
|
|
209 |
|
210 |
if ( !$posts ) {
|
211 |
$posts = array();
|
212 |
-
$
|
|
|
|
|
213 |
if ($categories) {
|
214 |
foreach ($categories as $category) {
|
|
|
215 |
$post = new stdClass;
|
216 |
$post->ID = -1;
|
217 |
$post->post_author = '';
|
@@ -224,7 +227,7 @@ class Ecwid_Nav_Menus {
|
|
224 |
$post->to_ping = '';
|
225 |
$post->pinged = '';
|
226 |
$post->post_parent = 0;
|
227 |
-
$post->url =
|
228 |
$post->classes = '';
|
229 |
$post->type = 'post';
|
230 |
$post->db_id = 0;
|
209 |
|
210 |
if ( !$posts ) {
|
211 |
$posts = array();
|
212 |
+
$api = new Ecwid_Api_V3();
|
213 |
+
$categories = $api->get_categories( array( 'parent' => 0 ) );
|
214 |
+
|
215 |
if ($categories) {
|
216 |
foreach ($categories as $category) {
|
217 |
+
$category = Ecwid_Category::get_by_id( $category->id );
|
218 |
$post = new stdClass;
|
219 |
$post->ID = -1;
|
220 |
$post->post_author = '';
|
227 |
$post->to_ping = '';
|
228 |
$post->pinged = '';
|
229 |
$post->post_parent = 0;
|
230 |
+
$post->url = $category->link;
|
231 |
$post->classes = '';
|
232 |
$post->type = 'post';
|
233 |
$post->db_id = 0;
|
includes/class-ecwid-product-popup.php
CHANGED
@@ -28,8 +28,13 @@ class Ecwid_Product_Popup {
|
|
28 |
if ( !in_array( $current_screen->post_type, array( 'page', 'post' ) ) ) {
|
29 |
return;
|
30 |
}
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
add_action('media_buttons_context', array($this, 'add_editor_button'));
|
34 |
add_action('admin_enqueue_scripts', array($this, 'add_scripts'));
|
35 |
add_action('in_admin_header', array($this, 'add_popup'));
|
28 |
if ( !in_array( $current_screen->post_type, array( 'page', 'post' ) ) ) {
|
29 |
return;
|
30 |
}
|
31 |
+
|
32 |
+
|
33 |
+
if ( is_plugin_active( 'elementor/elementor.php' ) && @$_GET['action'] == 'elementor' ) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
if (Ecwid_Api_V3::get_token()) {
|
38 |
add_action('media_buttons_context', array($this, 'add_editor_button'));
|
39 |
add_action('admin_enqueue_scripts', array($this, 'add_scripts'));
|
40 |
add_action('in_admin_header', array($this, 'add_popup'));
|
includes/class-ecwid-products.php
CHANGED
@@ -14,6 +14,9 @@ class Ecwid_Products {
|
|
14 |
const OPTION_ENABLED = 'ecwid_local_base_enabled';
|
15 |
const OPTION_NO_SSE = 'ecwid_local_base_no_sse';
|
16 |
const OPTION_NO_IMAGES = 'ecwid_local_base_no_images';
|
|
|
|
|
|
|
17 |
|
18 |
public function __construct() {
|
19 |
|
@@ -34,6 +37,7 @@ class Ecwid_Products {
|
|
34 |
add_action( 'wp_ajax_ecwid_get_post_link', array($this, 'ajax_get_post_link' ) );
|
35 |
add_action( 'wp_ajax_nopriv_ecwid_get_post_link', array($this, 'ajax_get_post_link' ) );
|
36 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend' ) );
|
|
|
37 |
add_filter( 'post_type_link', array( $this, 'replace_product_page_url_on_search' ), 10, 3 );
|
38 |
add_action( 'template_redirect', array( $this, 'redirect_to_store_page' ) );
|
39 |
add_action( 'ecwid_on_plugin_update', array( $this, 'on_plugin_update' ) );
|
@@ -43,6 +47,8 @@ class Ecwid_Products {
|
|
43 |
add_filter( 'posts_join_paged', array( $this, 'join_out_of_stock' ) );
|
44 |
}
|
45 |
|
|
|
|
|
46 |
$this->_sync_progress_callback = '__return_false';
|
47 |
}
|
48 |
|
@@ -57,6 +63,13 @@ class Ecwid_Products {
|
|
57 |
'ajaxurl' => admin_url('admin-ajax.php')
|
58 |
));
|
59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
public function replace_product_page_url_on_search( $url, $post, $leavename = false ) {
|
62 |
if ( $post->post_type == self::POST_TYPE_PRODUCT ) {
|
@@ -246,18 +259,31 @@ class Ecwid_Products {
|
|
246 |
}
|
247 |
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
public function is_in_sync() {
|
250 |
$stats = $this->_api->get_store_update_stats();
|
251 |
|
252 |
$update_time = strtotime($stats->productsUpdated);
|
253 |
|
254 |
-
$last_update = EcwidPlatform::get(
|
255 |
|
256 |
return $last_update > $update_time;
|
257 |
}
|
258 |
|
259 |
public function set_last_update_time($time) {
|
260 |
-
EcwidPlatform::set(
|
261 |
}
|
262 |
|
263 |
public function get_last_sync_time() {
|
@@ -269,7 +295,7 @@ class Ecwid_Products {
|
|
269 |
if ( !Ecwid_Api_V3::get_token() ) return array('last_update' => 0);
|
270 |
|
271 |
$updated = $this->_api->search_products( array(
|
272 |
-
'updatedFrom' => $this->_status->
|
273 |
'limit' => 1,
|
274 |
'offset' => 0,
|
275 |
'sortBy' => 'UPDATED_TIME_ASC'
|
@@ -379,7 +405,7 @@ class Ecwid_Products {
|
|
379 |
$over = FALSE;
|
380 |
|
381 |
$offset = 0;
|
382 |
-
$limit
|
383 |
if ($settings && @$settings['offset']) {
|
384 |
$offset = $settings['offset'];
|
385 |
}
|
@@ -437,19 +463,6 @@ class Ecwid_Products {
|
|
437 |
return true;
|
438 |
}
|
439 |
|
440 |
-
protected function _find_post_by_product_id($product_id) {
|
441 |
-
global $wpdb;
|
442 |
-
|
443 |
-
$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '%s' AND meta_value = '%s' LIMIT 1", 'ecwid_id', $product_id ) );
|
444 |
-
|
445 |
-
$id = null;
|
446 |
-
if (!empty($row)) {
|
447 |
-
$id = $row->post_id;
|
448 |
-
}
|
449 |
-
|
450 |
-
return $id;
|
451 |
-
}
|
452 |
-
|
453 |
protected function _process_product( $product ) {
|
454 |
|
455 |
$id = $this->_find_post_by_product_id( $product->id );
|
14 |
const OPTION_ENABLED = 'ecwid_local_base_enabled';
|
15 |
const OPTION_NO_SSE = 'ecwid_local_base_no_sse';
|
16 |
const OPTION_NO_IMAGES = 'ecwid_local_base_no_images';
|
17 |
+
const OPTION_SYNC_LIMIT = 'ecwid_sync_limit';
|
18 |
+
|
19 |
+
public $sync_limit = 20;
|
20 |
|
21 |
public function __construct() {
|
22 |
|
37 |
add_action( 'wp_ajax_ecwid_get_post_link', array($this, 'ajax_get_post_link' ) );
|
38 |
add_action( 'wp_ajax_nopriv_ecwid_get_post_link', array($this, 'ajax_get_post_link' ) );
|
39 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend' ) );
|
40 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin' ) );
|
41 |
add_filter( 'post_type_link', array( $this, 'replace_product_page_url_on_search' ), 10, 3 );
|
42 |
add_action( 'template_redirect', array( $this, 'redirect_to_store_page' ) );
|
43 |
add_action( 'ecwid_on_plugin_update', array( $this, 'on_plugin_update' ) );
|
47 |
add_filter( 'posts_join_paged', array( $this, 'join_out_of_stock' ) );
|
48 |
}
|
49 |
|
50 |
+
$this->sync_limit = get_option( self::OPTION_SYNC_LIMIT, $this->sync_limit );
|
51 |
+
|
52 |
$this->_sync_progress_callback = '__return_false';
|
53 |
}
|
54 |
|
63 |
'ajaxurl' => admin_url('admin-ajax.php')
|
64 |
));
|
65 |
}
|
66 |
+
|
67 |
+
public function enqueue_admin() {
|
68 |
+
wp_enqueue_script('ecwid-sync', ECWID_PLUGIN_URL . 'js/sync.js', array(), get_option('ecwid_plugin_version'));
|
69 |
+
wp_localize_script( 'ecwid-sync', 'ecwidSync', array(
|
70 |
+
'syncLimit' => $this->sync_limit
|
71 |
+
));
|
72 |
+
}
|
73 |
|
74 |
public function replace_product_page_url_on_search( $url, $post, $leavename = false ) {
|
75 |
if ( $post->post_type == self::POST_TYPE_PRODUCT ) {
|
259 |
}
|
260 |
|
261 |
|
262 |
+
protected function _find_post_by_product_id($product_id) {
|
263 |
+
global $wpdb;
|
264 |
+
|
265 |
+
$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '%s' AND meta_value = '%s' LIMIT 1", 'ecwid_id', $product_id ) );
|
266 |
+
|
267 |
+
$id = null;
|
268 |
+
if (!empty($row)) {
|
269 |
+
$id = $row->post_id;
|
270 |
+
}
|
271 |
+
|
272 |
+
return $id;
|
273 |
+
}
|
274 |
+
|
275 |
public function is_in_sync() {
|
276 |
$stats = $this->_api->get_store_update_stats();
|
277 |
|
278 |
$update_time = strtotime($stats->productsUpdated);
|
279 |
|
280 |
+
$last_update = EcwidPlatform::get(Ecwid_Products_Sync_Status::OPTION_UPDATE_TIME);
|
281 |
|
282 |
return $last_update > $update_time;
|
283 |
}
|
284 |
|
285 |
public function set_last_update_time($time) {
|
286 |
+
EcwidPlatform::set(Ecwid_Products_Sync_Status::OPTION_UPDATE_TIME, $time);
|
287 |
}
|
288 |
|
289 |
public function get_last_sync_time() {
|
295 |
if ( !Ecwid_Api_V3::get_token() ) return array('last_update' => 0);
|
296 |
|
297 |
$updated = $this->_api->search_products( array(
|
298 |
+
'updatedFrom' => $this->_status->get_last_sync_time(),
|
299 |
'limit' => 1,
|
300 |
'offset' => 0,
|
301 |
'sortBy' => 'UPDATED_TIME_ASC'
|
405 |
$over = FALSE;
|
406 |
|
407 |
$offset = 0;
|
408 |
+
$limit = $this->sync_limit;
|
409 |
if ($settings && @$settings['offset']) {
|
410 |
$offset = $settings['offset'];
|
411 |
}
|
463 |
return true;
|
464 |
}
|
465 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
protected function _process_product( $product ) {
|
467 |
|
468 |
$id = $this->_find_post_by_product_id( $product->id );
|
includes/class-ecwid-store-editor.php
CHANGED
@@ -12,14 +12,18 @@ class Ecwid_Store_Editor {
|
|
12 |
|
13 |
add_action( 'current_screen', array($this, 'init') );
|
14 |
}
|
15 |
-
|
16 |
public function init()
|
17 |
{
|
18 |
$current_screen = get_current_screen();
|
19 |
|
20 |
-
if ( $current_screen->base != 'post' || !in_array($current_screen->post_type, array('post', 'page')) ) {
|
21 |
return;
|
22 |
}
|
|
|
|
|
|
|
|
|
23 |
|
24 |
add_filter( 'mce_external_plugins', array( $this, 'add_mce_plugin' ) );
|
25 |
add_action( 'media_buttons_context', array( $this, 'add_editor_button' ) );
|
12 |
|
13 |
add_action( 'current_screen', array($this, 'init') );
|
14 |
}
|
15 |
+
|
16 |
public function init()
|
17 |
{
|
18 |
$current_screen = get_current_screen();
|
19 |
|
20 |
+
if ( $current_screen->base != 'post' || !in_array( $current_screen->post_type, array( 'post', 'page' ) ) ) {
|
21 |
return;
|
22 |
}
|
23 |
+
|
24 |
+
if ( is_plugin_active( 'elementor/elementor.php' ) && @$_GET['action'] == 'elementor' ) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
|
28 |
add_filter( 'mce_external_plugins', array( $this, 'add_mce_plugin' ) );
|
29 |
add_action( 'media_buttons_context', array( $this, 'add_editor_button' ) );
|
includes/class-ecwid-store-page.php
CHANGED
@@ -192,7 +192,8 @@ class Ecwid_Store_Page {
|
|
192 |
}
|
193 |
|
194 |
unset( $pages[$index] );
|
195 |
-
|
|
|
196 |
$pages = self::_set_store_pages( $pages );
|
197 |
|
198 |
if ( $page_id == get_option( self::OPTION_MAIN_STORE_PAGE_ID ) ) {
|
@@ -293,6 +294,10 @@ class Ecwid_Store_Page {
|
|
293 |
self::reset_store_page( $post_id );
|
294 |
}
|
295 |
}
|
|
|
|
|
|
|
|
|
296 |
|
297 |
if ( $has_pb && in_array( get_post_status( $post_id ), self::_get_allowed_post_statuses() ) ) {
|
298 |
self::add_store_page( $post_id );
|
192 |
}
|
193 |
|
194 |
unset( $pages[$index] );
|
195 |
+
ecwid_reset_categories_cache();
|
196 |
+
|
197 |
$pages = self::_set_store_pages( $pages );
|
198 |
|
199 |
if ( $page_id == get_option( self::OPTION_MAIN_STORE_PAGE_ID ) ) {
|
294 |
self::reset_store_page( $post_id );
|
295 |
}
|
296 |
}
|
297 |
+
|
298 |
+
if ($has_pb) {
|
299 |
+
ecwid_reset_categories_cache();
|
300 |
+
}
|
301 |
|
302 |
if ( $has_pb && in_array( get_post_status( $post_id ), self::_get_allowed_post_statuses() ) ) {
|
303 |
self::add_store_page( $post_id );
|
includes/faq_entries.php
CHANGED
@@ -4,7 +4,7 @@ $faqs = array(
|
|
4 |
array(
|
5 |
'title' => __( 'How secure is this plugin? Is my store PCI DSS compliant?', 'ecwid-shopping-cart' ),
|
6 |
'body' => __(
|
7 |
-
'Ecwid is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means you won
|
8 |
),
|
9 |
'priority' => 'newbie_with_woo'
|
10 |
),
|
@@ -19,7 +19,7 @@ $faqs = array(
|
|
19 |
array(
|
20 |
'title' => __( 'How to set up a storefront on Facebook with Ecwid?', 'ecwid-shopping-cart' ),
|
21 |
'body' => __(
|
22 |
-
'You can add your online store to your Facebook business page. No addons needed. Ecwid will automatically synchronize products, customers, orders and inventory between your WordPress and Facebook storefronts. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/
|
23 |
, 'ecwid-shopping-cart'
|
24 |
),
|
25 |
'priority' => 'newbie_with_woo'
|
@@ -28,7 +28,7 @@ $faqs = array(
|
|
28 |
'title' => __( 'How can I add a cart widget to my site sidebar?', 'ecwid-shopping-cart' ),
|
29 |
'body' => sprintf(
|
30 |
__(
|
31 |
-
'You can add product search box, cart widget and more on the <a href="%s">"Appearance / Widgets page"</a> here in your site admin. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#
|
32 |
, 'ecwid-shopping-cart'
|
33 |
),
|
34 |
admin_url("widgets.php?from-ecwid=true")
|
@@ -36,9 +36,11 @@ $faqs = array(
|
|
36 |
),
|
37 |
array(
|
38 |
'title' => __( 'How much does Ecwid cost?', 'ecwid-shopping-cart' ),
|
39 |
-
'body' =>
|
40 |
-
|
41 |
-
|
|
|
|
|
42 |
)
|
43 |
),
|
44 |
array(
|
@@ -57,7 +59,7 @@ $faqs = array(
|
|
57 |
array(
|
58 |
'title' => __( 'How to add a single product with the add to bag button to the site pages?', 'ecwid-shopping-cart' ),
|
59 |
'body' => __(
|
60 |
-
'To feature a single product on a separate page or blog post of your site, use <b>[ecwid_product]</b> shortcode. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#
|
61 |
, 'ecwid-shopping-cart'
|
62 |
)
|
63 |
),
|
4 |
array(
|
5 |
'title' => __( 'How secure is this plugin? Is my store PCI DSS compliant?', 'ecwid-shopping-cart' ),
|
6 |
'body' => __(
|
7 |
+
'Ecwid is PCI DSS Level 1 certified, which is the gold standard for e-commerce solutions worldwide. This means you won\'t have any banking compliance issues when selling online with Ecwid. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#security">More details.</a>', 'ecwid-shopping-cart'
|
8 |
),
|
9 |
'priority' => 'newbie_with_woo'
|
10 |
),
|
19 |
array(
|
20 |
'title' => __( 'How to set up a storefront on Facebook with Ecwid?', 'ecwid-shopping-cart' ),
|
21 |
'body' => __(
|
22 |
+
'You can add your online store to your Facebook business page. No addons needed. Ecwid will automatically synchronize products, customers, orders and inventory between your WordPress and Facebook storefronts. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/115005892705-Facebook-Shop">More details.</a>'
|
23 |
, 'ecwid-shopping-cart'
|
24 |
),
|
25 |
'priority' => 'newbie_with_woo'
|
28 |
'title' => __( 'How can I add a cart widget to my site sidebar?', 'ecwid-shopping-cart' ),
|
29 |
'body' => sprintf(
|
30 |
__(
|
31 |
+
'You can add product search box, cart widget and more on the <a href="%s">"Appearance / Widgets page"</a> here in your site admin. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#sidebarwidgets">More details.</a>'
|
32 |
, 'ecwid-shopping-cart'
|
33 |
),
|
34 |
admin_url("widgets.php?from-ecwid=true")
|
36 |
),
|
37 |
array(
|
38 |
'title' => __( 'How much does Ecwid cost?', 'ecwid-shopping-cart' ),
|
39 |
+
'body' => sprintf(
|
40 |
+
__(
|
41 |
+
'Our 4 account types vary by number of products, types of functionality, and level of support. For more information, check out our <a target="_blank" href="%s">pricing page.</a><br /><br />Pro Tip: You can also save money by enrolling in our annual plans.'
|
42 |
+
, 'ecwid-shopping-cart'
|
43 |
+
), admin_url( 'admin.php?page=' . Ecwid_Admin::ADMIN_SLUG . '&ec-store-page=billing' )
|
44 |
)
|
45 |
),
|
46 |
array(
|
59 |
array(
|
60 |
'title' => __( 'How to add a single product with the add to bag button to the site pages?', 'ecwid-shopping-cart' ),
|
61 |
'body' => __(
|
62 |
+
'To feature a single product on a separate page or blog post of your site, use <b>[ecwid_product]</b> shortcode. <a target="_blank" href="https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#buynow">How to use it.</a>'
|
63 |
, 'ecwid-shopping-cart'
|
64 |
)
|
65 |
),
|
includes/oembed.php
CHANGED
@@ -9,7 +9,6 @@ function ecwid_oembed_content($data)
|
|
9 |
|
10 |
function ecwid_get_embed_content()
|
11 |
{
|
12 |
-
|
13 |
$html = '';
|
14 |
$root_category_id = 0;
|
15 |
|
@@ -18,8 +17,11 @@ function ecwid_get_embed_content()
|
|
18 |
|
19 |
foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
|
20 |
$shortcodes = ecwid_find_shortcodes($post_content, $shortcode_name);
|
|
|
|
|
|
|
21 |
}
|
22 |
-
|
23 |
if (!$shortcodes || !isset($shortcodes[0]) || !isset($shortcodes[0][3])) {
|
24 |
return;
|
25 |
}
|
@@ -28,7 +30,7 @@ function ecwid_get_embed_content()
|
|
28 |
if (!preg_match('/default_category_id=.([\\d]*)./', $attributes, $matches)) {
|
29 |
return;
|
30 |
}
|
31 |
-
|
32 |
$root_category_id = 0;
|
33 |
if (!is_numeric($matches[1])) {
|
34 |
return;
|
@@ -36,22 +38,20 @@ function ecwid_get_embed_content()
|
|
36 |
$root_category_id = $matches[1];
|
37 |
}
|
38 |
|
39 |
-
$
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
$max_items = 5;
|
46 |
|
47 |
$items = array();
|
48 |
|
49 |
$see_more = false;
|
50 |
$result = '';
|
51 |
-
if (!empty($categories)) {
|
52 |
-
foreach ($categories as $category) {
|
53 |
-
$
|
54 |
-
$items[$
|
55 |
if (count($items) >= $max_items) {
|
56 |
$see_more = true;
|
57 |
break;
|
@@ -75,12 +75,12 @@ function ecwid_get_embed_content()
|
|
75 |
}
|
76 |
|
77 |
if (!$see_more) {
|
78 |
-
$products = $api->
|
79 |
-
|
80 |
-
if ($products) {
|
81 |
-
foreach ($products as $product) {
|
82 |
-
$
|
83 |
-
$items[$
|
84 |
if (count($items) >= $max_items) {
|
85 |
$see_more = TRUE;
|
86 |
break;
|
9 |
|
10 |
function ecwid_get_embed_content()
|
11 |
{
|
|
|
12 |
$html = '';
|
13 |
$root_category_id = 0;
|
14 |
|
17 |
|
18 |
foreach (Ecwid_Shortcode_Base::get_store_shortcode_names() as $shortcode_name) {
|
19 |
$shortcodes = ecwid_find_shortcodes($post_content, $shortcode_name);
|
20 |
+
if ($shortcodes) {
|
21 |
+
break;
|
22 |
+
}
|
23 |
}
|
24 |
+
|
25 |
if (!$shortcodes || !isset($shortcodes[0]) || !isset($shortcodes[0][3])) {
|
26 |
return;
|
27 |
}
|
30 |
if (!preg_match('/default_category_id=.([\\d]*)./', $attributes, $matches)) {
|
31 |
return;
|
32 |
}
|
33 |
+
|
34 |
$root_category_id = 0;
|
35 |
if (!is_numeric($matches[1])) {
|
36 |
return;
|
38 |
$root_category_id = $matches[1];
|
39 |
}
|
40 |
|
41 |
+
$api = new Ecwid_Api_V3();
|
42 |
+
|
43 |
+
$categories = $api->get_categories(array('parent' => $root_category_id));
|
44 |
+
|
|
|
|
|
45 |
$max_items = 5;
|
46 |
|
47 |
$items = array();
|
48 |
|
49 |
$see_more = false;
|
50 |
$result = '';
|
51 |
+
if (!empty($categories->items)) {
|
52 |
+
foreach ($categories->items as $category) {
|
53 |
+
$category = Ecwid_Category::get_by_id( $category->id );
|
54 |
+
$items[$category->link] = $category->name;
|
55 |
if (count($items) >= $max_items) {
|
56 |
$see_more = true;
|
57 |
break;
|
75 |
}
|
76 |
|
77 |
if (!$see_more) {
|
78 |
+
$products = $api->search_products(array( 'category' => $root_category_id ));
|
79 |
+
|
80 |
+
if ($products->items) {
|
81 |
+
foreach ($products->items as $product) {
|
82 |
+
$product = Ecwid_Product::get_by_id( $product->id );
|
83 |
+
$items[$product->link] = $product->name;
|
84 |
if (count($items) >= $max_items) {
|
85 |
$see_more = TRUE;
|
86 |
break;
|
includes/themes.php
CHANGED
@@ -66,7 +66,8 @@ function ecwid_apply_theme($theme_name = null)
|
|
66 |
'businesso' => array( 'css' ),
|
67 |
'Avada' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
68 |
'flatsome' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
69 |
-
'Divi' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU )
|
|
|
70 |
);
|
71 |
$generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
|
72 |
|
@@ -112,6 +113,7 @@ function ecwid_apply_theme($theme_name = null)
|
|
112 |
}
|
113 |
} else if ( array_key_exists( $theme_name, $generic_themes ) ) {
|
114 |
global $ecwid_current_theme;
|
|
|
115 |
$ecwid_current_theme = Ecwid_Theme_Base::create( $theme_name, $generic_themes[$theme_name] );
|
116 |
}
|
117 |
}
|
66 |
'businesso' => array( 'css' ),
|
67 |
'Avada' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
68 |
'flatsome' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
69 |
+
'Divi' => array( Ecwid_Theme_Base::PROP_USE_JS_API_FOR_CATS_NAV_MENU ),
|
70 |
+
'themify-music' => array( Ecwid_Theme_Base::PROP_AJAX_DEFER_RENDERING )
|
71 |
);
|
72 |
$generic_themes = apply_filters('ecwid_generic_themes', $generic_themes);
|
73 |
|
113 |
}
|
114 |
} else if ( array_key_exists( $theme_name, $generic_themes ) ) {
|
115 |
global $ecwid_current_theme;
|
116 |
+
|
117 |
$ecwid_current_theme = Ecwid_Theme_Base::create( $theme_name, $generic_themes[$theme_name] );
|
118 |
}
|
119 |
}
|
includes/themes/class-ecwid-theme-base.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
class Ecwid_Theme_Base {
|
4 |
|
5 |
const PROP_USE_JS_API_FOR_CATS_NAV_MENU = 'js-api-for-cats-nav-menu';
|
|
|
6 |
|
7 |
public $has_advanced_layout = false;
|
8 |
|
@@ -53,6 +54,10 @@ class Ecwid_Theme_Base {
|
|
53 |
if (in_array( self::PROP_USE_JS_API_FOR_CATS_NAV_MENU, $props ) ) {
|
54 |
add_filter( Ecwid_Nav_Menus::FILTER_USE_JS_API_FOR_CATS_MENU, array( $theme, 'filter_use_js_api_for_cats_menu' ) );
|
55 |
}
|
|
|
|
|
|
|
|
|
56 |
|
57 |
return $theme;
|
58 |
}
|
3 |
class Ecwid_Theme_Base {
|
4 |
|
5 |
const PROP_USE_JS_API_FOR_CATS_NAV_MENU = 'js-api-for-cats-nav-menu';
|
6 |
+
const PROP_AJAX_DEFER_RENDERING = 'ajax-defer-rendering';
|
7 |
|
8 |
public $has_advanced_layout = false;
|
9 |
|
54 |
if (in_array( self::PROP_USE_JS_API_FOR_CATS_NAV_MENU, $props ) ) {
|
55 |
add_filter( Ecwid_Nav_Menus::FILTER_USE_JS_API_FOR_CATS_MENU, array( $theme, 'filter_use_js_api_for_cats_menu' ) );
|
56 |
}
|
57 |
+
|
58 |
+
if ( in_array( self::PROP_AJAX_DEFER_RENDERING, $props ) ) {
|
59 |
+
add_filter( Ecwid_Ajax_Defer_Renderer::FILTER_ENABLED, '__return_true' );
|
60 |
+
}
|
61 |
|
62 |
return $theme;
|
63 |
}
|
includes/widgets/class-ecwid-widget-vertical-categories-list.php
CHANGED
@@ -14,9 +14,11 @@ class Ecwid_Widget_Vertical_Categories_List extends WP_Widget {
|
|
14 |
|
15 |
public function widget( $args, $instance ) {
|
16 |
|
17 |
-
|
|
|
|
|
18 |
|
19 |
-
if (empty($categories)) return;
|
20 |
|
21 |
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
|
22 |
$title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Browse by Category', 'ecwid-shopping-cart' ) : $instance['title'], $instance, $this->id_base );
|
@@ -27,10 +29,11 @@ class Ecwid_Widget_Vertical_Categories_List extends WP_Widget {
|
|
27 |
}
|
28 |
|
29 |
echo '<ul>';
|
30 |
-
|
31 |
-
foreach ($categories as $category) {
|
|
|
32 |
echo '<li>';
|
33 |
-
echo '<a href="' .
|
34 |
. '" data-ecwid-page="category" data-ecwid-category-id="' . $category->id . '">'
|
35 |
. $category->name
|
36 |
. '</a>';
|
14 |
|
15 |
public function widget( $args, $instance ) {
|
16 |
|
17 |
+
$api = new Ecwid_Api_V3();
|
18 |
+
|
19 |
+
$categories = $api->get_categories(array( 'parent' => 0 ) );
|
20 |
|
21 |
+
if ( !$categories || empty( $categories->items ) ) return;
|
22 |
|
23 |
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
|
24 |
$title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Browse by Category', 'ecwid-shopping-cart' ) : $instance['title'], $instance, $this->id_base );
|
29 |
}
|
30 |
|
31 |
echo '<ul>';
|
32 |
+
|
33 |
+
foreach ($categories->items as $category) {
|
34 |
+
$category = Ecwid_Category::get_by_id( $category->id );
|
35 |
echo '<li>';
|
36 |
+
echo '<a href="' . $category->link
|
37 |
. '" data-ecwid-page="category" data-ecwid-category-id="' . $category->id . '">'
|
38 |
. $category->name
|
39 |
. '</a>';
|
languages/ecwid-shopping-cart-ru_RU.mo
CHANGED
Binary file
|
languages/ecwid-shopping-cart-ru_RU.po
CHANGED
@@ -329,14 +329,16 @@ msgstr "Безопасен ли Эквид?"
|
|
329 |
#: includes/faq_entries.php:6
|
330 |
msgid ""
|
331 |
"Ecwid is PCI DSS Level 1 certified, which is the gold standard for e-"
|
332 |
-
"commerce solutions worldwide. This means you won
|
333 |
-
"compliance issues when selling online with Ecwid. <a target=\"_blank\"
|
334 |
-
"
|
335 |
-
"downloadable-#
|
336 |
msgstr ""
|
337 |
"Эквид сертифицирован по стандарту PCI DSS Level 1. Это высший уровень "
|
338 |
"соответствия мировым требованиям безопасной передачи данных: информация "
|
339 |
-
"вашего магазина и ваших клиентов надёжно защищена."
|
|
|
|
|
340 |
|
341 |
#: includes/faq_entries.php:12
|
342 |
msgid "How can I manage my store from a mobile device?"
|
@@ -364,18 +366,18 @@ msgstr "Как добавить магазин на Facebook?"
|
|
364 |
#: includes/faq_entries.php:21
|
365 |
msgid ""
|
366 |
"You can add your online store to your Facebook business page. No addons "
|
367 |
-
"needed. Ecwid will automatically synchronize products, customers, orders
|
368 |
-
"inventory between your WordPress and Facebook storefronts. <a target
|
369 |
-
"\" href=\"https://support.ecwid.com/hc/en-us/articles/
|
370 |
-
"
|
371 |
msgstr ""
|
372 |
"Вы можете разместить магазин не только на своём WordPress-сайте, но и на "
|
373 |
"любой другой странице включая Facebook. Зеркальная копия витрины мгновенно "
|
374 |
"отражает любые изменения в магазине. Новые товары в каталоге, наличие на "
|
375 |
"складе, заказы и покупатели – все данные распространяются между витринами на "
|
376 |
-
"лету. <a target=\"_blank\" href=\"https://support.ecwid.com/hc/ru/"
|
377 |
-
"
|
378 |
-
"\">Подробнее об установке на Facebook.</a>"
|
379 |
|
380 |
#: includes/faq_entries.php:28
|
381 |
msgid "How can I add a cart widget to my site sidebar?"
|
@@ -384,9 +386,9 @@ msgstr "Как добавить корзину в боковую панель с
|
|
384 |
#: includes/faq_entries.php:30
|
385 |
msgid ""
|
386 |
"You can add product search box, cart widget and more on the <a href=\"%s\">"
|
387 |
-
"\"Appearance / Widgets page\"</a> here in your site admin. <a target=\"_blank"
|
388 |
-
"
|
389 |
-
"
|
390 |
msgstr ""
|
391 |
"Вы можете добавить корзину, форму для поиска товаров и другие элементы "
|
392 |
"магазина в боковую панель на странице <a href=\"%s\">«Внешний вид > "
|
@@ -400,18 +402,13 @@ msgstr "Сколько стоит Эквид?"
|
|
400 |
msgid ""
|
401 |
"Our 4 account types vary by number of products, types of functionality, and "
|
402 |
"level of support. For more information, check out our <a target=\"_blank\" "
|
403 |
-
"href=\"
|
404 |
-
"
|
405 |
-
">Unlimited - $99/month<br /><br />Pro Tip: You can also save money by "
|
406 |
-
"enrolling in our annual plans."
|
407 |
msgstr ""
|
408 |
"Мы предлагаем 4 тарифных плана: от бесплатного с 10 товарами до "
|
409 |
"безлимитного. Платные тарифные планы расширяют возможности магазина и "
|
410 |
-
"открывают персональную техническую поддержку в реальном времени.<br /><
|
411 |
-
"
|
412 |
-
"руб. в месяц<br />UNLIMITED – 4500 руб. в месяц<br /><br />...или дешевле, "
|
413 |
-
"если подключите подписку на год. <a target=\"_blank\" href=\"https://www."
|
414 |
-
"ecwid.ru/pricing\">Подробнее о расценках.</a>"
|
415 |
|
416 |
#: includes/faq_entries.php:45
|
417 |
msgid "How do I add store categories to the site menu."
|
@@ -461,14 +458,14 @@ msgstr "Как добавить отдельный товар с корзино
|
|
461 |
#: includes/faq_entries.php:59
|
462 |
msgid ""
|
463 |
"To feature a single product on a separate page or blog post of your site, "
|
464 |
-
"use <b>[ecwid_product]</b> shortcode. <a target=\"_blank\" href=\"https://"
|
465 |
-
"
|
466 |
-
"
|
467 |
msgstr ""
|
468 |
"Чтобы разместить товар магазина на страницах сайта отдельно от остальных, "
|
469 |
"используйте короткий код [ecwid_product]. <a target=\"_blank\" href="
|
470 |
-
"\"https://support.ecwid.com/hc/ru/articles/207101259-Wordpress
|
471 |
-
"
|
472 |
|
473 |
#: includes/faq_entries.php:65
|
474 |
msgid "Is it possible to display my store on the site home page?"
|
@@ -746,7 +743,7 @@ msgstr ""
|
|
746 |
|
747 |
#: templates/advanced-settings.php:44 templates/advanced-settings.php:188
|
748 |
msgid "https://support.ecwid.com/hc/en-us/requests/new"
|
749 |
-
msgstr ""
|
750 |
|
751 |
#: templates/advanced-settings.php:57 templates/store-popup.php:154
|
752 |
msgid "Category shown by default"
|
@@ -988,9 +985,8 @@ msgstr "Сохранить и присоединить"
|
|
988 |
|
989 |
#: templates/connect.php:27 templates/reconnect.php:46
|
990 |
msgid ""
|
991 |
-
"To
|
992 |
-
"
|
993 |
-
"permission."
|
994 |
msgstr ""
|
995 |
"Нажмите на кнопку, авторизуйтесь в %1$s и выдайте запрошенные права доступа"
|
996 |
|
329 |
#: includes/faq_entries.php:6
|
330 |
msgid ""
|
331 |
"Ecwid is PCI DSS Level 1 certified, which is the gold standard for e-"
|
332 |
+
"commerce solutions worldwide. This means you won't have any banking "
|
333 |
+
"compliance issues when selling online with Ecwid. <a target=\"_blank\""
|
334 |
+
" href=\"https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-"
|
335 |
+
"downloadable-#security\">More details.</a>"
|
336 |
msgstr ""
|
337 |
"Эквид сертифицирован по стандарту PCI DSS Level 1. Это высший уровень "
|
338 |
"соответствия мировым требованиям безопасной передачи данных: информация "
|
339 |
+
"вашего магазина и ваших клиентов надёжно защищена. <a target=\"_blank\""
|
340 |
+
" href=\"https://support.ecwid.com/hc/ru/articles/207101259-Wordpress#"
|
341 |
+
"security\">Подробнее о безопасности.</a>"
|
342 |
|
343 |
#: includes/faq_entries.php:12
|
344 |
msgid "How can I manage my store from a mobile device?"
|
366 |
#: includes/faq_entries.php:21
|
367 |
msgid ""
|
368 |
"You can add your online store to your Facebook business page. No addons "
|
369 |
+
"needed. Ecwid will automatically synchronize products, customers, orders "
|
370 |
+
"and inventory between your WordPress and Facebook storefronts. <a target="
|
371 |
+
"\"_blank\" href=\"https://support.ecwid.com/hc/en-us/articles/115005892705"
|
372 |
+
"-Facebook-Shop\">More details.</a>"
|
373 |
msgstr ""
|
374 |
"Вы можете разместить магазин не только на своём WordPress-сайте, но и на "
|
375 |
"любой другой странице включая Facebook. Зеркальная копия витрины мгновенно "
|
376 |
"отражает любые изменения в магазине. Новые товары в каталоге, наличие на "
|
377 |
"складе, заказы и покупатели – все данные распространяются между витринами на "
|
378 |
+
"лету. <a target=\"_blank\" href=\"https://support.ecwid.com/hc/ru/articles/115"
|
379 |
+
"005892705-%D0%9C%D0%B0%D0%B3%D0%B0%D0%B7%D0%B8%D0%BD-%D0%BD%D0%B0-%D0%A4%D0%B5"
|
380 |
+
"%D0%B9%D1%81%D0%B1%D1%83%D0%BA%D0%B5\">Подробнее об установке на Facebook.</a>"
|
381 |
|
382 |
#: includes/faq_entries.php:28
|
383 |
msgid "How can I add a cart widget to my site sidebar?"
|
386 |
#: includes/faq_entries.php:30
|
387 |
msgid ""
|
388 |
"You can add product search box, cart widget and more on the <a href=\"%s\">"
|
389 |
+
"\"Appearance / Widgets page\"</a> here in your site admin. <a target=\"_blank\""
|
390 |
+
" href=\"https://support.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable"
|
391 |
+
"-#sidebarwidgets\">More details.</a>"
|
392 |
msgstr ""
|
393 |
"Вы можете добавить корзину, форму для поиска товаров и другие элементы "
|
394 |
"магазина в боковую панель на странице <a href=\"%s\">«Внешний вид > "
|
402 |
msgid ""
|
403 |
"Our 4 account types vary by number of products, types of functionality, and "
|
404 |
"level of support. For more information, check out our <a target=\"_blank\" "
|
405 |
+
"href=\"%s\">pricing page.</a><br /><br />Pro Tip: You can also save money "
|
406 |
+
"by enrolling in our annual plans."
|
|
|
|
|
407 |
msgstr ""
|
408 |
"Мы предлагаем 4 тарифных плана: от бесплатного с 10 товарами до "
|
409 |
"безлимитного. Платные тарифные планы расширяют возможности магазина и "
|
410 |
+
"открывают персональную техническую поддержку в реальном времени.<br /><a "
|
411 |
+
"target=\"_blank\" href=\"%s\">Подробнее о расценках.</a>"
|
|
|
|
|
|
|
412 |
|
413 |
#: includes/faq_entries.php:45
|
414 |
msgid "How do I add store categories to the site menu."
|
458 |
#: includes/faq_entries.php:59
|
459 |
msgid ""
|
460 |
"To feature a single product on a separate page or blog post of your site, "
|
461 |
+
"use <b>[ecwid_product]</b> shortcode. <a target=\"_blank\" href=\"https://s"
|
462 |
+
"upport.ecwid.com/hc/en-us/articles/207101259-Wordpress-downloadable-#buynow"
|
463 |
+
"\">How to use it.</a>"
|
464 |
msgstr ""
|
465 |
"Чтобы разместить товар магазина на страницах сайта отдельно от остальных, "
|
466 |
"используйте короткий код [ecwid_product]. <a target=\"_blank\" href="
|
467 |
+
"\"https://support.ecwid.com/hc/ru/articles/207101259-Wordpress#embeda"
|
468 |
+
"singleproduct\">Пошаговая инструкция.</a>"
|
469 |
|
470 |
#: includes/faq_entries.php:65
|
471 |
msgid "Is it possible to display my store on the site home page?"
|
743 |
|
744 |
#: templates/advanced-settings.php:44 templates/advanced-settings.php:188
|
745 |
msgid "https://support.ecwid.com/hc/en-us/requests/new"
|
746 |
+
msgstr "https://support.ecwid.com/hc/ru/requests/new"
|
747 |
|
748 |
#: templates/advanced-settings.php:57 templates/store-popup.php:154
|
749 |
msgid "Category shown by default"
|
985 |
|
986 |
#: templates/connect.php:27 templates/reconnect.php:46
|
987 |
msgid ""
|
988 |
+
"To display your store on this site, you need to allow WordPress to access "
|
989 |
+
"your %1$s products. Please press connect to provide permission."
|
|
|
990 |
msgstr ""
|
991 |
"Нажмите на кнопку, авторизуйтесь в %1$s и выдайте запрошенные права доступа"
|
992 |
|
lib/ecwid_api_v3.php
CHANGED
@@ -52,13 +52,13 @@ class Ecwid_Api_V3
|
|
52 |
if (array_key_exists('parent', $input_params)) {
|
53 |
$params['parent'] = $input_params['parent'];
|
54 |
}
|
55 |
-
$passthru = array( 'offset', 'limit', 'parent', 'baseUrl', 'cleanUrls' );
|
56 |
foreach ($passthru as $name) {
|
57 |
if ( array_key_exists( $name, $input_params ) ) {
|
58 |
$params[$name] = $input_params[$name];
|
59 |
}
|
60 |
}
|
61 |
-
|
62 |
if ( !isset( $params['baseUrl'] ) ) {
|
63 |
$params['baseUrl'] = Ecwid_Store_Page::get_store_url();
|
64 |
}
|
@@ -73,10 +73,9 @@ class Ecwid_Api_V3
|
|
73 |
);
|
74 |
|
75 |
$result = EcwidPlatform::get_from_categories_cache($url);
|
76 |
-
|
77 |
if ( !$result ) {
|
78 |
$result = EcwidPlatform::fetch_url( $url );
|
79 |
-
|
80 |
}
|
81 |
|
82 |
if ($result['code'] != '200') {
|
@@ -493,19 +492,20 @@ class Ecwid_Api_V3
|
|
493 |
return strftime('%F %T', $time);
|
494 |
}
|
495 |
|
496 |
-
protected function build_request_url($url, $
|
497 |
{
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
$
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
|
|
509 |
$params[$key] = urlencode($param);
|
510 |
}
|
511 |
}
|
52 |
if (array_key_exists('parent', $input_params)) {
|
53 |
$params['parent'] = $input_params['parent'];
|
54 |
}
|
55 |
+
$passthru = array( 'offset', 'limit', 'parent', 'baseUrl', 'cleanUrls', 'hidden_categories' );
|
56 |
foreach ($passthru as $name) {
|
57 |
if ( array_key_exists( $name, $input_params ) ) {
|
58 |
$params[$name] = $input_params[$name];
|
59 |
}
|
60 |
}
|
61 |
+
|
62 |
if ( !isset( $params['baseUrl'] ) ) {
|
63 |
$params['baseUrl'] = Ecwid_Store_Page::get_store_url();
|
64 |
}
|
73 |
);
|
74 |
|
75 |
$result = EcwidPlatform::get_from_categories_cache($url);
|
76 |
+
|
77 |
if ( !$result ) {
|
78 |
$result = EcwidPlatform::fetch_url( $url );
|
|
|
79 |
}
|
80 |
|
81 |
if ($result['code'] != '200') {
|
492 |
return strftime('%F %T', $time);
|
493 |
}
|
494 |
|
495 |
+
protected function build_request_url($url, $input_params)
|
496 |
{
|
497 |
+
$params = array();
|
498 |
+
foreach ($input_params as $key => $param) {
|
499 |
+
|
500 |
+
if ( !is_string( $key ) ) {
|
501 |
+
if ($param == 'appClientId') {
|
502 |
+
$params['appClientId'] = Ecwid_Config::get_oauth_appid();
|
503 |
+
} elseif ($param == 'appSecretKey') {
|
504 |
+
$params['appSecretKey'] = Ecwid_Config::get_oauth_appsecret();
|
505 |
+
} elseif ($param == 'token') {
|
506 |
+
$params['token'] = self::get_token();
|
507 |
+
}
|
508 |
+
}else {
|
509 |
$params[$key] = urlencode($param);
|
510 |
}
|
511 |
}
|
lib/html-catalog-templates/product.php
CHANGED
@@ -4,7 +4,8 @@
|
|
4 |
<h1 itemprop="name"><?php echo EcwidPlatform::esc_html( $product->name ); ?></h1>
|
5 |
<p itemprop="sku"><?php echo EcwidPlatform::esc_html( $product->sku ); ?></p>
|
6 |
<img itemprop="image" src="<?php echo EcwidPlatform::esc_attr( $product->originalImageUrl ); ?>" alt="<?php echo EcwidPlatform::esc_attr( $product->name . ' ' . $product->sku); ?>" />
|
7 |
-
<div itemprop="
|
|
|
8 |
<span itemprop="price" content="<?php echo EcwidPlatform::esc_html( $product->price ); ?>"><?php
|
9 |
echo EcwidPlatform::esc_html(
|
10 |
$formats->currencyPrefix . $product->price . $formats->currencySuffix
|
4 |
<h1 itemprop="name"><?php echo EcwidPlatform::esc_html( $product->name ); ?></h1>
|
5 |
<p itemprop="sku"><?php echo EcwidPlatform::esc_html( $product->sku ); ?></p>
|
6 |
<img itemprop="image" src="<?php echo EcwidPlatform::esc_attr( $product->originalImageUrl ); ?>" alt="<?php echo EcwidPlatform::esc_attr( $product->name . ' ' . $product->sku); ?>" />
|
7 |
+
<div itemprop="description"><?php echo isset( $product->seoDescription )&& !empty( $product->seoDescription ) ? $product->seoDescription : $product->description; ?></div>
|
8 |
+
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
9 |
<span itemprop="price" content="<?php echo EcwidPlatform::esc_html( $product->price ); ?>"><?php
|
10 |
echo EcwidPlatform::esc_html(
|
11 |
$formats->currencyPrefix . $product->price . $formats->currencySuffix
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Ecwid
|
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 5.8
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
@@ -149,6 +149,13 @@ You can use Ecwid’s built-in import tools to copy your store products from any
|
|
149 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
150 |
|
151 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
= 5.8 - Feb 8, 2018 =
|
153 |
- **Improved OG tags support.** OpenGraph (or OG) tags are special marks in site pages code, that are used to make better snippets when you share a page on Facebook, Twitter and other sites and social networks. We added OG tags to the products pages — this will make your product title, description and image appear in a snippet/post when you share a link to that product.
|
154 |
- **Revamped Ecwid menu in WordPress admin backend.** Historically, the Ecwid store management dashboard displayed navigation within the central page content when you open it in your Wordpress admin backend. So, you open the “Ecwid” menu in your WP admin and then navigate through your store admin pages within that general “Ecwid” page. We’re improving this process: now the store admin navigation menu will be a part of the Wordpress native admin menu, so you will find products/sales/settings/promotions/apps and other sections right in the Wordpress left-hand navigation sidebar. This will align the Ecwid plugin navigation with the general Wordpress navigation and provide more natural way to find the right page of your store dashboard. Also, this will free some space in the page central area to make it more convenient to manage your store, especially on mobile devices. IMPORTANT: The change is now enabled for the new plugin users only. We will gradually roll it out to all of the plugin users in the upcoming updates.
|
3 |
Tags: ecommerce, downloadable products, Facebook ecommerce, online store, paypal, product catalog, shop, shopping cart, store
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 5.8.1
|
7 |
|
8 |
Powerful, easy to use ecommerce shopping cart. Bank level PCI DSS Level 1 security. iPhone & Android apps. Superb support. Free plan available.
|
9 |
|
149 |
* [Ecwid eCommerce Forums](https://www.ecwid.com/forums/forumdisplay.php?f=19)
|
150 |
|
151 |
== Changelog ==
|
152 |
+
= 5.8.1 - Mar 7, 2018 =
|
153 |
+
- **Compatibility with the Yoast premium SEO plugin.** Yoast recently updated their SEO plugins. We adjusted Ecwid plugin to work well with them. So, as usually, Ecwid should work well with Yoast products, feel free to use them to get your site and online store optimized for search engines.
|
154 |
+
- **Fixed an issue with Ecwid buttons in the Elementor page builder toolbar.** Ecwid’s “Add store” and “Add product” buttons didn’t work well in the Elementor editor toolbar. We hid the Ecwid buttons from the toolbar as a workaround. To add a store or a single product to a page in the Elementor editor, please use [ec_store] and [ec_product] shortcodes or temporarily switch to the default WP editor.
|
155 |
+
- **Fixed compatibility issues with Themify AJAX themes.** If you use one of Themify themes with AJAX navigation enabled, you might notice that your store page didn’t load sometimes. We fixed that. Ecwid should work well with any Wordpress theme.
|
156 |
+
- **Fixed an issue with SEO-friendly description on store product pages.** Ecwid ecommerce plugin renders your store pages in a special search engines friendly way so that they can index your products and display them better in search results. In some cases, product description wasn’t displayed in that SEO version of store page. We fixed that, everything should work fine and your products should be displayed well in Google search.
|
157 |
+
- Minor fixes and improvements.
|
158 |
+
|
159 |
= 5.8 - Feb 8, 2018 =
|
160 |
- **Improved OG tags support.** OpenGraph (or OG) tags are special marks in site pages code, that are used to make better snippets when you share a page on Facebook, Twitter and other sites and social networks. We added OG tags to the products pages — this will make your product title, description and image appear in a snippet/post when you share a link to that product.
|
161 |
- **Revamped Ecwid menu in WordPress admin backend.** Historically, the Ecwid store management dashboard displayed navigation within the central page content when you open it in your Wordpress admin backend. So, you open the “Ecwid” menu in your WP admin and then navigate through your store admin pages within that general “Ecwid” page. We’re improving this process: now the store admin navigation menu will be a part of the Wordpress native admin menu, so you will find products/sales/settings/promotions/apps and other sections right in the Wordpress left-hand navigation sidebar. This will align the Ecwid plugin navigation with the general Wordpress navigation and provide more natural way to find the right page of your store dashboard. Also, this will free some space in the page central area to make it more convenient to manage your store, especially on mobile devices. IMPORTANT: The change is now enabled for the new plugin users only. We will gradually roll it out to all of the plugin users in the upcoming updates.
|
templates/advanced-settings.php
CHANGED
@@ -38,11 +38,7 @@
|
|
38 |
<?php printf( __( 'To enable clean URLs in your store, you will need to enable pretty permalinks in your WordPress site settings. Navigate to <a%s>Settings->Permalink</a> and enable the "Post name" permalink type.', 'ecwid-shopping-cart' ), ' href="' . admin_url( 'options-permalink.php' ) . '"'); ?>
|
39 |
</div>
|
40 |
<?php endif; ?>
|
41 |
-
|
42 |
-
|
43 |
-
<div class="note grayed-links">
|
44 |
-
<?php echo sprintf(__('Note: the new URLs will be automatically enabled for every store in one of upcoming updates so please make sure to check how the new URLs work in your store and <a %s>let us know</a> if you face any trouble with them', 'ecwid-shopping-cart'), ' target="_blank" href="' . Ecwid_Config::get_contact_us_url() . '"'); ?>
|
45 |
-
</div>
|
46 |
</div>
|
47 |
</div>
|
48 |
|
38 |
<?php printf( __( 'To enable clean URLs in your store, you will need to enable pretty permalinks in your WordPress site settings. Navigate to <a%s>Settings->Permalink</a> and enable the "Post name" permalink type.', 'ecwid-shopping-cart' ), ' href="' . admin_url( 'options-permalink.php' ) . '"'); ?>
|
39 |
</div>
|
40 |
<?php endif; ?>
|
41 |
+
|
|
|
|
|
|
|
|
|
42 |
</div>
|
43 |
</div>
|
44 |
|
templates/connect.php
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
<?php if (!$connection_error): ?>
|
22 |
|
23 |
<div class="note initial with-oauth">
|
24 |
-
<?php printf( __( 'To
|
25 |
</div>
|
26 |
|
27 |
<?php else: ?>
|
21 |
<?php if (!$connection_error): ?>
|
22 |
|
23 |
<div class="note initial with-oauth">
|
24 |
+
<?php printf( __( 'To display your store on this site, you need to allow WordPress to access your %1$s products. Please press connect to provide permission.', 'ecwid-shopping-cart' ), Ecwid_Config::get_brand() ); ?>
|
25 |
</div>
|
26 |
|
27 |
<?php else: ?>
|
templates/help.php
CHANGED
@@ -24,38 +24,9 @@
|
|
24 |
</form>
|
25 |
</div>
|
26 |
</div>
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
<span class="iconhelp-101"></span>
|
31 |
-
<span class="shortcut-item-text"><?php _e( 'Ecwid Basics', 'ecwid-shopping-cart' ); ?> </span>
|
32 |
-
</a>
|
33 |
-
</li>
|
34 |
-
<li>
|
35 |
-
<a href="<?php _e( 'https://support.ecwid.com/hc/en-us/sections/201758475-Manage-Your-Ecwid-Store', 'ecwid-shopping-cart' ); ?>" target="_blank" class="shortcut-item">
|
36 |
-
<span class="iconhelp-manage"></span>
|
37 |
-
<span class="shortcut-item-text"><?php _e( 'Manage Your Ecwid Store', 'ecwid-shopping-cart' ); ?> </span>
|
38 |
-
</a>
|
39 |
-
</li>
|
40 |
-
<li>
|
41 |
-
<a href="<?php _e( 'https://support.ecwid.com/hc/en-us/sections/201758445-Customize-Your-Store', 'ecwid-shopping-cart'); ?>" target="_blank" class="shortcut-item">
|
42 |
-
<span class="iconhelp-custom"></span>
|
43 |
-
<span class="shortcut-item-text"><?php _e( 'Customize Your Store', 'ecwid-shopping-cart' ); ?> </span>
|
44 |
-
</a>
|
45 |
-
</li>
|
46 |
-
<li>
|
47 |
-
<a href="<?php _e( 'https://support.ecwid.com/hc/en-us/sections/201706799-Billing-Questions', 'ecwid-shopping-cart' ); ?>" target="_blank" class="shortcut-item">
|
48 |
-
<span class="iconhelp-billing"></span>
|
49 |
-
<span class="shortcut-item-text"><?php _e( 'Billing Questions', 'ecwid-shopping-cart' ); ?> </span>
|
50 |
-
</a>
|
51 |
-
</li>
|
52 |
-
<li>
|
53 |
-
<a href="<?php _e( 'https://support.ecwid.com/hc/en-us/sections/201702859-Technical-Reference', 'ecwid-shopping-cart'); ?>" target="_blank" class="shortcut-item">
|
54 |
-
<span class="iconhelp-api"></span>
|
55 |
-
<span class="shortcut-item-text"><?php _e( 'Technical Reference', 'ecwid-shopping-cart' ); ?> </span>
|
56 |
-
</a>
|
57 |
-
</li>
|
58 |
-
</ul>
|
59 |
</div>
|
60 |
|
61 |
<div class="block-faq">
|
24 |
</form>
|
25 |
</div>
|
26 |
</div>
|
27 |
+
<div class="block-search block-search-kb-link">
|
28 |
+
<?php echo sprintf( __( 'or <a %s>Browse the Help Center', 'ecwid-shopping-cart'), 'href="https://support.ecwid.com/"' ); ?>
|
29 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</div>
|
31 |
|
32 |
<div class="block-faq">
|
templates/sync.php
CHANGED
@@ -14,51 +14,11 @@ jQuery('#ecwid_local_base_enabled').click(function() {
|
|
14 |
});
|
15 |
|
16 |
jQuery('#sync-button').click(function() {
|
17 |
-
|
18 |
-
|
19 |
-
} else {
|
20 |
-
sync_by_chunks();
|
21 |
-
}
|
22 |
return false;
|
23 |
});
|
24 |
|
25 |
-
function sync_sse() {
|
26 |
-
jQuery('#sync-container').removeClass('state-initial').addClass('state-in-progress');
|
27 |
-
|
28 |
-
var source = new EventSource('admin-post.php?action=ecwid_sync_sse');
|
29 |
-
source.addEventListener('completed', function(e) {
|
30 |
-
|
31 |
-
var data = jQuery.parseJSON(e.data);
|
32 |
-
jQuery('#sync-container').removeClass('state-in-progress').addClass('state-complete');
|
33 |
-
jQuery('#sync-date').text(data.last_update);
|
34 |
-
source.close();
|
35 |
-
});
|
36 |
-
|
37 |
-
source.addEventListener('created_product', function(e) {
|
38 |
-
increment_progress_counter(1);
|
39 |
-
});
|
40 |
-
|
41 |
-
source.addEventListener('updated_product', function(e) {
|
42 |
-
increment_progress_counter(1);
|
43 |
-
});
|
44 |
-
|
45 |
-
source.addEventListener('fetching_products', function(e) {
|
46 |
-
var data = jQuery.parseJSON(e.data);
|
47 |
-
|
48 |
-
jQuery('#current_item').text(
|
49 |
-
'Fetching products... '
|
50 |
-
+ data.offset + ' - '
|
51 |
-
+ Math.min(data.offset + data.limit, <?php echo intval($estimation['total_updated']); ?>)
|
52 |
-
+ ' of <?php echo intval($estimation['total_updated']); ?>');
|
53 |
-
});
|
54 |
-
|
55 |
-
source.addEventListener('fetching_deleted_product_ids', function(e) {
|
56 |
-
var data = jQuery.parseJSON(e.data);
|
57 |
-
|
58 |
-
jQuery('#current_item').text('Fetching deleted products... ' + data.offset + ' - ' + Math.min(data.offset + data.limit, <?php echo intval($estimation['total_deleted']); ?>) + ' of <?php echo intval($estimation['total_deleted']); ?>');
|
59 |
-
});
|
60 |
-
}
|
61 |
-
|
62 |
var updatedFrom = '<?php echo $estimation['last_update']; ?>';
|
63 |
|
64 |
function do_no_sse_sync(mode, offset, limit, time) {
|
14 |
});
|
15 |
|
16 |
jQuery('#sync-button').click(function() {
|
17 |
+
sync_by_chunks();
|
18 |
+
|
|
|
|
|
|
|
19 |
return false;
|
20 |
});
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
var updatedFrom = '<?php echo $estimation['last_update']; ?>';
|
23 |
|
24 |
function do_no_sse_sync(mode, offset, limit, time) {
|