Version Description
- Inital version
Download this release
Release Info
Developer | Ecwid |
Plugin | Ecwid Ecommerce Shopping Cart |
Version | 0.1 |
Comparing to | |
See all releases |
Version 0.1
- ecwid-shopping-cart.php +178 -0
- readme.txt +44 -0
ecwid-shopping-cart.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Ecwid Shopping Cart
|
4 |
+
Plugin URI: http://www.ecwid.com/
|
5 |
+
Description: Ecwid is free full-fledged shopping cart. It can be easily integreted with any Wordpress blog and takes less than 5 minutes to set up.
|
6 |
+
Author: Ecwid Team
|
7 |
+
Version: 0.1
|
8 |
+
Author URI: http://www.ecwid.com/
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
register_activation_hook( __FILE__, 'ecwid_store_activate' );
|
14 |
+
register_deactivation_hook( __FILE__, 'ecwid_store_deactivate' );
|
15 |
+
|
16 |
+
add_action('admin_init', 'ecwid_settings_api_init');
|
17 |
+
add_action('admin_notices', 'ecwid_is_enabled_message');
|
18 |
+
add_action('admin_menu', 'ecwid_options_add_page');
|
19 |
+
add_action('wp_dashboard_setup', 'ecwid_add_dashboard_widgets' );
|
20 |
+
|
21 |
+
add_shortcode('ecwid_script', 'ecwid_script_shortcode');
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
function ecwid_script_shortcode() {
|
26 |
+
$store_id = get_ecwid_store_id();
|
27 |
+
return "<script type=\"text/javascript\" src=\"http://app.ecwid.com/script.js?$store_id\"></script>";
|
28 |
+
}
|
29 |
+
|
30 |
+
function ecwid_store_activate() {
|
31 |
+
$my_post = array();
|
32 |
+
$content = <<<EOT
|
33 |
+
<!-- Ecwid code start -->
|
34 |
+
|
35 |
+
<!-- Please do not remove the line below otherwise your Ecwid shopping cart will not work.
|
36 |
+
Start of special code: -->
|
37 |
+
[ecwid_script]
|
38 |
+
<!-- End of special code. -->
|
39 |
+
|
40 |
+
<!-- Feel free to modify the code below: add new widgets, alter the existing ones. -->
|
41 |
+
<div><script type="text/javascript"> xCategories(); </script></div>
|
42 |
+
<div><script type="text/javascript"> xProductBrowser("itemsPerRow=3","itemsPerPage=9","searchResultsItemsPerPage=10"); </script></div>
|
43 |
+
<div><script type="text/javascript"> xMinicart("style=","layout=attachToCategories"); </script></div>
|
44 |
+
<!-- Ecwid code end -->
|
45 |
+
|
46 |
+
EOT;
|
47 |
+
add_option("ecwid_store_page_id", '', '', 'yes');
|
48 |
+
add_option("ecwid_store_id", '1003', '', 'yes');
|
49 |
+
$id = get_option("ecwid_store_page_id");
|
50 |
+
$_tmp_page = null;
|
51 |
+
if (!empty($id) and ($id > 0)) {
|
52 |
+
$_tmp_page = get_page($id);
|
53 |
+
}
|
54 |
+
if ($_tmp_page !== null) {
|
55 |
+
$my_post = array();
|
56 |
+
$my_post['ID'] = $id;
|
57 |
+
$my_post['post_status'] = 'publish';
|
58 |
+
wp_update_post( $my_post );
|
59 |
+
|
60 |
+
} else {
|
61 |
+
$my_post['post_title'] = 'Store';
|
62 |
+
$my_post['post_content'] = $content;
|
63 |
+
$my_post['post_status'] = 'publish';
|
64 |
+
$my_post['post_author'] = 1;
|
65 |
+
$my_post['post_type'] = 'page';
|
66 |
+
$id = wp_insert_post( $my_post );
|
67 |
+
update_option('ecwid_store_page_id', $id);
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
function ecwid_is_enabled_message() {
|
72 |
+
if (get_ecwid_store_id() != 1003)
|
73 |
+
return;
|
74 |
+
$ecwid_page_id = get_option("ecwid_store_page_id");
|
75 |
+
$page_url = get_page_link($ecwid_page_id);
|
76 |
+
echo "<div id='' class='updated fade'><p><strong>Ecwid shopping cart is almost ready</strong>. Please visit <a href=\"$page_url\">the created page</a> to see your store with demo products. In order to finish the installation, please go to the <a href=\"options-general.php?page=ecwid_options_page\"><strong>Ecwid settings</strong></a> and configure the plugin.</p></div>";
|
77 |
+
}
|
78 |
+
|
79 |
+
function ecwid_store_deactivate() {
|
80 |
+
$ecwid_page_id = get_option("ecwid_store_page_id");
|
81 |
+
$_tmp_page = null;
|
82 |
+
if (!empty($ecwid_page_id) and ($ecwid_page_id > 0)) {
|
83 |
+
$_tmp_page = get_page($ecwid_page_id);
|
84 |
+
if ($_tmp_page !== null) {
|
85 |
+
$my_post = array();
|
86 |
+
$my_post['ID'] = $ecwid_page_id;
|
87 |
+
$my_post['post_status'] = 'draft';
|
88 |
+
wp_update_post( $my_post );
|
89 |
+
} else {
|
90 |
+
update_option('ecwid_store_page_id', '');
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
function ecwid_settings_api_init() {
|
98 |
+
register_setting( 'ecwid_options_page', 'ecwid_store_id','intval' );
|
99 |
+
}
|
100 |
+
|
101 |
+
function ecwid_options_add_page() {
|
102 |
+
add_options_page('Ecwid shopping cart settings', 'Ecwid shopping cart', 'manage_options', 'ecwid_options_page', 'ecwid_options_do_page');
|
103 |
+
}
|
104 |
+
|
105 |
+
function ecwid_options_do_page() {
|
106 |
+
$store_id = get_ecwid_store_id();
|
107 |
+
?>
|
108 |
+
<div class="wrap">
|
109 |
+
<h2>Ecwid settings</h2>
|
110 |
+
<form method="post" action="options.php">
|
111 |
+
<?php settings_fields('ecwid_options_page'); ?>
|
112 |
+
<table class="form-table">
|
113 |
+
<tr valign="top"><th scope="row">Store ID:</th>
|
114 |
+
<td><input type="text" name="ecwid_store_id" value="<?php if ($store_id != 1003) echo $store_id; ?>" /></td>
|
115 |
+
</tr>
|
116 |
+
</table>
|
117 |
+
<p class="submit">
|
118 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
119 |
+
</p>
|
120 |
+
<style>
|
121 |
+
ul#ecwid-instruction-ul li {
|
122 |
+
padding-bottom:10px;
|
123 |
+
}
|
124 |
+
</style>
|
125 |
+
<div id="ecwid-instruction" >
|
126 |
+
<h4>Instruction on how to get your free Store ID</h4>
|
127 |
+
<ul style="padding-left:30px;list-style-type:disc;" id="ecwid-instruction-ul">
|
128 |
+
<li>Go to the <a href="https://my.ecwid.com/cp/#register" target="_blank">Ecwid control panel</a>. Open this URL: <a href="https://my.ecwid.com/cp/#register" target="_blank">https://my.ecwid.com/cp/#register</a>. You will get to 'Sign in or Register' form.</li>
|
129 |
+
<li> Register an account at Ecwid. Use section "Using Ecwid account" for that. The registration is free.<br />
|
130 |
+
Or you can login using your account at Gmail, Facebook, Twitter, Yahoo, or another provider. Choose one from the list of the providers (click on 'More providers' if you don't see your provider there). Click on the provider logo, you will be redirected to the account login page. Submit your username/password there to login to your Ecwid.
|
131 |
+
<br />
|
132 |
+
Note: the login might take several seconds. Please, be patient.</li>
|
133 |
+
|
134 |
+
<li> When you login the "<a href="https://my.ecwid.com/cp/CP.html#catalog=-1&products=list&profile=-1&settings=4&t1=-1&t2=0&dashboard=-1" target="_blank" >Dashboard</a>" page will appear with 'Getting Started' section.</li>
|
135 |
+
|
136 |
+
<li> Find the Product Browser Widget Code textbox with some lines of HTML/JavaScript code in there. This is the Ecwid integration code.</li>
|
137 |
+
|
138 |
+
<li> Look through the code lines, find this line <br />
|
139 |
+
<span style="background-color:#d3e9e9;">src="http://app.ecwid.com/script.js?<strong>2341</strong>" </span>
|
140 |
+
<br />
|
141 |
+
On your page there will be not '<strong>2341</strong>', but <strong>another number</strong>. This number is your <strong>store ID</strong>. </li>
|
142 |
+
|
143 |
+
</ul>
|
144 |
+
If you have any questions, feel free to ask them on <a href="http://www.ecwid.com/forums/">Ecwid forums</a> or <a href="http://www.ecwid.com/contact-us.html">contact Ecwid team</a>.
|
145 |
+
</div>
|
146 |
+
</form>
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
</div>
|
151 |
+
<?php
|
152 |
+
}
|
153 |
+
|
154 |
+
function get_ecwid_store_id() {
|
155 |
+
$store_id = get_option('ecwid_store_id');
|
156 |
+
if (empty($store_id))
|
157 |
+
$store_id = 1003;
|
158 |
+
return $store_id;
|
159 |
+
}
|
160 |
+
|
161 |
+
function ecwid_setting_callback_function() {
|
162 |
+
$store_id = get_ecwid_store_id();
|
163 |
+
echo "<input name='ecwid_setting_name' id='gv_thumbnails_insert_into_excerpt' value='$store_id' class='code' /> Explanation text";
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
function ecwid_dashboard_widget_function() {
|
168 |
+
echo "<a href=\"https://my.ecwid.com/\" target=\"_blank\">Go to the Ecwid Control Panel</a>";
|
169 |
+
}
|
170 |
+
|
171 |
+
// Create the function use in the action hook
|
172 |
+
|
173 |
+
function ecwid_add_dashboard_widgets() {
|
174 |
+
wp_add_dashboard_widget('ecwid_dashboard_widget','Ecwid Control Panel', 'ecwid_dashboard_widget_function');
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
?>
|
readme.txt
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Ecwid Shopping Cart ===
|
2 |
+
Contributors: Ecwid Team
|
3 |
+
Tags: shopping cart, ecommerce, e-commerce, paypal, google checkout, 2checkout, store, shop, product catalog, inventory
|
4 |
+
Requires at least: 2.7
|
5 |
+
Tested up to: 2.8
|
6 |
+
Stable tag: 0.1
|
7 |
+
|
8 |
+
Ecwid is free full-fledged shopping cart. It can be easily integreted with
|
9 |
+
Wordpress blog and takes less than 5 minutes to set up.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
Ecwid is free full-fledged shopping cart that can be easily add to any blog.
|
13 |
+
It offers the performance and flexibility you need,
|
14 |
+
with none of the hassles you don't.
|
15 |
+
|
16 |
+
There are seven key advantages to Ecwid:
|
17 |
+
|
18 |
+
- It's SaaS
|
19 |
+
- It's free
|
20 |
+
- It takes minutes to add to your site
|
21 |
+
- It supports drag-and-drop
|
22 |
+
- It has AJAX everywhere
|
23 |
+
- Upgrades are seamless
|
24 |
+
- It requires little to no technical support
|
25 |
+
|
26 |
+
You can see the demo there: [http://www.ecwid.com/demo-frontend.html](http://www.ecwid.com/demo-frontend.html)
|
27 |
+
|
28 |
+
Full list of features:
|
29 |
+
[http://www.ecwid.com/features.html](http://www.ecwid.com/features.html)
|
30 |
+
|
31 |
+
== Installation ==
|
32 |
+
|
33 |
+
1. Upload `ecwid-shopping-cart` directory to the `/wp-content/plugins/` directory
|
34 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
35 |
+
3. Setup the plugin on the 'Settings -> Ecwid shopping cart' page.
|
36 |
+
|
37 |
+
== Frequently Asked Questions ==
|
38 |
+
|
39 |
+
[http://www.ecwid.com/faq.html](http://www.ecwid.com/faq.html)
|
40 |
+
|
41 |
+
== Changelog ==
|
42 |
+
|
43 |
+
= 0.1 =
|
44 |
+
* Inital version
|