Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

WooCommerce conversion and update

  • Loading branch information...
commit 0425a68eca45e4a3e39804543504b255eb5c31a9 1 parent 8e8613b
Mike Jolley mikejolley authored
Showing with 10,398 additions and 23,580 deletions.
  1. +42 −51 admin/{jigoshop-admin-attributes.php → admin-attributes.php}
  2. +71 −87 admin/{jigoshop-admin-dashboard.php → admin-dashboard.php}
  3. +87 −0 admin/admin-import.php
  4. +77 −87 admin/{jigoshop-admin.php → admin-init.php}
  5. +78 −93 admin/{jigoshop-install.php → admin-install.php}
  6. +83 −84 admin/{jigoshop-admin-post-types.php → admin-post-types.php}
  7. +1,082 −0 admin/admin-settings.php
  8. +0 −583 admin/jigoshop-admin-settings-options.php
  9. +0 −516 admin/jigoshop-admin-settings.php
  10. +0 −192 admin/jigoshop-write-panels.php
  11. +0 −44 admin/write-panels/product-types/grouped.php
  12. +0 −44 admin/write-panels/product-types/virtual.php
  13. +603 −0 admin/writepanels/writepanel-order_data.php
  14. +10 −21 ...n/{write-panels/product-types/downloadable.php → writepanels/writepanel-product-type-downloadable.php}
  15. +44 −61 admin/{write-panels/product-types/variable.php → writepanels/writepanel-product-type-variable.php}
  16. +84 −0 admin/writepanels/writepanel-product-types.php
  17. +569 −0 admin/writepanels/writepanel-product_data.php
  18. +176 −0 admin/writepanels/writepanels-init.php
  19. +219 −93 assets/css/admin.less
  20. +0 −129 assets/css/datepicker.css
  21. +0 −1,109 assets/css/frontend.css
  22. +7 −7 assets/css/ui.css
  23. +150 −0 assets/css/woocommerce.css
  24. +3 −3 assets/css/{frontend.less → woocommerce.less}
  25. BIN  assets/images/add.png
  26. BIN  assets/images/calendar.png
  27. BIN  assets/images/cross.png
  28. BIN  assets/images/cross_white.png
  29. BIN  assets/images/edit.png
  30. BIN  assets/images/fancybox/fancy_close.png
  31. BIN  assets/images/fancybox/fancy_loading.png
  32. BIN  assets/images/fancybox/fancy_nav_left.png
  33. BIN  assets/images/fancybox/fancy_nav_right.png
  34. BIN  assets/images/fancybox/fancy_shadow_n.png
  35. BIN  assets/images/fancybox/fancy_shadow_ne.png
  36. BIN  assets/images/fancybox/fancy_shadow_nw.png
  37. BIN  assets/images/fancybox/fancy_shadow_s.png
  38. BIN  assets/images/fancybox/fancy_shadow_w.png
  39. BIN  assets/images/fancybox/fancy_title_over.png
  40. BIN  assets/images/fancybox/fancybox-x.png
  41. BIN  assets/images/fancybox/fancybox-y.png
  42. BIN  assets/images/fancybox/fancybox.png
  43. BIN  assets/images/icons/menu_icons.png
  44. BIN  assets/images/icons/paypal.png
  45. BIN  assets/images/icons/skrill.png
  46. BIN  assets/images/jigoshop.png
  47. BIN  assets/images/jigowatt.png
  48. BIN  assets/images/minus.png
  49. BIN  assets/images/placeholder.png
  50. BIN  assets/images/remove.png
  51. BIN  assets/images/star.png
  52. BIN  assets/images/tip.png
  53. BIN  assets/images/ui/ui-bg_flat_0_aaaaaa_40x100.png
  54. BIN  assets/images/ui/ui-bg_glass_55_fbf9ee_1x400.png
  55. BIN  assets/images/ui/ui-bg_glass_65_ffffff_1x400.png
  56. BIN  assets/images/ui/ui-bg_glass_75_dadada_1x400.png
  57. BIN  assets/images/ui/ui-bg_glass_75_e6e6e6_1x400.png
  58. BIN  assets/images/ui/ui-bg_glass_75_ffffff_1x400.png
  59. BIN  assets/images/ui/ui-bg_highlight-soft_75_cccccc_1x100.png
  60. BIN  assets/images/ui/ui-bg_inset-soft_95_fef1ec_1x100.png
  61. BIN  assets/images/ui/ui-icons_222222_256x240.png
  62. BIN  assets/images/ui/ui-icons_2e83ff_256x240.png
  63. BIN  assets/images/ui/ui-icons_454545_256x240.png
  64. BIN  assets/images/ui/ui-icons_888888_256x240.png
  65. BIN  assets/images/ui/ui-icons_cd0a0a_256x240.png
  66. 0  assets/js/{jquery.fancybox-1.3.4.pack.js → fancybox.js}
  67. +2 −2 assets/js/{script.js → woocommerce.js}
  68. +1 −1  assets/js/{jigoshop_backend.js → woocommerce_admin.js}
  69. 0  assets/js/{jigoshop_frontend.js → woocommerce_plugins.js}
  70. +14 −14 assets/js/write-panels.js
  71. +62 −62 classes/{jigoshop_cart.class.php → cart.class.php}
  72. +120 −118 classes/{jigoshop_checkout.class.php → checkout.class.php}
  73. +18 −18 classes/{jigoshop_countries.class.php → countries.class.php}
  74. +41 −0 classes/coupons.class.php
  75. +13 −13 classes/{jigoshop_customer.class.php → customer.class.php}
  76. +204 −0 classes/gateways/gateway-banktransfer.php
  77. +114 −0 classes/gateways/gateway-cheque.php
  78. +307 −0 classes/gateways/gateway-moneybookers.php
  79. +66 −60 gateways/paypal.php → classes/gateways/gateway-paypal.php
  80. +11 −5 { → classes}/gateways/gateway.class.php
  81. +11 −5 { → classes}/gateways/gateways.class.php
  82. +0 −41 classes/jigoshop_coupons.class.php
  83. +32 −32 classes/{jigoshop_order.class.php → order.class.php}
  84. +8 −8 classes/{jigoshop_orders.class.php → orders.class.php}
  85. +33 −33 classes/{jigoshop_product.class.php → product.class.php}
  86. +11 −11 classes/{jigoshop_product_variation.class.php → product_variation.class.php}
  87. +197 −0 classes/shipping/shipping-flat_rate.php
  88. +116 −0 classes/shipping/shipping-free_shipping.php
  89. +15 −5 { → classes}/shipping/shipping.class.php
  90. +15 −5 { → classes}/shipping/shipping_method.class.php
  91. +20 −20 classes/{jigoshop_tax.class.php → tax.class.php}
  92. +5 −5 classes/{jigoshop_validation.class.php → validation.class.php}
  93. +20 −21 classes/{jigoshop.class.php → woocommerce.class.php}
  94. +0 −108 gateways/cheque.php
  95. +0 −300 gateways/skrill.php
  96. BIN  languages/jigoshop-de_DE.mo
  97. +0 −5,198 languages/jigoshop-de_DE.po
  98. +0 −3,729 languages/jigoshop-en_GB.po
  99. BIN  languages/jigoshop-fr_FR.mo
  100. +0 −5,011 languages/jigoshop-fr_FR.po
  101. +0 −4,988 languages/jigoshop.pot
  102. +29 −153 readme.txt
  103. BIN  screenshot-1.png
  104. BIN  screenshot-2.png
  105. BIN  screenshot-3.png
  106. BIN  screenshot-4.png
  107. BIN  screenshot-5.png
  108. BIN  screenshot-6.png
  109. BIN  screenshot-7.png
  110. BIN  screenshot-8.png
  111. BIN  screenshot-9.png
  112. BIN  shipping/.DS_Store
  113. +0 −182 shipping/flat_rate.php
  114. +0 −107 shipping/free_shipping.php
  115. +181 −0 shortcodes/shortcode-cart.php
  116. +41 −0 shortcodes/shortcode-checkout.php
  117. +528 −0 shortcodes/shortcode-my_account.php
  118. +151 −0 shortcodes/shortcode-order_tracking.php
  119. +154 −0 shortcodes/shortcode-pay.php
  120. +65 −0 shortcodes/shortcode-thankyou.php
  121. +205 −0 shortcodes/shortcodes-init.php
  122. +8 −8 templates/archive-product.php
  123. +5 −5 templates/checkout/form.php
  124. +16 −16 templates/checkout/pay_for_order.php
  125. +48 −48 templates/checkout/review_order.php
  126. +8 −8 templates/loop-shop.php
  127. +5 −5 templates/product_taxonomy.php
  128. +19 −19 templates/single-product-reviews.php
  129. +9 −9 templates/single-product.php
  130. +1 −1  templates/taxonomy-product_cat.php
  131. +1 −1  templates/taxonomy-product_tag.php
  132. +0 −1  version.txt
  133. +80 −0 widgets/widget-cart.php
  134. +100 −0 widgets/widget-featured_products.php
  135. +172 −0 widgets/widget-layered_nav.php
  136. +115 −0 widgets/widget-price_filter.php
  137. +111 −0 widgets/widget-product_categories.php
  138. +57 −0 widgets/widget-product_search.php
  139. +62 −0 widgets/widget-product_tag_cloud.php
  140. +123 −0 widgets/widget-recent_products.php
  141. +31 −0 widgets/widgets-init.php
  142. +574 −0 woocommerce.php
  143. +626 −0 woocommerce_actions.php
  144. +286 −0 woocommerce_emails.php
  145. +288 −0 woocommerce_query.php
  146. +419 −0 woocommerce_taxonomy.php
  147. +84 −0 woocommerce_template_actions.php
  148. +799 −0 woocommerce_template_functions.php
  149. +156 −0 woocommerce_templates.php
