public function enqueue_script()
 {
     wp_enqueue_script('ecwid-kissmetrics', 'https://scripts.kissmetrics.com/' . self::API_KEY . '.2.js');
     wp_enqueue_script('ecwid-kissmetrics-events', ECWID_PLUGIN_URL . 'js/kissmetrics.js', array('ecwid-kissmetrics'));
     $kissmetrics = array('events' => $this->_get_pending_events());
     $this->_flush_events();
     $store_id = get_ecwid_store_id();
     if ($store_id != ECWID_DEMO_STORE_ID) {
         $kissmetrics['store_id'] = $store_id;
     }
     wp_localize_script('ecwid-kissmetrics-events', 'ecwid_kissmetrics', $kissmetrics);
 }
</text>
	<text x="245" y="137" text-anchor="middle" fill="#999999" font-family="Open Sans,Helvetica Neue,sans-serif" font-size="14">
		<?php 
if (get_ecwid_store_id() == ECWID_DEMO_STORE_ID) {
    ?>
			<?php 
    _e('Demo Store', 'ecwid-shopping-cart');
    ?>
		<?php 
} else {
    ?>
			<?php 
    _e('Store ID', 'ecwid-shopping-cart');
    ?>
: <?php 
    echo esc_attr(get_ecwid_store_id());
    ?>
		<?php 
}
?>
	</text>

	<g>
		<path fill="#77B644" d="M225.7,82.3c0-0.4,0.3-0.8,0.8-0.8h41.1c0.4,0,0.8,0.3,0.8,0.8v1.6c0,0.4-0.3,0.8-0.8,0.8h-41.1
		c-0.4,0-0.8-0.3-0.8-0.8V82.3z"/>
		<path fill="#77B644" d="M268.4,56.6c-1.6-3.3-2.4-6.5-3.3-11.9c0-0.3-0.7-1.3-1.6-1.3h-33c-0.9,0-1.6,1-1.6,1.3
		c0,0-1.6,10.2-3.3,11.9c0,1.7,0,5,0,5s0,0.1,0.1,0.1h-0.1c0,0,0.1,0.8,1.2,1.3c0.1,0.1,0.3,0.2,0.5,0.2v0v14.9
		c0,0.9,0.9,1.5,1.8,1.5h13V66c0-0.9,0.9-1.6,1.8-1.6h6.6c0.9,0,1.6,0.7,1.6,1.6v13.7h13.1c0.9,0,1.6-0.6,1.6-1.5V63.3v-0.1
		c1.3-0.2,1.6-1.5,1.6-1.5h0c0-0.1,0-0.1,0-0.1S268.4,58.3,268.4,56.6z M238.5,73.1c0,0.9-0.4,1.6-1.3,1.6h-3.4
		c-0.9,0-1.3-0.7-1.3-1.6v-6.6c0-0.9,0.4-1.6,1.3-1.6h3.4c0.9,0,1.3,0.7,1.3,1.6V73.1z M261.5,73.1c0,0.9-0.4,1.6-1.3,1.6h-3.4
		c-0.9,0-1.3-0.7-1.3-1.6v-6.6c0-0.9,0.4-1.6,1.3-1.6h3.4c0.9,0,1.3,0.7,1.3,1.6V73.1z M261.8,46.4c0,0,1.8,8.4,2.8,10.2
 public function get_sso_admin_link()
 {
     $url = 'https://my.ecwid.com/api/v3/%s/sso?token=%s&timestamp=%s&signature=%s&inline=true';
     $store_id = get_ecwid_store_id();
     $token = $this->get_oauth_token();
     $timestamp = time();
     $signature = hash('sha256', $store_id . $token . $timestamp . self::OAUTH_CLIENT_SECRET);
     $url = sprintf($url, $store_id, $token, $timestamp, $signature);
     return $url;
 }
Example #4
0
		<div class="head">
			<?php 
ecwid_embed_svg('ecwid_logo_symbol_RGB');
?>
			<h3>
				<?php 
_e('Ecwid Shopping Cart', 'ecwid-shopping-cart');
?>
			</h3>
			<div class="store-id drop-down">
					<span>
						<?php 
_e('Store ID', 'ecwid-shopping-cart');
?>
 : <?php 
echo get_ecwid_store_id();
?>
					</span>
				<ul>
					<li>
						<a href="admin-post.php?action=ecwid_disconnect"><?php 
_e('Disconnect store', 'ecwid-shopping-cart');
?>
</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="body">
			<div class="greeting-image">
				<img src="<?php 
 protected function need_to_show_message($name)
 {
     $admin_page = '';
     if (function_exists('get_current_screen')) {
         $screen = get_current_screen();
         $admin_page = $screen->base;
     }
     if ($admin_page == 'toplevel_page_ecwid' && isset($_GET['reconnect'])) {
         return false;
     }
     switch ($name) {
         case 'on_activate':
             return $admin_page == 'plugins' && get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
         case 'on_storeid_set':
             return get_ecwid_store_id() != ECWID_DEMO_STORE_ID && @$_GET['settings-updated'] == 'true' && $admin_page == 'toplevel_page_ecwid';
         case 'on_no_storeid_on_setup_pages':
             $is_newbie = get_ecwid_store_id() == ECWID_DEMO_STORE_ID;
             $is_ecwid_settings = in_array($admin_page, array('ecwid-store_page_ecwid-advanced', 'ecwid-store_page_ecwid-appearance'));
             $is_store_page = $admin_page == 'post' && isset($_GET['post']) && $_GET['post'] == ecwid_get_current_store_page_id();
             return $is_newbie && ($is_ecwid_settings || $is_store_page);
         case 'on_appearance_widgets':
             return isset($_GET['from-ecwid']) && $admin_page == 'widgets';
         case 'please_vote':
             $install_date = get_option('ecwid_installation_date');
             $result = false;
             if (!$install_date) {
                 add_option('ecwid_installation_date', time());
             } else {
                 $result = ecwid_is_paid_account() && $install_date + 60 * 60 * 24 * 30 < time();
             }
             foreach ($this->messages as $_name => $message) {
                 if ($_name != $name && $this->need_to_show_message($_name)) {
                     return false;
                 }
             }
             return $result;
     }
 }
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? '&nbsp;' : $instance['title']);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $store_id = get_ecwid_store_id();
        $ecwid_protocol = get_ecwid_protocol();
        echo '<div>';
        echo ecwid_get_scriptjs_code();
        // echo "<div><script type=\"text/javascript\" src=\"$ecwid_protocol://" . APP_ECWID_COM . "/script.js?$store_id\"></script>";
        $ecwid_page_id = get_option("ecwid_store_page_id");
        $page_url = get_page_link($ecwid_page_id);
        $_tmp_page = get_page($ecwid_page_id);
        if (!empty($page_url) && $_tmp_page != null) {
            echo "<script type=\"text/javascript\">var ecwid_ProductBrowserURL = \"{$page_url}\";</script>";
        }
        echo <<<EOT
\t<script type="text/javascript"> xVCategories("style="); </script>
\t      </div>
EOT;
        echo $after_widget;
    }