Version Description
- Released 19 July 2012
- Tweaked archive-product.php and taxonomy.php loop functions to provide compatibility with WooCommerce 1.6.0
Download this release
Release Info
| Developer | studiograsshopper |
| Plugin | |
| Version | 0.9.4 |
| Comparing to | |
| See all releases | |
Code changes from version 0.9.2 to 0.9.4
- genesis-connect-woocommerce.php +2 -2
- lib/breadcrumb.php +3 -0
- lib/template-loader.php +165 -9
- readme.txt +12 -3
- sp-plugins-integration/genesis-simple-menus.php +3 -0
- sp-plugins-integration/genesis-simple-sidebars.php +3 -0
- templates/archive-product.php +19 -34
- templates/single-product.php +1 -3
- templates/taxonomy.php +17 -14
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.
|
| 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.
|
|
@@ -23,7 +23,7 @@ register_activation_hook( __FILE__, 'gencwooc_activation' );
|
|
| 23 |
* - Child theme needs to have add_theme_support( 'genesis-connect-woocommerce' ) in functions.php
|
| 24 |
*
|
| 25 |
* Note: register_activation_hook() isn't run after auto or manual upgrade, only on activation
|
| 26 |
-
* Note: this version of GCW is based on WooCommerce 1.
|
| 27 |
*
|
| 28 |
* @since 0.9.0
|
| 29 |
*/
|
| 2 |
/*
|
| 3 |
Plugin Name: Genesis Connect for WooCommerce
|
| 4 |
Plugin URI: http://www.studiopress.com/plugins/genesis-connect-woocommerce
|
| 5 |
+
Version: 0.9.4
|
| 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.
|
| 23 |
* - Child theme needs to have add_theme_support( 'genesis-connect-woocommerce' ) in functions.php
|
| 24 |
*
|
| 25 |
* Note: register_activation_hook() isn't run after auto or manual upgrade, only on activation
|
| 26 |
+
* Note: this version of GCW is based on WooCommerce 1.6.0
|
| 27 |
*
|
| 28 |
* @since 0.9.0
|
| 29 |
*/
|
lib/breadcrumb.php
CHANGED
|
@@ -2,6 +2,9 @@
|
|
| 2 |
/**
|
| 3 |
* This file contains functions related modifying Genesis Breadcrumb output
|
| 4 |
*
|
|
|
|
|
|
|
|
|
|
| 5 |
* @since 0.9.0
|
| 6 |
*
|
| 7 |
*
|
| 2 |
/**
|
| 3 |
* This file contains functions related modifying Genesis Breadcrumb output
|
| 4 |
*
|
| 5 |
+
* @package genesis_connect_woocommerce
|
| 6 |
+
* @version 0.9.4
|
| 7 |
+
*
|
| 8 |
* @since 0.9.0
|
| 9 |
*
|
| 10 |
*
|
lib/template-loader.php
CHANGED
|
@@ -2,15 +2,17 @@
|
|
| 2 |
/**
|
| 3 |
* These functions manage loading of templates for WooCommerce
|
| 4 |
*
|
| 5 |
-
* @
|
|
|
|
| 6 |
*
|
|
|
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Prevent direct access to this file
|
| 11 |
*/
|
| 12 |
if ( ! defined( 'ABSPATH' ) )
|
| 13 |
-
exit(
|
| 14 |
|
| 15 |
|
| 16 |
|
|
@@ -119,24 +121,178 @@ function gencwooc_template_loader( $template ) {
|
|
| 119 |
*
|
| 120 |
* Based on woocommerce_get_template_part()
|
| 121 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
* @since 0.9.0
|
| 123 |
* @global object $woocommerce WooCommerce instance
|
| 124 |
*/
|
| 125 |
function gencwooc_get_template_part( $slug, $name = '' ) {
|
| 126 |
|
| 127 |
global $woocommerce;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
|
|
|
|
| 130 |
|
| 131 |
-
|
| 132 |
|
| 133 |
-
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
-
|
| 140 |
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
}
|
| 2 |
/**
|
| 3 |
* These functions manage loading of templates for WooCommerce
|
| 4 |
*
|
| 5 |
+
* @package genesis_connect_woocommerce
|
| 6 |
+
* @version 0.9.4
|
| 7 |
*
|
| 8 |
+
* @since 0.9.0
|
| 9 |
*/
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Prevent direct access to this file
|
| 13 |
*/
|
| 14 |
if ( ! defined( 'ABSPATH' ) )
|
| 15 |
+
exit( _( 'Sorry, you are not allowed to access this file directly.' ) );
|
| 16 |
|
| 17 |
|
| 18 |
|
| 121 |
*
|
| 122 |
* Based on woocommerce_get_template_part()
|
| 123 |
*
|
| 124 |
+
* Note: updated v0.9.3 to reflect changes to woocommerce_get_template_part() introduced in
|
| 125 |
+
* WooC v1.4+
|
| 126 |
+
* Effectively, this function is a clone of woocommerce_get_template_part()
|
| 127 |
+
* and is ONLY RETAINED FOR BACKWARDS COMPATIBILITY for pre-0.9.2 custom templates which
|
| 128 |
+
* may use this function.
|
| 129 |
+
*
|
| 130 |
* @since 0.9.0
|
| 131 |
* @global object $woocommerce WooCommerce instance
|
| 132 |
*/
|
| 133 |
function gencwooc_get_template_part( $slug, $name = '' ) {
|
| 134 |
|
| 135 |
global $woocommerce;
|
| 136 |
+
$template = '';
|
| 137 |
+
|
| 138 |
+
// Look in yourtheme/slug-name.php and yourtheme/woocommerce/slug-name.php
|
| 139 |
+
if ( $name )
|
| 140 |
+
$template = locate_template( array ( "{$slug}-{$name}.php", "{$woocommerce->template_url}{$slug}-{$name}.php" ) );
|
| 141 |
+
|
| 142 |
+
// Get default slug-name.php
|
| 143 |
+
if ( !$template && $name && file_exists( $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php" ) )
|
| 144 |
+
$template = $woocommerce->plugin_path() . "/templates/{$slug}-{$name}.php";
|
| 145 |
+
|
| 146 |
+
// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/woocommerce/slug.php
|
| 147 |
+
if ( !$template )
|
| 148 |
+
$template = locate_template( array ( "{$slug}.php", "{$woocommerce->template_url}{$slug}.php" ) );
|
| 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: “%s”', 'woocommerce' ), get_search_query() );
|
| 245 |
+
if ( get_query_var( 'paged' ) )
|
| 246 |
+
printf( __( ' – 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.
|
| 6 |
-
Stable tag: 0.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 |
-
**
|
| 19 |
|
| 20 |
== Installation ==
|
| 21 |
|
|
@@ -138,6 +138,15 @@ For the benefit of theme developers and customizers, here is a summary of possib
|
|
| 138 |
|
| 139 |
== Changelog ==
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
= 0.9.2 =
|
| 142 |
* Released 15 March 2012
|
| 143 |
* single-product.php - Single product title template file now hooked in as per WooC 1.5.2
|
| 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.4
|
| 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 1.6.0+**
|
| 19 |
|
| 20 |
== Installation ==
|
| 21 |
|
| 138 |
|
| 139 |
== Changelog ==
|
| 140 |
|
| 141 |
+
= 0.9.4 =
|
| 142 |
+
* Released 19 July 2012
|
| 143 |
+
* Tweaked archive-product.php and taxonomy.php loop functions to provide compatibility with WooCommerce 1.6.0
|
| 144 |
+
|
| 145 |
+
= 0.9.3 =
|
| 146 |
+
* Released 14 May 2012
|
| 147 |
+
* taxonomy.php and archive-product.php now use woocommerce_get_template_part() instead of gencwooc_get_template_part()
|
| 148 |
+
* 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.
|
| 149 |
+
|
| 150 |
= 0.9.2 =
|
| 151 |
* Released 15 March 2012
|
| 152 |
* single-product.php - Single product title template file now hooked in as per WooC 1.5.2
|
sp-plugins-integration/genesis-simple-menus.php
CHANGED
|
@@ -2,6 +2,9 @@
|
|
| 2 |
/**
|
| 3 |
* Integration - Genesis Simple Menus
|
| 4 |
*
|
|
|
|
|
|
|
|
|
|
| 5 |
* @since 0.9.0
|
| 6 |
*
|
| 7 |
* Genesis Simple Menus (GSM) version 0.1.4
|
| 2 |
/**
|
| 3 |
* Integration - Genesis Simple Menus
|
| 4 |
*
|
| 5 |
+
* @package genesis_connect_woocommerce
|
| 6 |
+
* @version 0.9.4
|
| 7 |
+
*
|
| 8 |
* @since 0.9.0
|
| 9 |
*
|
| 10 |
* Genesis Simple Menus (GSM) version 0.1.4
|
sp-plugins-integration/genesis-simple-sidebars.php
CHANGED
|
@@ -2,6 +2,9 @@
|
|
| 2 |
/**
|
| 3 |
* Integration - Genesis Simple Sidebars
|
| 4 |
*
|
|
|
|
|
|
|
|
|
|
| 5 |
* @since 0.9.0
|
| 6 |
*
|
| 7 |
* Based on Genesis Simple Sidebars (GSS) version 0.9.2
|
| 2 |
/**
|
| 3 |
* Integration - Genesis Simple Sidebars
|
| 4 |
*
|
| 5 |
+
* @package genesis_connect_woocommerce
|
| 6 |
+
* @version 0.9.4
|
| 7 |
+
*
|
| 8 |
* @since 0.9.0
|
| 9 |
*
|
| 10 |
* Based on Genesis Simple Sidebars (GSS) version 0.9.2
|
templates/archive-product.php
CHANGED
|
@@ -2,8 +2,6 @@
|
|
| 2 |
/**
|
| 3 |
* This template displays the archive for Products
|
| 4 |
*
|
| 5 |
-
* Based on WooCommerce 1.5.2
|
| 6 |
-
*
|
| 7 |
* Note for customisers/users: Do not edit this file!
|
| 8 |
* ==================================================
|
| 9 |
* If you want to customise this template, copy this file (keep same name) and place the
|
|
@@ -31,6 +29,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,45 +57,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 |
-
*
|
| 67 |
-
*
|
|
|
|
|
|
|
| 68 |
*
|
| 69 |
-
* @uses
|
|
|
|
| 70 |
*
|
| 71 |
* @since 0.9.0
|
| 72 |
-
* @
|
|
|
|
| 73 |
*/
|
| 74 |
function genesiswooc_archive_product_loop() {
|
| 75 |
|
| 76 |
-
global $
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 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 |
-
gencwooc_get_template_part( 'loop', 'shop' );
|
| 96 |
-
|
| 97 |
-
do_action( 'woocommerce_pagination' );
|
| 98 |
-
|
| 99 |
-
do_action( 'woocommerce_after_main_content' );
|
| 100 |
}
|
| 101 |
|
| 102 |
genesis();
|
| 2 |
/**
|
| 3 |
* This template displays the archive for Products
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
* Note for customisers/users: Do not edit this file!
|
| 6 |
* ==================================================
|
| 7 |
* If you want to customise this template, copy this file (keep same name) and place the
|
| 29 |
|
| 30 |
|
| 31 |
/** Get Shop Page ID */
|
| 32 |
+
// @TODO Retained for backwards compatibility with < 1.6.0 WooC installs
|
| 33 |
global $shop_page_id;
|
| 34 |
$shop_page_id = get_option( 'woocommerce_shop_page_id' );
|
| 35 |
|
| 57 |
|
| 58 |
add_action( 'genesis_before_loop', 'genesiswooc_archive_product_loop' );
|
| 59 |
/**
|
| 60 |
+
* Display shop items (product custom post archive)
|
|
|
|
|
|
|
|
|
|
| 61 |
*
|
| 62 |
+
* This function has been refactored in 0.9.4 to provide compatibility with
|
| 63 |
+
* both WooC 1.6.0 and backwards compatibility with older versions.
|
| 64 |
+
* This is needed thanks to substantial changes to WooC template contents
|
| 65 |
+
* introduced in WooC 1.6.0.
|
| 66 |
*
|
| 67 |
+
* @uses genesiswooc_content_product() if WooC is version 1.6.0+
|
| 68 |
+
* @uses genesiswooc_product_archive() for earlier WooC versions
|
| 69 |
*
|
| 70 |
* @since 0.9.0
|
| 71 |
+
* @updated 0.9.4
|
| 72 |
+
* @global object $woocommerce
|
| 73 |
*/
|
| 74 |
function genesiswooc_archive_product_loop() {
|
| 75 |
|
| 76 |
+
global $woocommerce;
|
| 77 |
+
|
| 78 |
+
$new = version_compare( $woocommerce->version, '1.6.0', '>=' );
|
| 79 |
+
|
| 80 |
+
if ( $new )
|
| 81 |
+
genesiswooc_content_product();
|
| 82 |
+
|
| 83 |
+
else
|
| 84 |
+
genesiswooc_product_archive();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
| 86 |
|
| 87 |
genesis();
|
templates/single-product.php
CHANGED
|
@@ -2,8 +2,6 @@
|
|
| 2 |
/**
|
| 3 |
* This template displays the single Product
|
| 4 |
*
|
| 5 |
-
* Based on WooCommerce 1.5.2
|
| 6 |
-
*
|
| 7 |
* Note for customisers/users: Do not edit this file!
|
| 8 |
* ==================================================
|
| 9 |
* If you want to customise this template, copy this file (keep same name) and place the
|
|
@@ -34,7 +32,7 @@ add_action( 'genesis_loop', 'gencwooc_single_product_loop' );
|
|
| 34 |
*
|
| 35 |
* Uses WooCommerce structure and contains all existing WooCommerce hooks
|
| 36 |
*
|
| 37 |
-
* Code based on WooCommerce 1.
|
| 38 |
* @see woocommerce/woocommerce-template.php
|
| 39 |
*
|
| 40 |
* @since 0.9.0
|
| 2 |
/**
|
| 3 |
* This template displays the single Product
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
* Note for customisers/users: Do not edit this file!
|
| 6 |
* ==================================================
|
| 7 |
* If you want to customise this template, copy this file (keep same name) and place the
|
| 32 |
*
|
| 33 |
* Uses WooCommerce structure and contains all existing WooCommerce hooks
|
| 34 |
*
|
| 35 |
+
* Code based on WooCommerce 1.5.5 woocommerce_single_product_content()
|
| 36 |
* @see woocommerce/woocommerce-template.php
|
| 37 |
*
|
| 38 |
* @since 0.9.0
|
templates/taxonomy.php
CHANGED
|
@@ -2,8 +2,6 @@
|
|
| 2 |
/**
|
| 3 |
* This template displays the Product Category and Tag taxonomy term archives
|
| 4 |
*
|
| 5 |
-
* Based on WooCommerce 1.5.2
|
| 6 |
-
*
|
| 7 |
* Note for customisers/users: Do not edit this file!
|
| 8 |
* ==================================================
|
| 9 |
* If you want to customise this template, copy this file (keep same name) and place the
|
|
@@ -14,6 +12,7 @@
|
|
| 14 |
*
|
| 15 |
*/
|
| 16 |
|
|
|
|
| 17 |
/** Remove default Genesis loop */
|
| 18 |
remove_action( 'genesis_loop', 'genesis_do_loop' );
|
| 19 |
|
|
@@ -32,24 +31,28 @@ add_action( 'genesis_loop', 'genesiswooc_product_taxonomy_loop' );
|
|
| 32 |
/**
|
| 33 |
* Displays shop items for the queried taxonomy term
|
| 34 |
*
|
| 35 |
-
*
|
| 36 |
-
*
|
| 37 |
-
*
|
| 38 |
-
*
|
| 39 |
*
|
| 40 |
-
* @uses
|
|
|
|
| 41 |
*
|
| 42 |
* @since 0.9.0
|
|
|
|
| 43 |
*/
|
| 44 |
function genesiswooc_product_taxonomy_loop() {
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
}
|
| 55 |
|
| 2 |
/**
|
| 3 |
* This template displays the Product Category and Tag taxonomy term archives
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
* Note for customisers/users: Do not edit this file!
|
| 6 |
* ==================================================
|
| 7 |
* If you want to customise this template, copy this file (keep same name) and place the
|
| 12 |
*
|
| 13 |
*/
|
| 14 |
|
| 15 |
+
|
| 16 |
/** Remove default Genesis loop */
|
| 17 |
remove_action( 'genesis_loop', 'genesis_do_loop' );
|
| 18 |
|
| 31 |
/**
|
| 32 |
* Displays shop items for the queried taxonomy term
|
| 33 |
*
|
| 34 |
+
* This function has been refactored in 0.9.4 to provide compatibility with
|
| 35 |
+
* both WooC 1.6.0 and backwards compatibility with older versions.
|
| 36 |
+
* This is needed thanks to substantial changes to WooC template contents
|
| 37 |
+
* introduced in WooC 1.6.0.
|
| 38 |
*
|
| 39 |
+
* @uses genesiswooc_content_product() if WooC is version 1.6.0+
|
| 40 |
+
* @uses genesiswooc_product_taxonomy() for earlier WooC versions
|
| 41 |
*
|
| 42 |
* @since 0.9.0
|
| 43 |
+
* @updated 0.9.4
|
| 44 |
*/
|
| 45 |
function genesiswooc_product_taxonomy_loop() {
|
| 46 |
|
| 47 |
+
global $woocommerce;
|
| 48 |
+
|
| 49 |
+
$new = version_compare( $woocommerce->version, '1.6.0', '>=' );
|
| 50 |
+
|
| 51 |
+
if ( $new )
|
| 52 |
+
genesiswooc_content_product();
|
| 53 |
+
|
| 54 |
+
else
|
| 55 |
+
genesiswooc_product_taxonomy();
|
| 56 |
|
| 57 |
}
|
| 58 |
|
