add_menu( array(
'id' => 'ecwid_main',
'title' => '
',
));
//add ecwid home page
$wp_admin_bar->add_menu(array(
"id" => "ecwid_home",
"title" => "Ecwid Site",
"parent" => "ecwid_main",
'href' => 'http://www.ecwid.com/'
)
);
//add store page link
$wp_admin_bar->add_menu(array(
"id" => "ecwid_go_to_page",
"title" => "My Ecwid Store",
"parent" => "ecwid_main",
'href' => get_page_link(get_option("ecwid_store_page_id"))
)
);
//add settings page link
$wp_admin_bar->add_menu(array(
"id" => "ecwid_settings",
"title" => "Settings page",
"parent" => "ecwid_main",
'href' => admin_url('options-general.php?page=ecwid_options_page' )
)
);
$wp_admin_bar->add_menu(array(
"id" => "ecwid_fb_app",
"title" => "→ Sell on Facebook",
"parent" => "ecwid_main",
'href' => 'http://apps.facebook.com/ecwid-shop/?fb_source=wp'
)
);
}
function ecwid_ajax_crawling_fragment() {
$ecwid_page_id = get_option("ecwid_store_page_id");
if (ecwid_is_api_enabled() && !isset($_GET['_escaped_fragment_']) && get_the_ID() == $ecwid_page_id)
echo '' . PHP_EOL;
}
function ecwid_meta() {
echo '' . PHP_EOL;
echo '' . PHP_EOL;
echo '' . PHP_EOL;
$ecwid_page_id = get_option("ecwid_store_page_id");
if (get_the_ID() != $ecwid_page_id) {
$page_url = get_page_link($ecwid_page_id);
echo '' . PHP_EOL;
echo '' . PHP_EOL;
}
}
function ecwid_seo_title($content) {
if (isset($_GET['_escaped_fragment_']) && ecwid_is_api_enabled()) {
$params = ecwid_parse_escaped_fragment($_GET['_escaped_fragment_']);
$ecwid_seo_title = '';
$api = ecwid_new_product_api();
if (isset($params['mode']) && !empty($params['mode'])) {
if ($params['mode'] == 'product') {
$ecwid_product = $api->get_product($params['id']);
$ecwid_seo_title = $ecwid_product['name'];
} elseif ($params['mode'] == 'category') {
// define category's title. no API for that QQ
}
}
if (!empty($ecwid_seo_title))
return $ecwid_seo_title . " | " . $content;
else
return $content;
} else {
return $content;
}
}
function ecwid_get_scriptjs_code() {
if (!defined('ECWID_SCRIPTJS')) {
$ecwid_protocol = get_ecwid_protocol();
$store_id = get_ecwid_store_id();
$s = "";
define('ECWID_SCRIPTJS','Yep');
$s = $s . ecwid_sso();
return $s;
} else {
return;
}
}
function ecwid_script_shortcode() {
return '
Ecwid shopping cart is almost ready. Please visit the created page to see your store with demo products. In order to finish the installation, please go to the Ecwid settings and configure the plugin.
Error. $ecwid_settings_message