Genesis Connect for WooCommerce - Version 0.9.10

Version Description

  • Update theme templates for WooCommerce 3.3
  • Add Featured Products Widget
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Connect for WooCommerce
Version 0.9.10
Comparing to
See all releases

Code changes from version 0.9.9 to 0.9.10

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.9
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.
2
  /*
3
  Plugin Name: Genesis Connect for WooCommerce
4
  Plugin URI: http://www.studiopress.com/plugins/genesis-connect-woocommerce
5
+ Version: 0.9.10
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.
lib/breadcrumb.php CHANGED
@@ -65,9 +65,9 @@ add_filter( 'genesis_archive_crumb', 'gencwooc_get_archive_crumb_filter', 10, 2
65
  function gencwooc_get_archive_crumb_filter( $crumb, $args ) {
66
 
67
  /** Are we on the product archive page? */
68
- if ( is_post_type_archive( 'product') && get_option( 'page_on_front' ) !== woocommerce_get_page_id( 'shop' ) ) {
69
 
70
- $shop_id = woocommerce_get_page_id( 'shop' );
71
 
72
  $shop_name = $shop_id ? get_the_title( $shop_id ) : ucwords( get_option('woocommerce_shop_slug') );
73
 
@@ -95,7 +95,7 @@ function gencwooc_get_archive_crumb_filter( $crumb, $args ) {
95
  /** Should we prepend crumb with 'shop' page link? */
96
  /** See Dashboard > WooC Settings > Pages tab */
97
  $shop_url = get_option( 'woocommerce_prepend_shop_page_to_urls' );
98
- $shop_id = woocommerce_get_page_id( 'shop' );
99
  $shop_title = get_the_title( $shop_id );
100
 
101
  if ( 'yes' == $shop_url && $shop_id && get_option( 'page_on_front' ) !== $shop_id )
@@ -167,7 +167,7 @@ function gencwooc_get_single_crumb( $crumb, $args ) {
167
  /** Should we prepend crumb with 'shop' page link? */
168
  /** See Dashboard > WooC Settings > Pages tab */
169
  $shop_url = get_option( 'woocommerce_prepend_shop_page_to_urls' );
170
- $shop_id = woocommerce_get_page_id( 'shop' );
171
  $shop_title = get_the_title( $shop_id );
172
 
173
  if ( 'yes' == $shop_url && $shop_id && get_option( 'page_on_front' ) !== $shop_id )
@@ -227,4 +227,4 @@ function gencwooc_get_crumb_link( $url, $title, $content, $sep = false ) {
227
 
228
  return $link;
229
 
230
- }
65
  function gencwooc_get_archive_crumb_filter( $crumb, $args ) {
66
 
67
  /** Are we on the product archive page? */
68
+ if ( is_post_type_archive( 'product') && get_option( 'page_on_front' ) !== wc_get_page_id( 'shop' ) ) {
69
 
70
+ $shop_id = wc_get_page_id( 'shop' );
71
 
72
  $shop_name = $shop_id ? get_the_title( $shop_id ) : ucwords( get_option('woocommerce_shop_slug') );
73
 
95
  /** Should we prepend crumb with 'shop' page link? */
96
  /** See Dashboard > WooC Settings > Pages tab */
97
  $shop_url = get_option( 'woocommerce_prepend_shop_page_to_urls' );
98
+ $shop_id = wc_get_page_id( 'shop' );
99
  $shop_title = get_the_title( $shop_id );
100
 
101
  if ( 'yes' == $shop_url && $shop_id && get_option( 'page_on_front' ) !== $shop_id )
167
  /** Should we prepend crumb with 'shop' page link? */
168
  /** See Dashboard > WooC Settings > Pages tab */
169
  $shop_url = get_option( 'woocommerce_prepend_shop_page_to_urls' );
170
+ $shop_id = wc_get_page_id( 'shop' );
171
  $shop_title = get_the_title( $shop_id );
172
 
173
  if ( 'yes' == $shop_url && $shop_id && get_option( 'page_on_front' ) !== $shop_id )
227
 
228
  return $link;
229
 
230
+ }
lib/template-loader.php CHANGED
@@ -135,27 +135,27 @@ function gencwooc_template_loader( $template ) {
135
 
136
  global $woocommerce;
137
  $template = '';
138
-
139
  // Look in yourtheme/slug-name.php and yourtheme/woocommerce/slug-name.php
140
- if ( $name )
141
  $template = locate_template( array ( "{$slug}-{$name}.php", "{$woocommerce->template_url}{$slug}-{$name}.php" ) );
142
-
143
  // Get default slug-name.php
144
  if ( !$template && $name && file_exists( $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php" ) )
145
  $template = $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php";
146
 
147
  // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/woocommerce/slug.php
148
- if ( !$template )
149
  $template = locate_template( array ( "{$slug}.php", "{$woocommerce->template_url}{$slug}.php" ) );
150
 
151
- if ( $template )
152
  load_template( $template, false );
153
  }
154
 
155
 
156
  /**
157
  * Display shop items
158
- *
159
  * FOR BACKWARDS COMPATIBILITY with WooCommerce versions pre-1.6.0
160
  *
161
  * Uses WooCommerce structure and contains all existing WooCommerce hooks
@@ -238,73 +238,65 @@ function genesiswooc_product_taxonomy() {
238
  * @updated 0.9.8
239
  */
240
  function genesiswooc_content_product() {
241
- ?>
242
- <?php
243
- /**
244
- * woocommerce_before_main_content hook
245
- *
246
- * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
247
- * @hooked woocommerce_breadcrumb - 20
248
- */
249
- do_action( 'woocommerce_before_main_content' );
250
- ?>
251
 
252
- <?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?>
 
 
 
 
 
 
253
 
254
- <h1 class="page-title"><?php woocommerce_page_title(); ?></h1>
 
 
 
 
255
 
256
- <?php endif; ?>
257
-
258
- <?php do_action( 'woocommerce_archive_description' ); ?>
259
-
260
- <?php if ( have_posts() ) : ?>
261
 
262
- <?php
263
- /**
264
- * woocommerce_before_shop_loop hook
265
- *
266
- * @hooked woocommerce_result_count - 20
267
- * @hooked woocommerce_catalog_ordering - 30
268
- */
269
- do_action( 'woocommerce_before_shop_loop' );
270
- ?>
271
-
272
- <?php woocommerce_product_loop_start(); ?>
273
-
274
- <?php woocommerce_product_subcategories(); ?>
275
-
276
-
277
- <?php while ( have_posts() ) : the_post(); ?>
278
-
279
- <?php wc_get_template_part( 'content', 'product' ); ?>
280
-
281
- <?php endwhile; // end of the loop. ?>
282
-
283
- <?php woocommerce_product_loop_end(); ?>
284
-
285
- <?php
286
  /**
287
- * woocommerce_after_shop_loop hook
288
  *
289
- * @hooked woocommerce_pagination - 10
290
  */
291
- do_action( 'woocommerce_after_shop_loop' );
292
- ?>
293
-
294
- <?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
295
-
296
- <?php wc_get_template( 'loop/no-products-found.php' ); ?>
297
-
298
- <?php endif; ?>
299
-
300
- <?php
 
 
301
  /**
302
- * woocommerce_after_main_content hook
303
  *
304
- * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
305
  */
306
- do_action( 'woocommerce_after_main_content' );
307
- ?>
 
 
 
 
 
 
308
 
309
- <?php
310
- }
135
 
136
  global $woocommerce;
137
  $template = '';
138
+
139
  // Look in yourtheme/slug-name.php and yourtheme/woocommerce/slug-name.php
140
+ if ( $name )
141
  $template = locate_template( array ( "{$slug}-{$name}.php", "{$woocommerce->template_url}{$slug}-{$name}.php" ) );
142
+
143
  // Get default slug-name.php
144
  if ( !$template && $name && file_exists( $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php" ) )
145
  $template = $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php";
146
 
147
  // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/woocommerce/slug.php
148
+ if ( !$template )
149
  $template = locate_template( array ( "{$slug}.php", "{$woocommerce->template_url}{$slug}.php" ) );
150
 
151
+ if ( $template )
152
  load_template( $template, false );
153
  }
154
 
155
 
156
  /**
157
  * Display shop items
158
+ *
159
  * FOR BACKWARDS COMPATIBILITY with WooCommerce versions pre-1.6.0
160
  *
161
  * Uses WooCommerce structure and contains all existing WooCommerce hooks
238
  * @updated 0.9.8
239
  */
240
  function genesiswooc_content_product() {
 
 
 
 
 
 
 
 
 
 
241
 
242
+ /**
243
+ * woocommerce_before_main_content hook
244
+ *
245
+ * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
246
+ * @hooked woocommerce_breadcrumb - 20
247
+ */
248
+ do_action( 'woocommerce_before_main_content' );
249
 
250
+ if ( apply_filters( 'woocommerce_show_page_title', true ) ) {
251
+ echo '<h1 class="woocommerce-products-header__title page-title">';
252
+ woocommerce_page_title();
253
+ echo '</h1>';
254
+ }
255
 
256
+ do_action( 'woocommerce_archive_description' );
 
 
 
 
257
 
258
+ if ( have_posts() ) {
259
+ /**
260
+ * Hook: woocommerce_before_shop_loop.
261
+ *
262
+ * @hooked wc_print_notices - 10
263
+ * @hooked woocommerce_result_count - 20
264
+ * @hooked woocommerce_catalog_ordering - 30
265
+ */
266
+ do_action( 'woocommerce_before_shop_loop' );
267
+ woocommerce_product_loop_start();
268
+ if ( wc_get_loop_prop( 'total' ) ) {
269
+ while ( have_posts() ) {
270
+ the_post();
 
 
 
 
 
 
 
 
 
 
 
271
  /**
272
+ * Hook: woocommerce_shop_loop.
273
  *
274
+ * @hooked WC_Structured_Data::generate_product_data() - 10
275
  */
276
+ do_action( 'woocommerce_shop_loop' );
277
+ wc_get_template_part( 'content', 'product' );
278
+ }
279
+ }
280
+ woocommerce_product_loop_end();
281
+ /**
282
+ * Hook: woocommerce_after_shop_loop.
283
+ *
284
+ * @hooked woocommerce_pagination - 10
285
+ */
286
+ do_action( 'woocommerce_after_shop_loop' );
287
+ } else {
288
  /**
289
+ * Hook: woocommerce_no_products_found.
290
  *
291
+ * @hooked wc_no_products_found - 10
292
  */
293
+ do_action( 'woocommerce_no_products_found' );
294
+ }
295
+ /**
296
+ * Hook: woocommerce_after_main_content.
297
+ *
298
+ * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
299
+ */
300
+ do_action( 'woocommerce_after_main_content' );
301
 
302
+ }
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: nathanrice, studiopress, studiograsshopper
3
  Tags: genesis, genesiswp, studiopress, woocommerce
4
  Requires at least: 3.3
5
  Tested up to: 4.7
6
- Stable tag: 0.9.9
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
- **This version is compatible with WooCommerce 2.1+**
19
 
20
  == Installation ==
21
 
@@ -135,6 +135,10 @@ For the benefit of theme developers and customizers, here is a summary of possib
135
 
136
  == Changelog ==
137
 
 
 
 
 
138
  = 0.9.9 =
139
  * Released 12 January 2017
140
  * Adds the Genesis Connect Addons tab to the WooCommerce settings page.
3
  Tags: genesis, genesiswp, studiopress, woocommerce
4
  Requires at least: 3.3
5
  Tested up to: 4.7
6
+ Stable tag: 0.9.10
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 3.0+**
19
 
20
  == Installation ==
21
 
135
 
136
  == Changelog ==
137
 
138
+ = 0.9.10 =
139
+ * Update theme templates for WooCommerce 3.3
140
+ * Add Featured Products Widget
141
+
142
  = 0.9.9 =
143
  * Released 12 January 2017
144
  * Adds the Genesis Connect Addons tab to the WooCommerce settings page.
sp-plugins-integration/genesis-simple-menus.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package genesis_connect_woocommerce
6
  * @version 0.9.8
7
-
8
  *
9
  * @since 0.9.0
10
  *
@@ -61,11 +61,11 @@ function gencwooc_gsm_theme_mod( $mods ) {
61
  /** Post meta key as per GSM 0.1.4 */
62
  $field_name = '_gsm_menu';
63
 
64
- $shop_id = woocommerce_get_page_id( 'shop' );
65
 
66
  if ( is_post_type_archive( 'product' ) && $_menu = get_post_meta( $shop_id, $field_name, true ) )
67
  $mods['secondary'] = (int) $_menu;
68
 
69
  return $mods;
70
 
71
- }
4
  *
5
  * @package genesis_connect_woocommerce
6
  * @version 0.9.8
7
+
8
  *
9
  * @since 0.9.0
10
  *
61
  /** Post meta key as per GSM 0.1.4 */
62
  $field_name = '_gsm_menu';
63
 
64
+ $shop_id = function_exists( 'wc_get_page_id' ) ? wc_get_page_id( 'shop' ) : woocommerce_get_page_id( 'shop' );
65
 
66
  if ( is_post_type_archive( 'product' ) && $_menu = get_post_meta( $shop_id, $field_name, true ) )
67
  $mods['secondary'] = (int) $_menu;
68
 
69
  return $mods;
70
 
71
+ }
sp-plugins-integration/genesis-simple-sidebars.php CHANGED
@@ -87,7 +87,7 @@ function gencwooc_ss_handler() {
87
  function gencwooc_ss_do_sidebar() {
88
 
89
  $bar = '_ss_sidebar';
90
- $shop_id = woocommerce_get_page_id( 'shop' );
91
 
92
  if ( is_post_type_archive( 'product' ) && $_bar = get_post_meta( $shop_id, $bar, true ) ) {
93
 
@@ -124,7 +124,7 @@ function gencwooc_ss_do_sidebar() {
124
  function gencwooc_ss_do_sidebar_alt() {
125
 
126
  $bar = '_ss_sidebar_alt';
127
- $shop_id = woocommerce_get_page_id( 'shop' );
128
 
129
  if ( is_post_type_archive( 'product' ) && $_bar = get_post_meta( $shop_id, $bar, true ) ) {
130
  dynamic_sidebar( $_bar );
@@ -136,4 +136,4 @@ function gencwooc_ss_do_sidebar_alt() {
136
  genesis_do_sidebar_alt();
137
 
138
  }
139
- }
87
  function gencwooc_ss_do_sidebar() {
88
 
89
  $bar = '_ss_sidebar';
90
+ $shop_id = function_exists( 'wc_get_page_id' ) ? wc_get_page_id( 'shop' ) : woocommerce_get_page_id( 'shop' );
91
 
92
  if ( is_post_type_archive( 'product' ) && $_bar = get_post_meta( $shop_id, $bar, true ) ) {
93
 
124
  function gencwooc_ss_do_sidebar_alt() {
125
 
126
  $bar = '_ss_sidebar_alt';
127
+ $shop_id = function_exists( 'wc_get_page_id' ) ? wc_get_page_id( 'shop' ) : woocommerce_get_page_id( 'shop' );
128
 
129
  if ( is_post_type_archive( 'product' ) && $_bar = get_post_meta( $shop_id, $bar, true ) ) {
130
  dynamic_sidebar( $_bar );
136
  genesis_do_sidebar_alt();
137
 
138
  }
139
+ }
templates/archive-product.php CHANGED
@@ -20,6 +20,9 @@
20
  /** Remove default Genesis loop */
21
  remove_action( 'genesis_loop', 'genesis_do_loop' );
22
 
 
 
 
23
  /** Remove WooCommerce breadcrumbs */
24
  remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
25
 
@@ -56,6 +59,7 @@ function genesiswooc_archive_layout( $layout ) {
56
  $layout = get_post_meta( $shop_page_id, '_genesis_layout', true );
57
 
58
  return $layout;
 
59
  }
60
 
61
  add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
@@ -77,14 +81,14 @@ add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
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();
20
  /** Remove default Genesis loop */
21
  remove_action( 'genesis_loop', 'genesis_do_loop' );
22
 
23
+ /** Remove Genesis archive title/description */
24
+ remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
25
+
26
  /** Remove WooCommerce breadcrumbs */
27
  remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
28
 
59
  $layout = get_post_meta( $shop_page_id, '_genesis_layout', true );
60
 
61
  return $layout;
62
+
63
  }
64
 
65
  add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
81
  function genesiswooc_archive_product_loop() {
82
 
83
  global $woocommerce;
84
+
85
  $new = version_compare( $woocommerce->version, '1.6.0', '>=' );
86
+
87
  if ( $new )
88
  genesiswooc_content_product();
89
+
90
  else
91
  genesiswooc_product_archive();
92
  }
93
 
94
+ genesis();
templates/taxonomy.php CHANGED
@@ -19,6 +19,9 @@
19
  /** Remove default Genesis loop */
20
  remove_action( 'genesis_loop', 'genesis_do_loop' );
21
 
 
 
 
22
  /** Remove WooCommerce breadcrumbs */
23
  remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
24
 
@@ -48,15 +51,15 @@ add_action( 'genesis_loop', 'genesiswooc_product_taxonomy_loop' );
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
 
62
- genesis();
19
  /** Remove default Genesis loop */
20
  remove_action( 'genesis_loop', 'genesis_do_loop' );
21
 
22
+ /** Remove Genesis archive title/description */
23
+ remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
24
+
25
  /** Remove WooCommerce breadcrumbs */
26
  remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
27
 
51
  function genesiswooc_product_taxonomy_loop() {
52
 
53
  global $woocommerce;
54
+
55
  $new = version_compare( $woocommerce->version, '1.6.0', '>=' );
56
+
57
  if ( $new )
58
  genesiswooc_content_product();
59
+
60
  else
61
  genesiswooc_product_taxonomy();
62
 
63
  }
64
 
65
+ genesis();