Genesis Connect for WooCommerce - Version 0.9.5

Version Description

  • Released 14 March 2013
  • add_theme_support( 'woocommerce' ) added to ensure compatibility with WooCommerce 2.0+
Download this release

Release Info

Developer studiograsshopper
Plugin Icon 128x128 Genesis Connect for WooCommerce
Version 0.9.5
Comparing to
See all releases

Code changes from version 0.9.3 to 0.9.5

genesis-connect-woocommerce.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Genesis Connect for WooCommerce
4
  Plugin URI: http://www.studiopress.com/plugins/genesis-connect-woocommerce
5
- Version: 0.9.3
6
  Author: StudioPress
7
  Author URI: http://www.studiopress.com/
8
  Description: Allows you to seamlessly integrate WooCommerce with the Genesis Framework and Genesis child themes.
@@ -89,6 +89,9 @@ function gencwooc_setup() {
89
  /** Load modified Genesis breadcrumb filters and callbacks */
90
  if ( ! current_theme_supports( 'gencwooc-woo-breadcrumbs') )
91
  require_once( GCW_LIB_DIR . '/breadcrumb.php' );
 
 
 
92
 
93
  /** Add Genesis Layout and SEO options to Product edit screen */
94
  add_post_type_support( 'product', array( 'genesis-layouts', 'genesis-seo' ) );
2
  /*
3
  Plugin Name: Genesis Connect for WooCommerce
4
  Plugin URI: http://www.studiopress.com/plugins/genesis-connect-woocommerce
5
+ Version: 0.9.5
6
  Author: StudioPress
7
  Author URI: http://www.studiopress.com/
8
  Description: Allows you to seamlessly integrate WooCommerce with the Genesis Framework and Genesis child themes.
89
  /** Load modified Genesis breadcrumb filters and callbacks */
90
  if ( ! current_theme_supports( 'gencwooc-woo-breadcrumbs') )
91
  require_once( GCW_LIB_DIR . '/breadcrumb.php' );
92
+
93
+ /** Ensure WooCommerce 2.0+ compatibility */
94
+ add_theme_support( 'woocommerce' );
95
 
96
  /** Add Genesis Layout and SEO options to Product edit screen */
97
  add_post_type_support( 'product', array( 'genesis-layouts', 'genesis-seo' ) );
lib/breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * This file contains functions related modifying Genesis Breadcrumb output
4
  *
5
  * @package genesis_connect_woocommerce
6
- * @version 0.9.3
7
  *
8
  * @since 0.9.0
9
  *
@@ -40,7 +40,7 @@
40
  * Prevent direct access to this file
41
  */
42
  if ( ! defined( 'ABSPATH' ) )
43
- exit( __( 'Sorry, you are not allowed to access this file directly.', 'genwooc' ) );
44
 
45
 
46
 
3
  * This file contains functions related modifying Genesis Breadcrumb output
4
  *
5
  * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * @since 0.9.0
9
  *
40
  * Prevent direct access to this file
41
  */
42
  if ( ! defined( 'ABSPATH' ) )
43
+ exit( __( 'Sorry, you are not allowed to access this file directly.' ) );
44
 
45
 
46
 
lib/template-loader.php CHANGED
@@ -3,7 +3,7 @@
3
  * These functions manage loading of templates for WooCommerce
4
  *
5
  * @package genesis_connect_woocommerce
6
- * @version 0.9.3
7
  *
8
  * @since 0.9.0
9
  */
@@ -149,4 +149,150 @@ function gencwooc_template_loader( $template ) {
149
 
150
  if ( $template )
151
  load_template( $template, false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  }
3
  * These functions manage loading of templates for WooCommerce
4
  *
5
  * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * @since 0.9.0
9
  */
149
 
150
  if ( $template )
151
  load_template( $template, false );
152
+ }
153
+
154
+
155
+ /**
156
+ * Display shop items
157
+ * Provided for backwards compatibility with WooCommerce versions
158
+ * pre-1.6.0
159
+ *
160
+ * Uses WooCommerce structure and contains all existing WooCommerce hooks
161
+ * Note that this will also display any content created in the Shop Page itself
162
+ *
163
+ * Code based on WooCommerce 1.5.5 woocommerce_archive_product_content()
164
+ * @see woocommerce/woocommerce-template.php
165
+ *
166
+ *
167
+ * @since 0.9.4
168
+ * @global string|int $shop_page_id The ID of the Shop WP Page
169
+ */
170
+ function genesiswooc_product_archive() {
171
+
172
+ global $shop_page_id;
173
+
174
+ if ( !is_search() ) :
175
+ $shop_page = get_post( $shop_page_id );
176
+ $shop_page_title = apply_filters( 'the_title', ( get_option( 'woocommerce_shop_page_title' ) ) ? get_option( 'woocommerce_shop_page_title' ) : $shop_page->post_title );
177
+ $shop_page_content = $shop_page->post_content;
178
+ else :
179
+ $shop_page_title = __( 'Search Results:', 'woocommerce' ) . ' “' . get_search_query() . '”';
180
+ if ( get_query_var( 'paged' ) ) $shop_page_title .= ' — ' . __( 'Page', 'woocommerce' ) . ' ' . get_query_var( 'paged' );
181
+ $shop_page_content = '';
182
+ endif;
183
+
184
+ do_action( 'woocommerce_before_main_content' );
185
+ ?>
186
+
187
+ <h1 class="page-title"><?php echo $shop_page_title ?></h1>
188
+
189
+ <?php echo apply_filters( 'the_content', $shop_page_content );
190
+
191
+ woocommerce_get_template_part( 'loop', 'shop' );
192
+
193
+ do_action( 'woocommerce_pagination' );
194
+
195
+ do_action( 'woocommerce_after_main_content' );
196
+ }
197
+
198
+
199
+ /**
200
+ * Displays shop items for the queried taxonomy term
201
+ * Provided for backwards compatibility with WooCommerce versions
202
+ * pre-1.6.0
203
+ *
204
+ * Uses WooCommerce structure and contains all existing WooCommerce hooks
205
+ *
206
+ * Code based on WooCommerce 1.5.5 woocommerce_product_taxonomy_content()
207
+ * @see woocommerce/woocommerce-template.php
208
+ *
209
+ *
210
+ * @since 0.9.4
211
+ */
212
+ function genesiswooc_product_taxonomy() {
213
+
214
+ do_action( 'woocommerce_before_main_content' );
215
+
216
+ woocommerce_get_template_part( 'loop', 'shop' );
217
+
218
+ do_action( 'woocommerce_pagination' );
219
+
220
+ do_action( 'woocommerce_after_main_content' );
221
+
222
+ }
223
+
224
+
225
+ /**
226
+ * Displays shop items for archives (taxonomy and main shop page)
227
+ * Only loaded if WooC 1.6.0+ is in use.
228
+ *
229
+ * Uses WooCommerce structure and contains all existing WooCommerce hooks
230
+ *
231
+ * Code based on WooCommerce 1.6.0 templates/archive-product.php
232
+ *
233
+ *
234
+ * @since 0.9.4
235
+ */
236
+ function genesiswooc_content_product() {
237
+
238
+ do_action('woocommerce_before_main_content');
239
+ ?>
240
+
241
+ <h1 class="page-title">
242
+ <?php if ( is_search() ) : ?>
243
+ <?php
244
+ printf( __( 'Search Results: &ldquo;%s&rdquo;', 'woocommerce' ), get_search_query() );
245
+ if ( get_query_var( 'paged' ) )
246
+ printf( __( '&nbsp;&ndash; Page %s', 'woocommerce' ), get_query_var( 'paged' ) );
247
+ ?>
248
+ <?php elseif ( is_tax() ) : ?>
249
+ <?php echo single_term_title( "", false ); ?>
250
+ <?php else : ?>
251
+ <?php
252
+ $shop_page = get_post( woocommerce_get_page_id( 'shop' ) );
253
+
254
+ echo apply_filters( 'the_title', ( $shop_page_title = get_option( 'woocommerce_shop_page_title' ) ) ? $shop_page_title : $shop_page->post_title );
255
+ ?>
256
+ <?php endif; ?>
257
+ </h1>
258
+
259
+ <?php if ( is_tax() && get_query_var( 'paged' ) == 0 ) : ?>
260
+ <?php echo '<div class="term-description">' . wpautop( wptexturize( term_description() ) ) . '</div>'; ?>
261
+ <?php elseif ( ! is_search() && get_query_var( 'paged' ) == 0 && ! empty( $shop_page ) && is_object( $shop_page ) ) : ?>
262
+ <?php echo '<div class="page-description">' . apply_filters( 'the_content', $shop_page->post_content ) . '</div>'; ?>
263
+ <?php endif; ?>
264
+
265
+ <?php if ( have_posts() ) : ?>
266
+
267
+ <?php do_action('woocommerce_before_shop_loop'); ?>
268
+
269
+ <ul class="products">
270
+
271
+ <?php woocommerce_product_subcategories(); ?>
272
+
273
+ <?php while ( have_posts() ) : the_post(); ?>
274
+
275
+ <?php woocommerce_get_template_part( 'content', 'product' ); ?>
276
+
277
+ <?php endwhile; // end of the loop. ?>
278
+
279
+ </ul>
280
+
281
+ <?php do_action('woocommerce_after_shop_loop'); ?>
282
+
283
+ <?php else : ?>
284
+
285
+ <?php if ( ! woocommerce_product_subcategories( array( 'before' => '<ul class="products">', 'after' => '</ul>' ) ) ) : ?>
286
+
287
+ <p><?php _e( 'No products found which match your selection.', 'woocommerce' ); ?></p>
288
+
289
+ <?php endif; ?>
290
+
291
+ <?php endif; ?>
292
+
293
+ <div class="clear"></div>
294
+
295
+ <?php do_action( 'woocommerce_pagination' ); ?>
296
+
297
+ <?php do_action('woocommerce_after_main_content');
298
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: nathanrice, studiopress, studiograsshopper
3
  Tags: genesis, genesiswp, studiopress, woocommerce
4
  Requires at least: 3.3
5
- Tested up to: 3.4.1
6
- Stable tag: 0.9.3
7
 
8
  This plugin allows you to seamlessly integrate WooCommerce with the Genesis Framework and Genesis child themes.
9
 
@@ -15,7 +15,7 @@ To allow easy customization of these templates, and ensure that you do not lose
15
 
16
  Additionally, the plugin makes [Genesis Simple Sidebars](http://wordpress.org/extend/plugins/genesis-simple-sidebars/) and [Genesis Simple Menus](http://wordpress.org/extend/plugins/genesis-simple-menus/) compatible with WooCommerce.
17
 
18
- **Requires WooCommerce 1.5.2+. Not compatible with WooCommerce 1.6.0**
19
 
20
  == Installation ==
21
 
@@ -40,6 +40,9 @@ It's not recommended to customize the plugin's templates because, if you do, you
40
 
41
  Make sure you keep the same file names!
42
 
 
 
 
43
  The plugin's templates provide a great starting point for your own customizations and can be found in the plugin's `templates` folder.
44
 
45
  = I want to use WooCommerce's breadcrumbs, not Genesis breadcrumbs =
@@ -138,10 +141,18 @@ For the benefit of theme developers and customizers, here is a summary of possib
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
 
141
  = 0.9.3 =
142
  * Released 14 May 2012
143
  * taxonomy.php and archive-product.php now use woocommerce_get_template_part() instead of gencwooc_get_template_part()
144
- * gencwooc_get_template_part() updated to reflect latest version of woocommerce_get_template_part(). Note: gencwooc_get_template_part() will be deprecated in a future version and is only retained for backwards compatibility.
145
 
146
  = 0.9.2 =
147
  * Released 15 March 2012
2
  Contributors: nathanrice, studiopress, studiograsshopper
3
  Tags: genesis, genesiswp, studiopress, woocommerce
4
  Requires at least: 3.3
5
+ Tested up to: 3.7
6
+ Stable tag: 0.9.5
7
 
8
  This plugin allows you to seamlessly integrate WooCommerce with the Genesis Framework and Genesis child themes.
9
 
15
 
16
  Additionally, the plugin makes [Genesis Simple Sidebars](http://wordpress.org/extend/plugins/genesis-simple-sidebars/) and [Genesis Simple Menus](http://wordpress.org/extend/plugins/genesis-simple-menus/) compatible with WooCommerce.
17
 
18
+ **This version is compatible with WooCommerce 2.0+**
19
 
20
  == Installation ==
21
 
40
 
41
  Make sure you keep the same file names!
42
 
43
+ **Important**
44
+ While the templates provided with this plugin will be kept up to date with any future changes to WooCommerce, please bear in mind that, if you create your own custom Genesis Connect for WooCommerce templates, it is your responsibility to enure that any code you add to your custom templates is compatible with WooCommerce.
45
+
46
  The plugin's templates provide a great starting point for your own customizations and can be found in the plugin's `templates` folder.
47
 
48
  = I want to use WooCommerce's breadcrumbs, not Genesis breadcrumbs =
141
 
142
  == Changelog ==
143
 
144
+ = 0.9.5 =
145
+ * Released 14 March 2013
146
+ * add_theme_support( 'woocommerce' ) added to ensure compatibility with WooCommerce 2.0+
147
+
148
+ = 0.9.4 =
149
+ * Released 19 July 2012
150
+ * Tweaked archive-product.php and taxonomy.php loop functions to provide compatibility with WooCommerce 1.6.0
151
+
152
  = 0.9.3 =
153
  * Released 14 May 2012
154
  * taxonomy.php and archive-product.php now use woocommerce_get_template_part() instead of gencwooc_get_template_part()
155
+ * gencwooc_get_template_part() updated to reflect latest version of woocommerce_get_template_part(). Note: gencwooc_get_template_part() will be deprecated in a future version and is only retained for backwards compatibility.
156
 
157
  = 0.9.2 =
158
  * Released 15 March 2012
sp-plugins-integration/genesis-simple-menus.php CHANGED
@@ -3,7 +3,8 @@
3
  * Integration - Genesis Simple Menus
4
  *
5
  * @package genesis_connect_woocommerce
6
- * @version 0.9.3
 
7
  *
8
  * @since 0.9.0
9
  *
3
  * Integration - Genesis Simple Menus
4
  *
5
  * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
+
8
  *
9
  * @since 0.9.0
10
  *
sp-plugins-integration/genesis-simple-sidebars.php CHANGED
@@ -3,7 +3,7 @@
3
  * Integration - Genesis Simple Sidebars
4
  *
5
  * @package genesis_connect_woocommerce
6
- * @version 0.9.3
7
  *
8
  * @since 0.9.0
9
  *
3
  * Integration - Genesis Simple Sidebars
4
  *
5
  * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * @since 0.9.0
9
  *
templates/archive-product.php CHANGED
@@ -2,7 +2,8 @@
2
  /**
3
  * This template displays the archive for Products
4
  *
5
- * Based on WooCommerce 1.5.5
 
6
  *
7
  * Note for customisers/users: Do not edit this file!
8
  * ==================================================
@@ -31,6 +32,7 @@ remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wra
31
 
32
 
33
  /** Get Shop Page ID */
 
34
  global $shop_page_id;
35
  $shop_page_id = get_option( 'woocommerce_shop_page_id' );
36
 
@@ -58,46 +60,31 @@ function genesiswooc_archive_layout( $layout ) {
58
 
59
  add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
60
  /**
61
- * Display shop items
62
  *
63
- * Uses WooCommerce structure and contains all existing WooCommerce hooks
64
- * Note that this will also display any content created in the Shop Page itself
 
 
65
  *
66
- * Code based on WooCommerce 1.5.5 woocommerce_archive_product_content()
67
- * @see woocommerce/woocommerce-template.php
68
- *
69
- * @uses woocommerce_get_template_part() since v0.9.3
70
  *
71
  * @since 0.9.0
72
- * @global string|int $shop_page_id The ID of the Shop WP Page
 
73
  */
74
  function genesiswooc_archive_product_loop() {
75
 
76
- global $shop_page_id;
77
-
78
- if ( !is_search() ) :
79
- $shop_page = get_post( $shop_page_id );
80
- $shop_page_title = apply_filters( 'the_title', ( get_option( 'woocommerce_shop_page_title' ) ) ? get_option( 'woocommerce_shop_page_title' ) : $shop_page->post_title );
81
- $shop_page_content = $shop_page->post_content;
82
- else :
83
- $shop_page_title = __( 'Search Results:', 'woocommerce' ) . ' &ldquo;' . get_search_query() . '&rdquo;';
84
- if ( get_query_var( 'paged' ) ) $shop_page_title .= ' &mdash; ' . __( 'Page', 'woocommerce' ) . ' ' . get_query_var( 'paged' );
85
- $shop_page_content = '';
86
- endif;
87
-
88
- do_action( 'woocommerce_before_main_content' );
89
- ?>
90
-
91
- <h1 class="page-title"><?php echo $shop_page_title ?></h1>
92
-
93
- <?php echo apply_filters( 'the_content', $shop_page_content );
94
-
95
- // Revert to WooC's function for template parts since 0.9.3
96
- woocommerce_get_template_part( 'loop', 'shop' );
97
-
98
- do_action( 'woocommerce_pagination' );
99
-
100
- do_action( 'woocommerce_after_main_content' );
101
  }
102
 
103
  genesis();
2
  /**
3
  * This template displays the archive for Products
4
  *
5
+ * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * Note for customisers/users: Do not edit this file!
9
  * ==================================================
32
 
33
 
34
  /** Get Shop Page ID */
35
+ // @TODO Retained for backwards compatibility with < 1.6.0 WooC installs
36
  global $shop_page_id;
37
  $shop_page_id = get_option( 'woocommerce_shop_page_id' );
38
 
60
 
61
  add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
62
  /**
63
+ * Display shop items (product custom post archive)
64
  *
65
+ * This function has been refactored in 0.9.4 to provide compatibility with
66
+ * both WooC 1.6.0 and backwards compatibility with older versions.
67
+ * This is needed thanks to substantial changes to WooC template contents
68
+ * introduced in WooC 1.6.0.
69
  *
70
+ * @uses genesiswooc_content_product() if WooC is version 1.6.0+
71
+ * @uses genesiswooc_product_archive() for earlier WooC versions
 
 
72
  *
73
  * @since 0.9.0
74
+ * @updated 0.9.4
75
+ * @global object $woocommerce
76
  */
77
  function genesiswooc_archive_product_loop() {
78
 
79
+ global $woocommerce;
80
+
81
+ $new = version_compare( $woocommerce->version, '1.6.0', '>=' );
82
+
83
+ if ( $new )
84
+ genesiswooc_content_product();
85
+
86
+ else
87
+ genesiswooc_product_archive();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
 
90
  genesis();
templates/single-product.php CHANGED
@@ -2,7 +2,8 @@
2
  /**
3
  * This template displays the single Product
4
  *
5
- * Based on WooCommerce 1.5.5
 
6
  *
7
  * Note for customisers/users: Do not edit this file!
8
  * ==================================================
2
  /**
3
  * This template displays the single Product
4
  *
5
+ * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * Note for customisers/users: Do not edit this file!
9
  * ==================================================
templates/taxonomy.php CHANGED
@@ -2,7 +2,8 @@
2
  /**
3
  * This template displays the Product Category and Tag taxonomy term archives
4
  *
5
- * Based on WooCommerce 1.5.5
 
6
  *
7
  * Note for customisers/users: Do not edit this file!
8
  * ==================================================
@@ -14,6 +15,7 @@
14
  *
15
  */
16
 
 
17
  /** Remove default Genesis loop */
18
  remove_action( 'genesis_loop', 'genesis_do_loop' );
19
 
@@ -32,25 +34,28 @@ add_action( 'genesis_loop', 'genesiswooc_product_taxonomy_loop' );
32
  /**
33
  * Displays shop items for the queried taxonomy term
34
  *
35
- * Uses WooCommerce structure and contains all existing WooCommerce hooks
36
- *
37
- * Code based on WooCommerce 1.5.5 woocommerce_product_taxonomy_content()
38
- * @see woocommerce/woocommerce-template.php
39
  *
40
- * @uses woocommerce_get_template_part() since v0.9.3
 
41
  *
42
  * @since 0.9.0
 
43
  */
44
  function genesiswooc_product_taxonomy_loop() {
45
 
46
- do_action( 'woocommerce_before_main_content' );
47
-
48
- // Revert to WooC's function for template parts since 0.9.3
49
- woocommerce_get_template_part( 'loop', 'shop' );
50
-
51
- do_action( 'woocommerce_pagination' );
52
-
53
- do_action( 'woocommerce_after_main_content' );
 
54
 
55
  }
56
 
2
  /**
3
  * This template displays the Product Category and Tag taxonomy term archives
4
  *
5
+ * @package genesis_connect_woocommerce
6
+ * @version 0.9.5
7
  *
8
  * Note for customisers/users: Do not edit this file!
9
  * ==================================================
15
  *
16
  */
17
 
18
+
19
  /** Remove default Genesis loop */
20
  remove_action( 'genesis_loop', 'genesis_do_loop' );
21
 
34
  /**
35
  * Displays shop items for the queried taxonomy term
36
  *
37
+ * This function has been refactored in 0.9.4 to provide compatibility with
38
+ * both WooC 1.6.0 and backwards compatibility with older versions.
39
+ * This is needed thanks to substantial changes to WooC template contents
40
+ * introduced in WooC 1.6.0.
41
  *
42
+ * @uses genesiswooc_content_product() if WooC is version 1.6.0+
43
+ * @uses genesiswooc_product_taxonomy() for earlier WooC versions
44
  *
45
  * @since 0.9.0
46
+ * @updated 0.9.4
47
  */
48
  function genesiswooc_product_taxonomy_loop() {
49
 
50
+ global $woocommerce;
51
+
52
+ $new = version_compare( $woocommerce->version, '1.6.0', '>=' );
53
+
54
+ if ( $new )
55
+ genesiswooc_content_product();
56
+
57
+ else
58
+ genesiswooc_product_taxonomy();
59
 
60
  }
61