From db5420f146e2be50c55b3b5842d6a7e2cbe083bd Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 24 Aug 2017 12:30:57 -0400 Subject: [PATCH] Adding the base woocommerce template --- woocommerce.php | 235 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 woocommerce.php diff --git a/woocommerce.php b/woocommerce.php new file mode 100644 index 0000000..5d66d88 --- /dev/null +++ b/woocommerce.php @@ -0,0 +1,235 @@ + + + +
+ +
+
+ + + + +
+ + + + name; ?> + + + + + + + + + + + + + +
+ +
+ name; + + // Try to get the Primary Category based on how Yoast SEO has set it in the postmeta table + global $wpdb; + $sqlGetPrimary = "SELECT meta_value + FROM $wpdb->postmeta + WHERE + (meta_key = '_yoast_wpseo_primary_product_cat' AND post_id = %d); + "; + $primaryCatID = $wpdb->get_var( + $wpdb->prepare( + $sqlGetPrimary, + get_the_id() + ) + ); + $term = get_term_by( 'id', $primaryCatID, 'product_cat' ); + + // Use the primary category instead if it's valid + if( $term->name ) { + $primaryCatName = $term->name; + } + ?> + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?> + + + + + + +
+ +
+ + + + + + + + + + +
+ +
+
+
+ +
+ + -- 2.17.1