93 admin/jigoshop-admin-attributes.php → admin/admin-attributes.php
View
@@ -2,11 +2,11 @@
/**
* Functions used for the attributes section in WordPress Admin
*
- * The attributes section lets users add custom attributes to assign to products - they can also be used in the layered nav widgets.
+ * The attributes section lets users add custom attributes to assign to products - they can also be used in the layered nav widget.
*
- * @author Jigowatt
+ * @author WooThemes
* @category Admin
- * @package JigoShop
+ * @package WooCommerce
*/
/**
@@ -14,11 +14,8 @@
*
* Shows the created attributes and lets you add new ones.
* The added attributes are stored in the database and can be used for layered navigation.
- *
- * @since 1.0
- * @usedby jigoshop_admin_menu2()
*/
-function jigoshop_attributes() {
+function woocommerce_attributes() {
global $wpdb;
@@ -30,9 +27,9 @@ function jigoshop_attributes() {
if ($attribute_name && $attribute_type && !taxonomy_exists('product_attribute_'.strtolower(sanitize_title($attribute_name)))) :
- $wpdb->insert( $wpdb->prefix . "jigoshop_attribute_taxonomies", array( 'attribute_name' => $attribute_name, 'attribute_type' => $attribute_type ), array( '%s', '%s' ) );
+ $wpdb->insert( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_name' => $attribute_name, 'attribute_type' => $attribute_type ), array( '%s', '%s' ) );
- update_option('jigowatt_update_rewrite_rules', '1');
+ update_option('woocommerce_update_rewrite_rules', '1');
wp_safe_redirect( get_admin_url() . 'admin.php?page=attributes' );
exit;
@@ -47,7 +44,7 @@ function jigoshop_attributes() {
$attribute_type = $_POST['attribute_type'];
- $wpdb->update( $wpdb->prefix . "jigoshop_attribute_taxonomies", array( 'attribute_type' => $attribute_type ), array( 'attribute_id' => $_GET['edit'] ), array( '%s' ) );
+ $wpdb->update( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_type' => $attribute_type ), array( 'attribute_id' => $_GET['edit'] ), array( '%s' ) );
endif;
@@ -60,9 +57,9 @@ function jigoshop_attributes() {
if ($delete>0) :
- $att_name = $wpdb->get_var("SELECT attribute_name FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$delete'");
+ $att_name = $wpdb->get_var("SELECT attribute_name FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$delete'");
- if ($att_name && $wpdb->query("DELETE FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$delete'")) :
+ if ($att_name && $wpdb->query("DELETE FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$delete'")) :
$taxonomy = 'product_attribute_'.strtolower(sanitize_title($att_name));
@@ -85,9 +82,9 @@ function jigoshop_attributes() {
endif;
if (isset($_GET['edit']) && $_GET['edit'] > 0) :
- jigoshop_edit_attribute();
+ woocommerce_edit_attribute();
else :
- jigoshop_add_attribute();
+ woocommerce_add_attribute();
endif;
}
@@ -96,40 +93,37 @@ function jigoshop_attributes() {
* Edit Attribute admin panel
*
* Shows the interface for changing an attributes type between select, multiselect and text
- *
- * @since 1.0
- * @usedby jigoshop_attributes()
*/
-function jigoshop_edit_attribute() {
+function woocommerce_edit_attribute() {
global $wpdb;
$edit = absint($_GET['edit']);
- $att_type = $wpdb->get_var("SELECT attribute_type FROM " . $wpdb->prefix . "jigoshop_attribute_taxonomies WHERE attribute_id = '$edit'");
+ $att_type = $wpdb->get_var("SELECT attribute_type FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = '$edit'");
?>
- <div class="wrap jigoshop">
- <div class="icon32 icon32-attributes" id="icon-jigoshop"><br/></div>
- <h2><?php _e('Attributes','jigoshop') ?></h2>
+ <div class="wrap woocommerce">
+ <div class="icon32 icon32-attributes" id="icon-woocommerce"><br/></div>
+ <h2><?php _e('Attributes', 'woothemes') ?></h2>
<br class="clear" />
<div id="col-container">
<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
- <h3><?php _e('Edit Attribute','jigoshop') ?></h3>
- <p><?php _e('Attribute taxonomy names cannot be changed; you may only change an attributes type.','jigoshop') ?></p>
+ <h3><?php _e('Edit Attribute', 'woothemes') ?></h3>
+ <p><?php _e('Attribute taxonomy names cannot be changed; you may only change an attributes type.', 'woothemes') ?></p>
<form action="admin.php?page=attributes&amp;edit=<?php echo $edit; ?>" method="post">
<div class="form-field">
- <label for="attribute_type"><?php _e('Attribute type', 'jigoshop'); ?></label>
+ <label for="attribute_type"><?php _e('Attribute type', 'woothemes'); ?></label>
<select name="attribute_type" id="attribute_type" style="width: 100%;">
- <option value="select" <?php if ($att_type=='select') echo 'selected="selected"'; ?>><?php _e('Select','jigoshop') ?></option>
- <option value="multiselect" <?php if ($att_type=='multiselect') echo 'selected="selected"'; ?>><?php _e('Multiselect','jigoshop') ?></option>
- <option value="text" <?php if ($att_type=='text') echo 'selected="selected"'; ?>><?php _e('Text','jigoshop') ?></option>
+ <option value="select" <?php if ($att_type=='select') echo 'selected="selected"'; ?>><?php _e('Select', 'woothemes') ?></option>
+ <option value="multiselect" <?php if ($att_type=='multiselect') echo 'selected="selected"'; ?>><?php _e('Multiselect', 'woothemes') ?></option>
+ <option value="text" <?php if ($att_type=='text') echo 'selected="selected"'; ?>><?php _e('Text', 'woothemes') ?></option>
</select>
</div>
- <p class="submit"><input type="submit" name="save_attribute" id="submit" class="button" value="<?php _e('Save Attribute', 'jigoshop'); ?>"></p>
+ <p class="submit"><input type="submit" name="save_attribute" id="submit" class="button" value="<?php _e('Save Attribute', 'woothemes'); ?>"></p>
</form>
</div>
</div>
@@ -144,15 +138,12 @@ function jigoshop_edit_attribute() {
* Add Attribute admin panel
*
* Shows the interface for adding new attributes
- *
- * @since 1.0
- * @usedby jigoshop_attributes()
*/
-function jigoshop_add_attribute() {
+function woocommerce_add_attribute() {
?>
- <div class="wrap jigoshop">
- <div class="icon32 icon32-attributes" id="icon-jigoshop"><br/></div>
- <h2><?php _e('Attributes','jigoshop') ?></h2>
+ <div class="wrap woocommerce">
+ <div class="icon32 icon32-attributes" id="icon-woocommerce"><br/></div>
+ <h2><?php _e('Attributes', 'woothemes') ?></h2>
<br class="clear" />
<div id="col-container">
<div id="col-right">
@@ -160,21 +151,21 @@ function jigoshop_add_attribute() {
<table class="widefat fixed" style="width:100%">
<thead>
<tr>
- <th scope="col"><?php _e('Name','jigoshop') ?></th>
- <th scope="col"><?php _e('Type','jigoshop') ?></th>
- <th scope="col"><?php _e('Terms','jigoshop') ?></th>
+ <th scope="col"><?php _e('Name', 'woothemes') ?></th>
+ <th scope="col"><?php _e('Type', 'woothemes') ?></th>
+ <th scope="col"><?php _e('Terms', 'woothemes') ?></th>
</tr>
</thead>
<tbody>
<?php
- $attribute_taxonomies = jigoshop::$attribute_taxonomies;
+ $attribute_taxonomies = woocommerce::$attribute_taxonomies;
if ( $attribute_taxonomies ) :
foreach ($attribute_taxonomies as $tax) :
?><tr>
<td><a href="edit-tags.php?taxonomy=product_attribute_<?php echo strtolower(sanitize_title($tax->attribute_name)); ?>&amp;post_type=product"><?php echo $tax->attribute_name; ?></a>
- <div class="row-actions"><span class="edit"><a href="<?php echo add_query_arg('edit', $tax->attribute_id, 'admin.php?page=attributes') ?>"><?php _e('Edit', 'jigoshop'); ?></a> | </span><span class="delete"><a class="delete" href="<?php echo add_query_arg('delete', $tax->attribute_id, 'admin.php?page=attributes') ?>"><?php _e('Delete', 'jigoshop'); ?></a></span></div>
+ <div class="row-actions"><span class="edit"><a href="<?php echo add_query_arg('edit', $tax->attribute_id, 'admin.php?page=attributes') ?>"><?php _e('Edit', 'woothemes'); ?></a> | </span><span class="delete"><a class="delete" href="<?php echo add_query_arg('delete', $tax->attribute_id, 'admin.php?page=attributes') ?>"><?php _e('Delete', 'woothemes'); ?></a></span></div>
</td>
<td><?php echo ucwords($tax->attribute_type); ?></td>
<td><?php
@@ -196,7 +187,7 @@ function jigoshop_add_attribute() {
</tr><?php
endforeach;
else :
- ?><tr><td colspan="5"><?php _e('No attributes currently exist.','jigoshop') ?></td></tr><?php
+ ?><tr><td colspan="5"><?php _e('No attributes currently exist.', 'woothemes') ?></td></tr><?php
endif;
?>
</tbody>
@@ -206,28 +197,28 @@ function jigoshop_add_attribute() {
<div id="col-left">
<div class="col-wrap">
<div class="form-wrap">
- <h3><?php _e('Add New Attribute','jigoshop') ?></h3>
- <p><?php _e('Attributes let you define extra product data, such as size or colour. You can use these attributes in the shop sidebar using the "layered nav" widgets. Please note: you cannot rename an attribute later on.','jigoshop') ?></p>
+ <h3><?php _e('Add New Attribute', 'woothemes') ?></h3>
+ <p><?php _e('Attributes let you define extra product data, such as size or colour. You can use these attributes in the shop sidebar using the "layered nav" widgets. Please note: you cannot rename an attribute later on.', 'woothemes') ?></p>
<form action="admin.php?page=attributes" method="post">
<div style="width:47%; float:left; margin:0 1% 0 0;">
<div class="form-field">
- <label for="attribute_name"><?php _e('Attribute Name', 'jigoshop'); ?></label>
+ <label for="attribute_name"><?php _e('Attribute Name', 'woothemes'); ?></label>
<input name="attribute_name" id="attribute_name" type="text" value="" />
</div>
</div>
<div style="width:47%; float:left; margin:0 1% 0 0;">
<div class="form-field">
- <label for="attribute_type"><?php _e('Attribute type', 'jigoshop'); ?></label>
+ <label for="attribute_type"><?php _e('Attribute type', 'woothemes'); ?></label>
<select name="attribute_type" id="attribute_type" style="width: 100%;">
- <option value="select"><?php _e('Select','jigoshop') ?></option>
- <option value="multiselect"><?php _e('Multiselect','jigoshop') ?></option>
- <option value="text"><?php _e('Text','jigoshop') ?></option>
+ <option value="select"><?php _e('Select', 'woothemes') ?></option>
+ <option value="multiselect"><?php _e('Multiselect', 'woothemes') ?></option>
+ <option value="text"><?php _e('Text', 'woothemes') ?></option>
</select>
</div>
</div>
<div class="clear"></div>
- <p class="submit"><input type="submit" name="add_new_attribute" id="submit" class="button" value="<?php _e('Add Attribute', 'jigoshop'); ?>"></p>
+ <p class="submit"><input type="submit" name="add_new_attribute" id="submit" class="button" value="<?php _e('Add Attribute', 'woothemes'); ?>"></p>
</form>
</div>
</div>
@@ -237,7 +228,7 @@ function jigoshop_add_attribute() {
/* <![CDATA[ */
jQuery('a.delete').click(function(){
- var answer = confirm ("<?php _e('Are you sure you want to delete this?', 'jigoshop'); ?>");
+ var answer = confirm ("<?php _e('Are you sure you want to delete this?', 'woothemes'); ?>");
if (answer) return true;
return false;
});
158 admin/jigoshop-admin-dashboard.php → admin/admin-dashboard.php
View
@@ -1,40 +1,39 @@
<?php
/**
- * Functions used for displaying the jigoshop dashboard
+ * Functions used for displaying the WooCommerce store dashboard
*
- * @author Jigowatt
+ * @author WooThemes
* @category Admin
- * @package JigoShop
+ * @package WooCommerce
*/
/**
* Function for showing the dashboard
*
- * The dashboard shows widget for things such as:
+ * The dashboard shows widgets for things such as:
* - Products
* - Sales
* - Recent reviews
- *
- * @since 1.0
- * @usedby jigoshop_admin_menu()
+ * - Inventory notifications
+ * - WooCommerce news and updates
*/
-function jigoshop_dashboard() {
+function woocommerce_dashboard() {
?>
- <div class="wrap jigoshop">
- <div class="icon32 jigoshop_icon"><br/></div>
- <h2><?php _e('Jigoshop Dashboard','jigoshop'); ?></h2>
- <div id="jigoshop_dashboard">
+ <div class="wrap woocommerce">
+ <div class="icon32 woocommerce_icon"><br/></div>
+ <h2><?php _e('WooCommerce Dashboard', 'woothemes'); ?></h2>
+ <div id="woocommerce_dashboard">
<div id="dashboard-widgets" class="metabox-holder">
<div class="postbox-container" style="width:49%;">
- <div id="jigoshop_right_now" class="jigoshop_right_now postbox">
- <h3><?php _e('Right Now', 'jigoshop') ?></h3>
+ <div id="woocommerce_right_now" class="woocommerce_right_now postbox">
+ <h3><?php _e('Right Now', 'woothemes') ?></h3>
<div class="inside">
<div class="table table_content">
- <p class="sub"><?php _e('Shop Content', 'jigoshop'); ?></p>
+ <p class="sub"><?php _e('Shop Content', 'woothemes'); ?></p>
<table>
<tbody>
<tr class="first">
@@ -43,55 +42,55 @@ function jigoshop_dashboard() {
$num = number_format_i18n( $num_posts->publish );
echo $num;
?></a></td>
- <td class="t"><a href="edit.php?post_type=product"><?php _e('Products', 'jigoshop'); ?></a></td>
+ <td class="t"><a href="edit.php?post_type=product"><?php _e('Products', 'woothemes'); ?></a></td>
</tr>
<tr>
<td class="first b"><a href="edit-tags.php?taxonomy=product_cat&post_type=product"><?php
echo wp_count_terms('product_cat');
?></a></td>
- <td class="t"><a href="edit-tags.php?taxonomy=product_cat&post_type=product"><?php _e('Product Categories', 'jigoshop'); ?></a></td>
+ <td class="t"><a href="edit-tags.php?taxonomy=product_cat&post_type=product"><?php _e('Product Categories', 'woothemes'); ?></a></td>
</tr>
<tr>
<td class="first b"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php
echo wp_count_terms('product_tag');
?></a></td>
- <td class="t"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php _e('Product Tag', 'jigoshop'); ?></a></td>
+ <td class="t"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php _e('Product Tag', 'woothemes'); ?></a></td>
</tr>
<tr>
<td class="first b"><a href="admin.php?page=attributes"><?php
- echo sizeof(jigoshop::$attribute_taxonomies);
+ echo sizeof(woocommerce::$attribute_taxonomies);
?></a></td>
- <td class="t"><a href="admin.php?page=attributes"><?php _e('Attribute taxonomies', 'jigoshop'); ?></a></td>
+ <td class="t"><a href="admin.php?page=attributes"><?php _e('Attribute taxonomies', 'woothemes'); ?></a></td>
</tr>
</tbody>
</table>
</div>
<div class="table table_discussion">
- <p class="sub"><?php _e('Orders', 'jigoshop'); ?></p>
+ <p class="sub"><?php _e('Orders', 'woothemes'); ?></p>
<table>
<tbody>
- <?php $jigoshop_orders = &new jigoshop_orders(); ?>
+ <?php $woocommerce_orders = &new woocommerce_orders(); ?>
<tr class="first">
- <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=pending"><span class="total-count"><?php echo $jigoshop_orders->pending_count; ?></span></a></td>
- <td class="last t"><a class="pending" href="edit.php?post_type=shop_order&shop_order_status=pending"><?php _e('Pending', 'jigoshop'); ?></a></td>
+ <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=pending"><span class="total-count"><?php echo $woocommerce_orders->pending_count; ?></span></a></td>
+ <td class="last t"><a class="pending" href="edit.php?post_type=shop_order&shop_order_status=pending"><?php _e('Pending', 'woothemes'); ?></a></td>
</tr>
<tr>
- <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=on-hold"><span class="total-count"><?php echo $jigoshop_orders->on_hold_count; ?></span></a></td>
- <td class="last t"><a class="onhold" href="edit.php?post_type=shop_order&shop_order_status=on-hold"><?php _e('On-Hold', 'jigoshop'); ?></a></td>
+ <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=on-hold"><span class="total-count"><?php echo $woocommerce_orders->on_hold_count; ?></span></a></td>
+ <td class="last t"><a class="onhold" href="edit.php?post_type=shop_order&shop_order_status=on-hold"><?php _e('On-Hold', 'woothemes'); ?></a></td>
</tr>
<tr>
- <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=processing"><span class="total-count"><?php echo $jigoshop_orders->processing_count; ?></span></a></td>
- <td class="last t"><a class="processing" href="edit.php?post_type=shop_order&shop_order_status=processing"><?php _e('Processing', 'jigoshop'); ?></a></td>
+ <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=processing"><span class="total-count"><?php echo $woocommerce_orders->processing_count; ?></span></a></td>
+ <td class="last t"><a class="processing" href="edit.php?post_type=shop_order&shop_order_status=processing"><?php _e('Processing', 'woothemes'); ?></a></td>
</tr>
<tr>
- <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=completed"><span class="total-count"><?php echo $jigoshop_orders->completed_count; ?></span></a></td>
- <td class="last t"><a class="complete" href="edit.php?post_type=shop_order&shop_order_status=completed"><?php _e('Completed', 'jigoshop'); ?></a></td>
+ <td class="b"><a href="edit.php?post_type=shop_order&shop_order_status=completed"><span class="total-count"><?php echo $woocommerce_orders->completed_count; ?></span></a></td>
+ <td class="last t"><a class="complete" href="edit.php?post_type=shop_order&shop_order_status=completed"><?php _e('Completed', 'woothemes'); ?></a></td>
</tr>
</tbody>
</table>
</div>
<div class="versions">
- <p id="wp-version-message"><?php _e('You are using', 'jigoshop'); ?> <strong>JigoShop <?php echo JIGOSHOP_VERSION; ?>.</strong></p>
+ <p id="wp-version-message"><?php _e('You are using', 'woothemes'); ?> <strong>WooCommerce <?php echo WOOCOMMERCE_VERSION; ?>.</strong></p>
</div>
<div class="clear"></div>
</div>
@@ -99,7 +98,7 @@ function jigoshop_dashboard() {
</div><!-- postbox end -->
<div class="postbox">
- <h3 class="hndle" id="poststuff"><span><?php _e('Recent Orders', 'jigoshop') ?></span></h3>
+ <h3 class="hndle" id="poststuff"><span><?php _e('Recent Orders', 'woothemes') ?></span></h3>
<div class="inside">
<?php
$args = array(
@@ -114,12 +113,12 @@ function jigoshop_dashboard() {
echo '<ul class="recent-orders">';
foreach ($orders as $order) :
- $this_order = &new jigoshop_order( $order->ID );
+ $this_order = &new woocommerce_order( $order->ID );
echo '
<li>
<span class="order-status '.sanitize_title($this_order->status).'">'.ucwords($this_order->status).'</span> <a href="'.admin_url('post.php?post='.$order->ID).'&action=edit">'.date_i18n('l jS \of F Y h:i:s A', strtotime($this_order->order_date)).'</a><br />
- <small>'.sizeof($this_order->items).' '._n('item', 'items', sizeof($this_order->items), 'jigoshop').' <span class="order-cost">'.__('Total: ', 'jigoshop').jigoshop_price($this_order->order_total).'</span></small>
+ <small>'.sizeof($this_order->items).' '._n('item', 'items', sizeof($this_order->items), 'woothemes').' <span class="order-cost">'.__('Total: ', 'woothemes').woocommerce_price($this_order->order_total).'</span></small>
</li>';
endforeach;
@@ -129,17 +128,17 @@ function jigoshop_dashboard() {
</div>
</div><!-- postbox end -->
- <?php if (get_option('jigoshop_manage_stock')=='yes') : ?>
- <div class="postbox jigoshop_right_now">
- <h3 class="hndle" id="poststuff"><span><?php _e('Stock Report', 'jigoshop') ?></span></h3>
+ <?php if (get_option('woocommerce_manage_stock')=='yes') : ?>
+ <div class="postbox woocommerce_right_now">
+ <h3 class="hndle" id="poststuff"><span><?php _e('Stock Report', 'woothemes') ?></span></h3>
<div class="inside">
<?php
- $lowstockamount = get_option('jigoshop_notify_low_stock_amount');
+ $lowstockamount = get_option('woocommerce_notify_low_stock_amount');
if (!is_numeric($lowstockamount)) $lowstockamount = 1;
- $nostockamount = get_option('jigoshop_notify_no_stock_amount');
+ $nostockamount = get_option('woocommerce_notify_no_stock_amount');
if (!is_numeric($nostockamount)) $nostockamount = 1;
$outofstock = array();
@@ -153,7 +152,7 @@ function jigoshop_dashboard() {
$my_query = new WP_Query($args);
if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
- $_product = &new jigoshop_product( $my_query->post->ID );
+ $_product = &new woocommerce_product( $my_query->post->ID );
if (!$_product->managing_stock()) continue;
$thisitem = '<tr class="first">
@@ -172,15 +171,15 @@ function jigoshop_dashboard() {
wp_reset_query();
if (sizeof($lowinstock)==0) :
- $lowinstock[] = '<tr><td colspan="2">'.__('No products are low in stock.', 'jigoshop').'</td></tr>';
+ $lowinstock[] = '<tr><td colspan="2">'.__('No products are low in stock.', 'woothemes').'</td></tr>';
endif;
if (sizeof($outofstock)==0) :
- $outofstock[] = '<tr><td colspan="2">'.__('No products are out of stock.', 'jigoshop').'</td></tr>';
+ $outofstock[] = '<tr><td colspan="2">'.__('No products are out of stock.', 'woothemes').'</td></tr>';
endif;
?>
<div class="table table_content">
- <p class="sub"><?php _e('Low Stock', 'jigoshop'); ?></p>
+ <p class="sub"><?php _e('Low Stock', 'woothemes'); ?></p>
<table>
<tbody>
<?php echo implode('', $lowinstock); ?>
@@ -188,7 +187,7 @@ function jigoshop_dashboard() {
</table>
</div>
<div class="table table_discussion">
- <p class="sub"><?php _e('Out of Stock/Backorders', 'jigoshop'); ?></p>
+ <p class="sub"><?php _e('Out of Stock/Backorders', 'woothemes'); ?></p>
<table>
<tbody>
<?php echo implode('', $outofstock); ?>
@@ -212,11 +211,11 @@ function jigoshop_dashboard() {
if (isset($_GET['month'])) $current_month_offset = (int) $_GET['month'];
?>
- <div class="postbox stats" id="jigoshop-stats">
+ <div class="postbox stats" id="woocommerce-stats">
<h3 class="hndle" id="poststuff">
- <?php if ($current_month_offset!=date('m')) : ?><a href="admin.php?page=jigoshop&amp;month=<?php echo $current_month_offset+1; ?>" class="next">Next Month &rarr;</a><?php endif; ?>
- <a href="admin.php?page=jigoshop&amp;month=<?php echo $current_month_offset-1; ?>" class="previous">&larr; Previous Month</a>
- <span><?php _e('Monthly Sales', 'jigoshop') ?></span></h3>
+ <?php if ($current_month_offset!=date('m')) : ?><a href="admin.php?page=woocommerce&amp;month=<?php echo $current_month_offset+1; ?>" class="next">Next Month &rarr;</a><?php endif; ?>
+ <a href="admin.php?page=woocommerce&amp;month=<?php echo $current_month_offset-1; ?>" class="previous">&larr; Previous Month</a>
+ <span><?php _e('Monthly Sales', 'woothemes') ?></span></h3>
<div class="inside">
<div id="placeholder" style="width:100%; height:300px; position:relative;"></div>
<script type="text/javascript">
@@ -304,7 +303,7 @@ function orders_this_month( $where = '' ) {
if ($orders) :
foreach ($orders as $order) :
- $order_data = &new jigoshop_order($order->ID);
+ $order_data = &new woocommerce_order($order->ID);
if ($order_data->status=='cancelled' || $order_data->status=='refunded') continue;
@@ -403,7 +402,7 @@ function showTooltip(x, y, contents) {
} else {
var y = item.datapoint[1].toFixed(2);
- showTooltip(item.pageX, item.pageY, item.series.label + " - <?php echo get_jigoshop_currency_symbol(); ?>" + y);
+ showTooltip(item.pageX, item.pageY, item.series.label + " - <?php echo get_woocommerce_currency_symbol(); ?>" + y);
}
@@ -423,8 +422,8 @@ function showTooltip(x, y, contents) {
</div><!-- postbox end -->
<div class="postbox">
- <h3 class="hndle" id="poststuff"><span><?php _e('Recent Product Reviews', 'jigoshop') ?></span></h3>
- <div class="inside jigoshop-reviews-widget">
+ <h3 class="hndle" id="poststuff"><span><?php _e('Recent Product Reviews', 'woothemes') ?></span></h3>
+ <div class="inside woocommerce-reviews-widget">
<?php
global $wpdb;
$comments = $wpdb->get_results("SELECT *, SUBSTRING(comment_content,1,100) AS comment_excerpt
@@ -448,7 +447,7 @@ function showTooltip(x, y, contents) {
$rating = get_comment_meta( $comment->comment_ID, 'rating', true );
echo '<div class="star-rating" title="'.$rating.'">
- <span style="width:'.($rating*16).'px">'.$rating.' '.__('out of 5', 'jigoshop').'</span></div>';
+ <span style="width:'.($rating*16).'px">'.$rating.' '.__('out of 5', 'woothemes').'</span></div>';
echo '<h4 class="meta"><a href="'.get_permalink($comment->ID).'#comment-'.$comment->comment_ID .'">'.$comment->post_title.'</a> reviewed by ' .strip_tags($comment->comment_author) .'</h4>';
echo '<blockquote>'.strip_tags($comment->comment_excerpt).' [...]</blockquote></li>';
@@ -456,21 +455,21 @@ function showTooltip(x, y, contents) {
endforeach;
echo '</ul>';
else :
- echo '<p>'.__('There are no product reviews yet.', 'jigoshop').'</p>';
+ echo '<p>'.__('There are no product reviews yet.', 'woothemes').'</p>';
endif;
?>
</div>
</div><!-- postbox end -->
<div class="postbox">
- <h3 class="hndle" id="poststuff"><span><?php _e('Latest News', 'jigoshop') ?></span></h3>
- <div class="inside jigoshop-rss-widget">
+ <h3 class="hndle" id="poststuff"><span><?php _e('Latest News', 'woothemes') ?></span></h3>
+ <div class="inside woocommerce-rss-widget">
<?php
if (file_exists(ABSPATH.WPINC.'/class-simplepie.php')) {
include_once(ABSPATH.WPINC.'/class-simplepie.php');
- $rss = fetch_feed('http://jigoshop.com/feed');
+ $rss = fetch_feed('http://woocommerce.com/feed');
if (!is_wp_error( $rss ) ) :
@@ -490,9 +489,9 @@ function showTooltip(x, y, contents) {
$date = $item->get_date('U');
if ( ( abs( time() - $date) ) < 86400 ) : // 1 Day
- $human_date = sprintf(__('%s ago','jigoshop'), human_time_diff($date));
+ $human_date = sprintf(__('%s ago', 'woothemes'), human_time_diff($date));
else :
- $human_date = date(__('F jS Y','jigoshop'), $date);
+ $human_date = date(__('F jS Y', 'woothemes'), $date);
endif;
echo '<li><a href="'.$link.'">'.$title.'</a> &ndash; <span class="rss-date">'.$human_date.'</span></li>';
@@ -502,11 +501,11 @@ function showTooltip(x, y, contents) {
echo '</ul>';
else :
- echo '<ul><li>'.__('No items found.','jigoshop').'</li></ul>';
+ echo '<ul><li>'.__('No items found.', 'woothemes').'</li></ul>';
endif;
else :
- echo '<ul><li>'.__('No items found.','jigoshop').'</li></ul>';
+ echo '<ul><li>'.__('No items found.', 'woothemes').'</li></ul>';
endif;
}
@@ -515,41 +514,26 @@ function showTooltip(x, y, contents) {
</div><!-- postbox end -->
<div class="postbox">
- <h3 class="hndle" id="poststuff"><span><?php _e('Useful Links', 'jigoshop') ?></span></h3>
- <div class="inside jigoshop-links-widget">
+ <h3 class="hndle" id="poststuff"><span><?php _e('Useful Links', 'woothemes') ?></span></h3>
+ <div class="inside woocommerce-links-widget">
<ul class="links">
- <li><a href="http://jigoshop.com/"><?php _e('Jigoshop', 'jigoshop'); ?></a> &ndash; <?php _e('Learn more about the Jigoshop plugin', 'jigoshop'); ?></li>
- <li><a href="http://jigoshop.com/tour/"><?php _e('Tour', 'jigoshop'); ?></a> &ndash; <?php _e('Take a tour of the plugin', 'jigoshop'); ?></li>
- <li><a href="http://jigoshop.com/user-guide/"><?php _e('Documentation', 'jigoshop'); ?></a> &ndash; <?php _e('Stuck? Read the plugin\'s documentation.', 'jigoshop'); ?></li>
- <li><a href="http://jigoshop.com/forums/"><?php _e('Forums', 'jigoshop'); ?></a> &ndash; <?php _e('Help from the community or our dedicated support team.', 'jigoshop'); ?></li>
- <li><a href="http://jigoshop.com/extend/extensions/"><?php _e('Jigoshop Extensions', 'jigoshop'); ?></a> &ndash; <?php _e('Extend Jigoshop with extra plugins and modules.', 'jigoshop'); ?></li>
- <li><a href="http://jigoshop.com/extend/themes/"><?php _e('Jigoshop Themes', 'jigoshop'); ?></a> &ndash; <?php _e('Extend Jigoshop with themes.', 'jigoshop'); ?></li>
- <li><a href="http://twitter.com/#!/jigoshop"><?php _e('@Jigoshop', 'jigoshop'); ?></a> &ndash; <?php _e('Follow us on Twitter.', 'jigoshop'); ?></li>
- <li><a href="https://github.com/mikejolley/Jigoshop"><?php _e('Jigoshop on Github', 'jigoshop'); ?></a> &ndash; <?php _e('Help extend Jigoshop.', 'jigoshop'); ?></li>
- <li><a href="http://wordpress.org/extend/plugins/jigoshop/"><?php _e('Jigoshop on WordPress.org', 'jigoshop'); ?></a> &ndash; <?php _e('Leave us a rating!', 'jigoshop'); ?></li>
+ <li><a href="http://www.woothemes.com/"><?php _e('WooThemes', 'woothemes'); ?></a> &ndash; <?php _e('Premium WordPress Themes', 'woothemes'); ?></li>
+ <li><a href="https://github.com/mikejolley/woocommerce"><?php _e('WooCommerce on Github', 'woothemes'); ?></a> &ndash; <?php _e('Help extend and develop WooCommerce.', 'woothemes'); ?></li>
+ <li><a href="http://wordpress.org/extend/plugins/woocommerce/"><?php _e('WooCommerce on WordPress.org', 'woothemes'); ?></a> &ndash; <?php _e('Leave us a rating if you like it!', 'woothemes'); ?></li>
</ul>
<div class="social">
- <h4 class="first"><?php _e('Show your support &amp; Help promote Jigoshop!', 'jigoshop'); ?></h4>
-
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin: 0 0 1em 0;">
- <input type="hidden" name="cmd" value="_s-xclick">
- <input type="hidden" name="hosted_button_id" value="TKRER2WH7UAD6">
- <input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online." style="margin:0; padding:0; ">
- <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
- </form>
+ <h4 class="first"><?php _e('Show your support for WooCommerce!', 'woothemes'); ?></h4>
- <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjigoshop.com&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=segoe+ui&amp;height=24" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:24px;" allowTransparency="true"></iframe>
+ <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwoocommerce.com&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=segoe+ui&amp;height=24" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:24px;" allowTransparency="true"></iframe>
- <p><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jigoshop.com/" data-text="Jigoshop: A WordPress eCommerce solution that works" data-count="horizontal" data-via="jigoshop" data-related="Jigowatt:Creators">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
+ <p><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://woocommerce.com/" data-text="WooCommerce: A WordPress eCommerce solution that works" data-count="horizontal" data-via="woocommerce" data-related="WooThemes:Creators">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
- <p><g:plusone size="medium" href="http://jigoshop.com/"></g:plusone><script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'en-GB'}</script></p>
+ <p><g:plusone size="medium" href="http://woocommerce.com/"></g:plusone><script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'en-GB'}</script></p>
- <h4><?php _e('Jigoshop is bought to you by&hellip;', 'jigoshop'); ?></h4>
+ <h4><?php _e('WooCommerce is bought to you by&hellip;', 'woothemes'); ?></h4>
- <p><a href="http://jigowatt.co.uk/"><img src="<?php echo jigoshop::plugin_url(); ?>/assets/images/jigowatt.png" alt="Jigowatt" /></a></p>
-
- <p>From design to deployment Jigowatt delivers expert solutions to enterprise customers using Magento & WordPress open source platforms.</p>
+ <p><a href="http://woocommerce.co.uk/"><img src="<?php echo woocommerce::plugin_url(); ?>/assets/images/woocommerce.png" alt="WooThemes" /></a></p>
</div>
<div class="clear"></div>
87 admin/admin-import.php
View
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Functions for handling WordPress import to make it compatable with WooCommerce
+ *
+ * WordPress import should work - however, it fails to import custom product attribute taxonomies.
+ * This code grabs the file before it is imported and ensures the taxonomies are created.
+ *
+ * @author WooThemes
+ * @category Admin
+ * @package WooCommerce
+ */
+
+function woocommerce_import_start() {
+
+ global $wpdb;
+
+ $id = (int) $_POST['import_id'];
+ $file = get_attached_file( $id );
+
+ $parser = new WXR_Parser();
+ $import_data = $parser->parse( $file );
+
+ if (isset($import_data['posts'])) :
+ $posts = $import_data['posts'];
+
+ if ($posts && sizeof($posts)>0) foreach ($posts as $post) :
+
+ if ($post['post_type']=='product') :
+
+ if ($post['terms'] && sizeof($post['terms'])>0) :
+
+ foreach ($post['terms'] as $term) :
+
+ $domain = $term['domain'];
+
+ if (strstr($domain, 'product_attribute_')) :
+
+ // Make sure it exists!
+ if (!taxonomy_exists( $domain )) :
+
+ $nicename = ucfirst(str_replace('product_attribute_', '', $domain));
+
+ // Create the taxonomy
+ $wpdb->insert( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_name' => $nicename, 'attribute_type' => 'text' ), array( '%s', '%s' ) );
+
+ // Register the taxonomy now so that the import works!
+ register_taxonomy( $domain,
+ array('product'),
+ array(
+ 'hierarchical' => true,
+ 'labels' => array(
+ 'name' => $nicename,
+ 'singular_name' => $nicename,
+ 'search_items' => __( 'Search ', 'woothemes') . $nicename,
+ 'all_items' => __( 'All ', 'woothemes') . $nicename,
+ 'parent_item' => __( 'Parent ', 'woothemes') . $nicename,
+ 'parent_item_colon' => __( 'Parent ', 'woothemes') . $nicename . ':',
+ 'edit_item' => __( 'Edit ', 'woothemes') . $nicename,
+ 'update_item' => __( 'Update ', 'woothemes') . $nicename,
+ 'add_new_item' => __( 'Add New ', 'woothemes') . $nicename,
+ 'new_item_name' => __( 'New ', 'woothemes') . $nicename
+ ),
+ 'show_ui' => false,
+ 'query_var' => true,
+ 'rewrite' => array( 'slug' => strtolower(sanitize_title($nicename)), 'with_front' => false, 'hierarchical' => true ),
+ )
+ );
+
+ update_option('woocommerce_update_rewrite_rules', '1');
+
+ endif;
+
+ endif;
+
+ endforeach;
+
+ endif;
+
+ endif;
+
+ endforeach;
+
+ endif;
+
+}
+
+add_action('import_start', 'woocommerce_import_start');
164 admin/jigoshop-admin.php → admin/admin-init.php
View
@@ -1,29 +1,25 @@
<?php
/**
- * JigoShop Admin
+ * WooCommerce Admin
*
- * Main admin file which loads all settings panels and sets up the menus.
+ * Main admin file which loads all settings panels and sets up admin menus.
*
- * @author Jigowatt
+ * @author WooThemes
* @category Admin
- * @package JigoShop
+ * @package WooCommerce
*/
+include_once( 'admin-settings.php' );
+include_once( 'admin-install.php' );
-
-require_once ( 'jigoshop-install.php' );
-
-require_once ( 'jigoshop-admin-dashboard.php' );
-require_once ( 'jigoshop-write-panels.php' );
-require_once ( 'jigoshop-admin-settings.php' );
-require_once ( 'jigoshop-admin-attributes.php' );
-require_once ( 'jigoshop-admin-post-types.php' );
-
-
-function jigoshop_admin_init () {
- require_once ( 'jigoshop-admin-settings-options.php' );
+function woocommerce_admin_init() {
+ include_once( 'admin-attributes.php' );
+ include_once( 'admin-dashboard.php' );
+ include_once( 'admin-import.php' );
+ include_once( 'admin-post-types.php' );
+ include_once( 'writepanels/writepanels-init.php' );
}
-add_action('admin_init', 'jigoshop_admin_init');
+add_action('admin_init', 'woocommerce_admin_init');
/**
* Admin Menus
@@ -32,61 +28,59 @@ function jigoshop_admin_init () {
*
* @since 1.0
*/
-function jigoshop_admin_menu() {
+function woocommerce_admin_menu() {
global $menu;
- $menu[] = array( '', 'read', 'separator-jigoshop', '', 'wp-menu-separator' );
+ $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator' );
- add_menu_page(__('Jigoshop'), __('Jigoshop'), 'manage_options', 'jigoshop' , 'jigoshop_dashboard', jigoshop::plugin_url() . '/assets/images/icons/menu_icons.png', 56);
- add_submenu_page('jigoshop', __('Dashboard', 'jigoshop'), __('Dashboard', 'jigoshop'), 'manage_options', 'jigoshop', 'jigoshop_dashboard');
- add_submenu_page('jigoshop', __('General Settings', 'jigoshop'), __('Settings', 'jigoshop') , 'manage_options', 'settings', 'jigoshop_settings');
- add_submenu_page('jigoshop', __('System Info','jigoshop'), __('System Info','jigoshop'), 'manage_options', 'sysinfo', 'jigoshop_system_info');
- add_submenu_page('edit.php?post_type=product', __('Attributes','jigoshop'), __('Attributes','jigoshop'), 'manage_options', 'attributes', 'jigoshop_attributes');
+ add_menu_page(__('WooCommerce'), __('WooCommerce'), 'manage_options', 'woocommerce' , 'woocommerce_dashboard', woocommerce::plugin_url() . '/assets/images/icons/menu_icons.png', 56);
+ add_submenu_page('woocommerce', __('Dashboard', 'woothemes'), __('Dashboard', 'woothemes'), 'manage_options', 'woocommerce', 'woocommerce_dashboard');
+ add_submenu_page('woocommerce', __('General Settings', 'woothemes'), __('Settings', 'woothemes') , 'manage_options', 'settings', 'woocommerce_settings');
+ add_submenu_page('woocommerce', __('System Info', 'woothemes'), __('System Info', 'woothemes'), 'manage_options', 'sysinfo', 'woocommerce_system_info');
+ add_submenu_page('edit.php?post_type=product', __('Attributes', 'woothemes'), __('Attributes', 'woothemes'), 'manage_options', 'attributes', 'woocommerce_attributes');
}
-function jigoshop_admin_menu_order( $menu_order ) {
+function woocommerce_admin_menu_order( $menu_order ) {
// Initialize our custom order array
- $jigoshop_menu_order = array();
+ $woocommerce_menu_order = array();
// Get the index of our custom separator
- $jigoshop_separator = array_search( 'separator-jigoshop', $menu_order );
+ $woocommerce_separator = array_search( 'separator-woocommerce', $menu_order );
// Loop through menu order and do some rearranging
foreach ( $menu_order as $index => $item ) :
- if ( ( ( 'jigoshop' ) == $item ) ) :
- $jigoshop_menu_order[] = 'separator-jigoshop';
- unset( $menu_order[$jigoshop_separator] );
+ if ( ( ( 'woocommerce' ) == $item ) ) :
+ $woocommerce_menu_order[] = 'separator-woocommerce';
+ unset( $menu_order[$woocommerce_separator] );
endif;
- if ( !in_array( $item, array( 'separator-jigoshop' ) ) ) :
- $jigoshop_menu_order[] = $item;
+ if ( !in_array( $item, array( 'separator-woocommerce' ) ) ) :
+ $woocommerce_menu_order[] = $item;
endif;
endforeach;
// Return order
- return $jigoshop_menu_order;
+ return $woocommerce_menu_order;
}
-function jigoshop_admin_custom_menu_order() {
+function woocommerce_admin_custom_menu_order() {
if ( !current_user_can( 'manage_options' ) ) return false;
return true;
}
-add_action('admin_menu', 'jigoshop_admin_menu');
-add_action('menu_order', 'jigoshop_admin_menu_order');
-add_action('custom_menu_order', 'jigoshop_admin_custom_menu_order');
+add_action('admin_menu', 'woocommerce_admin_menu');
+add_action('menu_order', 'woocommerce_admin_menu_order');
+add_action('custom_menu_order', 'woocommerce_admin_custom_menu_order');
/**
* Admin Head
*
- * Outputs some styles in the admin <head> to show icons on the jigoshop admin pages
- *
- * @since 1.0
+ * Outputs some styles in the admin <head> to show icons on the woocommerce admin pages
*/
-function jigoshop_admin_head() {
+function woocommerce_admin_head() {
?>
<style type="text/css">
@@ -99,57 +93,54 @@ function jigoshop_admin_head() {
</style>
<?php
}
-add_action('admin_head', 'jigoshop_admin_head');
+add_action('admin_head', 'woocommerce_admin_head');
/**
* System info
*
* Shows the system info panel which contains version data and debug info
- *
- * @since 1.0
- * @usedby jigoshop_settings()
*/
-function jigoshop_system_info() {
+function woocommerce_system_info() {
?>
- <div class="wrap jigoshop">
- <div class="icon32 icon32-jigoshop-debug" id="icon-jigoshop"><br/></div>
- <h2><?php _e('System Information','jigoshop') ?></h2>
+ <div class="wrap woocommerce">
+ <div class="icon32 icon32-woocommerce-debug" id="icon-woocommerce"><br/></div>
+ <h2><?php _e('System Information', 'woothemes') ?></h2>
<div id="tabs-wrap">
<ul class="tabs">
- <li><a href="#versions"><?php _e('Environment', 'jigoshop'); ?></a></li>
- <li><a href="#debugging"><?php _e('Debugging', 'jigoshop'); ?></a></li>
+ <li><a href="#versions"><?php _e('Environment', 'woothemes'); ?></a></li>
+ <li><a href="#debugging"><?php _e('Debugging', 'woothemes'); ?></a></li>
</ul>
<div id="versions" class="panel">
<table class="widefat fixed" style="width:850px;">
<thead>
<tr>
- <th scope="col" width="200px"><?php _e('Versions','jigoshop')?></th>
+ <th scope="col" width="200px"><?php _e('Versions', 'woothemes')?></th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
- <td class="titledesc"><?php _e('Jigoshop Version','jigoshop')?></td>
- <td class="forminp"><?php echo jigoshop::get_var('version'); ?></td>
+ <td class="titledesc"><?php _e('WooCommerce Version', 'woothemes')?></td>
+ <td class="forminp"><?php echo woocommerce::get_var('version'); ?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('WordPress Version','jigoshop')?></td>
+ <td class="titledesc"><?php _e('WordPress Version', 'woothemes')?></td>
<td class="forminp"><?php if (is_multisite()) echo 'WPMU'; else echo 'WP'; ?> <?php echo bloginfo('version'); ?></td>
</tr>
</tbody>
<thead>
<tr>
- <th scope="col" width="200px"><?php _e('Server','jigoshop')?></th>
+ <th scope="col" width="200px"><?php _e('Server', 'woothemes')?></th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
- <td class="titledesc"><?php _e('PHP Version','jigoshop')?></td>
+ <td class="titledesc"><?php _e('PHP Version', 'woothemes')?></td>
<td class="forminp"><?php if(function_exists('phpversion')) echo phpversion(); ?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('Server Software','jigoshop')?></td>
+ <td class="titledesc"><?php _e('Server Software', 'woothemes')?></td>
<td class="forminp"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
</tr>
</tbody>
@@ -159,38 +150,38 @@ function jigoshop_system_info() {
<table class="widefat fixed" style="width:850px;">
<tbody>
<tr>
- <th scope="col" width="200px"><?php _e('Debug Information','jigoshop')?></th>
+ <th scope="col" width="200px"><?php _e('Debug Information', 'woothemes')?></th>
<th scope="col">&nbsp;</th>
</tr>
<tr>
- <td class="titledesc"><?php _e('UPLOAD_MAX_FILESIZE','jigoshop')?></td>
+ <td class="titledesc"><?php _e('UPLOAD_MAX_FILESIZE', 'woothemes')?></td>
<td class="forminp"><?php
- if(function_exists('phpversion')) echo (jigoshop_let_to_num(ini_get('upload_max_filesize'))/(1024*1024))."MB";
+ if(function_exists('phpversion')) echo (woocommerce_let_to_num(ini_get('upload_max_filesize'))/(1024*1024))."MB";
?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('POST_MAX_SIZE','jigoshop')?></td>
+ <td class="titledesc"><?php _e('POST_MAX_SIZE', 'woothemes')?></td>
<td class="forminp"><?php
- if(function_exists('phpversion')) echo (jigoshop_let_to_num(ini_get('post_max_size'))/(1024*1024))."MB";
+ if(function_exists('phpversion')) echo (woocommerce_let_to_num(ini_get('post_max_size'))/(1024*1024))."MB";
?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('WordPress Memory Limit','jigoshop')?></td>
+ <td class="titledesc"><?php _e('WordPress Memory Limit', 'woothemes')?></td>
<td class="forminp"><?php
- echo (jigoshop_let_to_num(WP_MEMORY_LIMIT)/(1024*1024))."MB";
+ echo (woocommerce_let_to_num(WP_MEMORY_LIMIT)/(1024*1024))."MB";
?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('WP_DEBUG','jigoshop')?></td>
- <td class="forminp"><?php if (WP_DEBUG) echo __('On', 'jigoshop'); else __('Off', 'jigoshop'); ?></td>
+ <td class="titledesc"><?php _e('WP_DEBUG', 'woothemes')?></td>
+ <td class="forminp"><?php if (WP_DEBUG) echo __('On', 'woothemes'); else __('Off', 'woothemes'); ?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('DISPLAY_ERRORS','jigoshop')?></td>
+ <td class="titledesc"><?php _e('DISPLAY_ERRORS', 'woothemes')?></td>
<td class="forminp"><?php if(function_exists('phpversion')) echo ini_get('display_errors'); ?></td>
</tr>
<tr>
- <td class="titledesc"><?php _e('FSOCKOPEN','jigoshop')?></td>
- <td class="forminp"><?php if(function_exists('fsockopen')) echo '<span style="color:green">' . __('Your server supports fsockopen.', 'jigoshop'). '</span>'; else echo '<span style="color:red">' . __('Your server does not support fsockopen.', 'jigoshop'). '</span>'; ?></td>
+ <td class="titledesc"><?php _e('FSOCKOPEN', 'woothemes')?></td>
+ <td class="forminp"><?php if(function_exists('fsockopen')) echo '<span style="color:green">' . __('Your server supports fsockopen.', 'woothemes'). '</span>'; else echo '<span style="color:red">' . __('Your server does not support fsockopen.', 'woothemes'). '</span>'; ?></td>
</tr>
</tbody>
</table>
@@ -215,13 +206,16 @@ function jigoshop_system_info() {
<?php
}
-function jigoshop_feature_product () {
+/**
+ * Feature a product from admin
+ */
+function woocommerce_feature_product() {
if( !is_admin() ) die;
if( !current_user_can('edit_posts') ) wp_die( __('You do not have sufficient permissions to access this page.') );
- if( !check_admin_referer()) wp_die( __('You have taken too long. Please go back and retry.', 'jigoshop') );
+ if( !check_admin_referer()) wp_die( __('You have taken too long. Please go back and retry.', 'woothemes') );
$post_id = isset($_GET['product_id']) && (int)$_GET['product_id'] ? (int)$_GET['product_id'] : '';
@@ -232,7 +226,7 @@ function jigoshop_feature_product () {
if($post->post_type !== 'product') die;
- $product = new jigoshop_product($post->ID);
+ $product = new woocommerce_product($post->ID);
if ($product->is_featured()) update_post_meta($post->ID, 'featured', 'no');
else update_post_meta($post->ID, 'featured', 'yes');
@@ -241,12 +235,12 @@ function jigoshop_feature_product () {
wp_safe_redirect( $sendback );
}
-add_action('wp_ajax_jigoshop-feature-product', 'jigoshop_feature_product');
+add_action('wp_ajax_woocommerce-feature-product', 'woocommerce_feature_product');
/**
* Returns proper post_type
*/
-function jigoshop_get_current_post_type() {
+function woocommerce_get_current_post_type() {
global $post, $typenow, $current_screen;
@@ -267,26 +261,22 @@ function jigoshop_get_current_post_type() {
}
/**
- * Categories ordering
- */
-
-/**
- * Load needed scripts to order categories
+ * Categories ordering scripts
*/
-function jigoshop_categories_scripts () {
+function woocommerce_categories_scripts () {
if( !isset($_GET['taxonomy']) || $_GET['taxonomy'] !== 'product_cat') return;
- wp_register_script('jigoshop-categories-ordering', jigoshop::plugin_url() . '/assets/js/categories-ordering.js', array('jquery-ui-sortable'));
- wp_print_scripts('jigoshop-categories-ordering');
+ wp_register_script('woocommerce-categories-ordering', woocommerce::plugin_url() . '/assets/js/categories-ordering.js', array('jquery-ui-sortable'));
+ wp_print_scripts('woocommerce-categories-ordering');
}
-add_action('admin_footer-edit-tags.php', 'jigoshop_categories_scripts');
+add_action('admin_footer-edit-tags.php', 'woocommerce_categories_scripts');
/**
* Ajax request handling for categories ordering
*/
-function jigoshop_categories_ordering () {
+function woocommerce_categories_ordering() {
global $wpdb;
@@ -295,7 +285,7 @@ function jigoshop_categories_ordering () {
if( ! $id || ! $term = get_term_by('id', $id, 'product_cat') ) die(0);
- jigoshop_order_categories ( $term, $next_id);
+ woocommerce_order_categories( $term, $next_id );
$children = get_terms('product_cat', "child_of=$id&menu_order=ASC&hide_empty=0");
if( $term && sizeof($children) ) {
@@ -304,4 +294,4 @@ function jigoshop_categories_ordering () {
}
}
-add_action('wp_ajax_jigoshop-categories-ordering', 'jigoshop_categories_ordering');
+add_action('wp_ajax_woocommerce-categories-ordering', 'woocommerce_categories_ordering');
171 admin/jigoshop-install.php → admin/admin-install.php
View
@@ -1,74 +1,65 @@
<?php
/**
- * JigoShop Install
+ * WooCommerce Install
*
* Plugin install script which adds default pages, taxonomies, and database tables
*
- * @author Jigowatt
+ * @author WooThemes
* @category Admin
- * @package JigoShop
+ * @package WooCommerce
*/
/**
- * Install jigoshop
+ * Install woocommerce
*
- * Calls each function to install bits, and clears the cron jobs and rewrite rules
- *
- * @since 1.0
+ * Calls each function to install things, and clears the cron jobs and rewrite rules
*/
-function install_jigoshop() {
+function install_woocommerce() {
- // Get options and define post types before we start
- require_once ( 'jigoshop-admin-settings-options.php' );
- jigoshop_post_type();
+ // Define post types before we start
+ woocommerce_post_type();
// Do install
- jigoshop_default_options();
- jigoshop_create_pages();
- jigoshop_tables_install();
-
- jigoshop_post_type();
- jigoshop_default_taxonomies();
+ woocommerce_default_options();
+ woocommerce_create_pages();
+ woocommerce_tables_install();
+ woocommerce_default_taxonomies();
// Clear cron
- wp_clear_scheduled_hook('jigoshop_update_sale_prices_schedule_check');
- update_option('jigoshop_update_sale_prices', 'no');
+ wp_clear_scheduled_hook('woocommerce_update_sale_prices_schedule_check');
+ update_option('woocommerce_update_sale_prices', 'no');
// Flush Rules
global $wp_rewrite;
$wp_rewrite->flush_rules();
// Update version
- update_option( "jigoshop_db_version", JIGOSHOP_VERSION );
+ update_option( "woocommerce_db_version", WOOCOMMERCE_VERSION );
}
/**
* Default options
*
* Sets up the default options used on the settings page
- *
- * @since 1.0
*/
-function jigoshop_default_options() {
+function woocommerce_default_options() {
global $options_settings;
foreach ($options_settings as $value) {
if (isset($value['std'])) add_option($value['id'], $value['std']);
}
- add_option('jigoshop_shop_slug', 'shop');
+ add_option('woocommerce_shop_slug', 'shop');
}
/**
* Create pages
*
* Creates pages that the plugin relies on, storing page id's in variables.
- *
- * @since 1.0
*/
-function jigoshop_create_pages() {
+function woocommerce_create_pages() {
global $wpdb;
- $slug = esc_sql( _x('shop', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('shop', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -78,19 +69,19 @@ function jigoshop_create_pages() {
'post_type' => 'page',
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Shop', 'jigoshop'),
+ 'post_title' => __('Shop', 'woothemes'),
'post_content' => '',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_shop_page_id', $page_id);
+ update_option('woocommerce_shop_page_id', $page_id);
} else {
- update_option('jigoshop_shop_page_id', $page_found);
+ update_option('woocommerce_shop_page_id', $page_found);
}
- $slug = esc_sql( _x('cart', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('cart', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -100,19 +91,19 @@ function jigoshop_create_pages() {
'post_type' => 'page',
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Cart', 'jigoshop'),
- 'post_content' => '[jigoshop_cart]',
+ 'post_title' => __('Cart', 'woothemes'),
+ 'post_content' => '[woocommerce_cart]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_cart_page_id', $page_id);
+ update_option('woocommerce_cart_page_id', $page_id);
} else {
- update_option('jigoshop_cart_page_id', $page_found);
+ update_option('woocommerce_cart_page_id', $page_found);
}
- $slug = esc_sql( _x('checkout', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('checkout', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -122,19 +113,19 @@ function jigoshop_create_pages() {
'post_type' => 'page',
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Checkout', 'jigoshop'),
- 'post_content' => '[jigoshop_checkout]',
+ 'post_title' => __('Checkout', 'woothemes'),
+ 'post_content' => '[woocommerce_checkout]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_checkout_page_id', $page_id);
+ update_option('woocommerce_checkout_page_id', $page_id);
} else {
- update_option('jigoshop_checkout_page_id', $page_found);
+ update_option('woocommerce_checkout_page_id', $page_found);
}
- $slug = esc_sql( _x('order-tracking', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('order-tracking', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -144,14 +135,14 @@ function jigoshop_create_pages() {
'post_type' => 'page',
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Track your order', 'jigoshop'),
- 'post_content' => '[jigoshop_order_tracking]',
+ 'post_title' => __('Track your order', 'woothemes'),
+ 'post_content' => '[woocommerce_order_tracking]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
}
- $slug = esc_sql( _x('my-account', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('my-account', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -161,19 +152,19 @@ function jigoshop_create_pages() {
'post_type' => 'page',
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('My Account', 'jigoshop'),
- 'post_content' => '[jigoshop_my_account]',
+ 'post_title' => __('My Account', 'woothemes'),
+ 'post_content' => '[woocommerce_my_account]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_myaccount_page_id', $page_id);
+ update_option('woocommerce_myaccount_page_id', $page_id);
} else {
- update_option('jigoshop_myaccount_page_id', $page_found);
+ update_option('woocommerce_myaccount_page_id', $page_found);
}
- $slug = esc_sql( _x('edit-address', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('edit-address', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -181,22 +172,22 @@ function jigoshop_create_pages() {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
- 'post_parent' => get_option('jigoshop_myaccount_page_id'),
+ 'post_parent' => get_option('woocommerce_myaccount_page_id'),
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Edit My Address', 'jigoshop'),
- 'post_content' => '[jigoshop_edit_address]',
+ 'post_title' => __('Edit My Address', 'woothemes'),
+ 'post_content' => '[woocommerce_edit_address]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_edit_address_page_id', $page_id);
+ update_option('woocommerce_edit_address_page_id', $page_id);
} else {
- update_option('jigoshop_edit_address_page_id', $page_found);
+ update_option('woocommerce_edit_address_page_id', $page_found);
}
- $slug = esc_sql( _x('view-order', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('view-order', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -204,22 +195,22 @@ function jigoshop_create_pages() {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
- 'post_parent' => get_option('jigoshop_myaccount_page_id'),
+ 'post_parent' => get_option('woocommerce_myaccount_page_id'),
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('View Order', 'jigoshop'),
- 'post_content' => '[jigoshop_view_order]',
+ 'post_title' => __('View Order', 'woothemes'),
+ 'post_content' => '[woocommerce_view_order]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_view_order_page_id', $page_id);
+ update_option('woocommerce_view_order_page_id', $page_id);
} else {
- update_option('jigoshop_view_order_page_id', $page_found);
+ update_option('woocommerce_view_order_page_id', $page_found);
}
- $slug = esc_sql( _x('change-password', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('change-password', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -227,22 +218,22 @@ function jigoshop_create_pages() {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
- 'post_parent' => get_option('jigoshop_myaccount_page_id'),
+ 'post_parent' => get_option('woocommerce_myaccount_page_id'),
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Change Password', 'jigoshop'),
- 'post_content' => '[jigoshop_change_password]',
+ 'post_title' => __('Change Password', 'woothemes'),
+ 'post_content' => '[woocommerce_change_password]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_change_password_page_id', $page_id);
+ update_option('woocommerce_change_password_page_id', $page_id);
} else {
- update_option('jigoshop_change_password_page_id', $page_found);
+ update_option('woocommerce_change_password_page_id', $page_found);
}
- $slug = esc_sql( _x('pay', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('pay', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -250,23 +241,23 @@ function jigoshop_create_pages() {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
- 'post_parent' => get_option('jigoshop_checkout_page_id'),
+ 'post_parent' => get_option('woocommerce_checkout_page_id'),
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Checkout &rarr; Pay', 'jigoshop'),
- 'post_content' => '[jigoshop_pay]',
+ 'post_title' => __('Checkout &rarr; Pay', 'woothemes'),
+ 'post_content' => '[woocommerce_pay]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_pay_page_id', $page_id);
+ update_option('woocommerce_pay_page_id', $page_id);
} else {
- update_option('jigoshop_pay_page_id', $page_found);
+ update_option('woocommerce_pay_page_id', $page_found);
}
// Thank you Page
- $slug = esc_sql( _x('thanks', 'page_slug', 'jigoshop') );
+ $slug = esc_sql( _x('thanks', 'page_slug', 'woothemes') );
$page_found = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = '$slug' LIMIT 1");
if(!$page_found) {
@@ -274,19 +265,19 @@ function jigoshop_create_pages() {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
- 'post_parent' => get_option('jigoshop_checkout_page_id'),
+ 'post_parent' => get_option('woocommerce_checkout_page_id'),
'post_author' => 1,
'post_name' => $slug,
- 'post_title' => __('Thank you', 'jigoshop'),
- 'post_content' => '[jigoshop_thankyou]',
+ 'post_title' => __('Thank you', 'woothemes'),
+ 'post_content' => '[woocommerce_thankyou]',
'comment_status' => 'closed'
);
$page_id = wp_insert_post($page_data);
- update_option('jigoshop_thanks_page_id', $page_id);
+ update_option('woocommerce_thanks_page_id', $page_id);
} else {
- update_option('jigoshop_thanks_page_id', $page_found);
+ update_option('woocommerce_thanks_page_id', $page_found);
}
}
@@ -295,28 +286,24 @@ function jigoshop_create_pages() {
* Table Install
*
* Sets up the database tables which the plugin needs to function.
- *
- * @since 1.0
*/
-function jigoshop_tables_install() {
+function woocommerce_tables_install() {
global $wpdb;
- //$wpdb->show_errors();
-
- $collate = '';
+ $collate = '';
if($wpdb->supports_collation()) {
if(!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset";
if(!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate";
}
- $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "jigoshop_attribute_taxonomies" ." (
+ $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "woocommerce_attribute_taxonomies" ." (
`attribute_id` mediumint(9) NOT NULL AUTO_INCREMENT,
`attribute_name` varchar(200) NOT NULL,
`attribute_type` varchar(200) NOT NULL,
PRIMARY KEY id (`attribute_id`)) $collate;";
$wpdb->query($sql);
- $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "jigoshop_downloadable_product_permissions" ." (
+ $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "woocommerce_downloadable_product_permissions" ." (
`product_id` mediumint(9) NOT NULL,
`user_email` varchar(200) NOT NULL,
`user_id` mediumint(9) NULL,
@@ -325,9 +312,9 @@ function jigoshop_tables_install() {
PRIMARY KEY id (`product_id`, `order_key`)) $collate;";
$wpdb->query($sql);
- $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "jigoshop_termmeta" ." (
+ $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "woocommerce_termmeta" ." (
`meta_id` bigint(20) NOT NULL AUTO_INCREMENT,
- `jigoshop_term_id` bigint(20) NOT NULL,
+ `woocommerce_term_id` bigint(20) NOT NULL,
`meta_key` varchar(255) NULL,
`meta_value` longtext NULL,
PRIMARY KEY id (`meta_id`)) $collate;";
@@ -339,15 +326,13 @@ function jigoshop_tables_install() {
* Default taxonomies
*
* Adds the default terms for taxonomies - product types and order statuses. Modify at your own risk.
- *
- * @since 1.0
*/
-function jigoshop_default_taxonomies() {
+function woocommerce_default_taxonomies() {
$product_types = array(
'simple',
'grouped',
- 'configurable',
+ 'variable',
'downloadable',
'virtual'
);
167 admin/jigoshop-admin-post-types.php → admin/admin-post-types.php
View
@@ -4,31 +4,31 @@
*
* These functions control columns in admin, and other admin interface bits
*
- * @author Jigowatt
+ * @author WooThemes
* @category Admin
- * @package JigoShop
+ * @package WooCommerce
*/
/**
* Custom columns
**/
- function jigoshop_edit_variation_columns($columns){
+ function woocommerce_edit_variation_columns($columns){
$columns = array();
$columns["cb"] = "<input type=\"checkbox\" />";
- $columns["thumb"] = __("Thumb", 'jigoshop');
- $columns["id"] = __("ID", 'jigoshop');
- $columns["title"] = __("Name", 'jigoshop');
- $columns["parent"] = __("Parent Product", 'jigoshop');
+ $columns["thumb"] = __("Thumb", 'woothemes');
+ $columns["id"] = __("ID", 'woothemes');
+ $columns["title"] = __("Name", 'woothemes');
+ $columns["parent"] = __("Parent Product", 'woothemes');
return $columns;
}
-add_filter('manage_edit-product_variation_columns', 'jigoshop_edit_variation_columns');
+add_filter('manage_edit-product_variation_columns', 'woocommerce_edit_variation_columns');
-function jigoshop_custom_variation_columns($column) {
+function woocommerce_custom_variation_columns($column) {
global $post;
- $product = &new jigoshop_product($post->ID);
+ $product = &new woocommerce_product($post->ID);
switch ($column) {
case "thumb" :
@@ -47,36 +47,36 @@ function jigoshop_custom_variation_columns($column) {
break;
}
}
-add_action('manage_product_variation_posts_custom_column', 'jigoshop_custom_variation_columns', 2);
+add_action('manage_product_variation_posts_custom_column', 'woocommerce_custom_variation_columns', 2);
-function jigoshop_edit_product_columns($columns){
+function woocommerce_edit_product_columns($columns){
$columns = array();
$columns["cb"] = "<input type=\"checkbox\" />";
- $columns["thumb"] = __("Thumb", 'jigoshop');
- $columns["title"] = __("Name", 'jigoshop