diff --git a/templates/loop/price.php b/templates/loop/price.php new file mode 100644 index 00000000000..d0adddcbe9c --- /dev/null +++ b/templates/loop/price.php @@ -0,0 +1,11 @@ + + +get_price_html()) : ?> + + \ No newline at end of file diff --git a/templates/single-product/related.php b/templates/single-product/related.php new file mode 100644 index 00000000000..239b9c95ff4 --- /dev/null +++ b/templates/single-product/related.php @@ -0,0 +1,26 @@ +get_related(); + +if (sizeof($related)==0) return; +?> + \ No newline at end of file diff --git a/woocommerce-template.php b/woocommerce-template.php index b02052ea907..e97d16ba385 100644 --- a/woocommerce-template.php +++ b/woocommerce-template.php @@ -81,10 +81,7 @@ if (!function_exists('woocommerce_template_loop_product_thumbnail')) { } if (!function_exists('woocommerce_template_loop_price')) { function woocommerce_template_loop_price() { - global $product; - $price_html = $product->get_price_html(); - if (!$price_html) return; - ?>is_visible( true ) && $post->post_parent > 0) : wp_safe_redirect(get_permalink($post->post_parent)); exit; endif; if (!$product->is_visible( true )) : wp_safe_redirect(home_url()); exit; endif; } @@ -153,7 +150,6 @@ if (!function_exists('woocommerce_template_single_excerpt')) { woocommerce_get_template('single-product/short-description.php', false); } } - if (!function_exists('woocommerce_template_single_meta')) { function woocommerce_template_single_meta() { woocommerce_get_template('single-product/meta.php', false); @@ -232,7 +228,6 @@ if (!function_exists('woocommerce_variable_add_to_cart')) { ); } } - woocommerce_get_template('single-product/add-to-cart/variable.php', false); } } @@ -327,29 +322,14 @@ if (!function_exists('woocommerce_output_related_products')) { } if (!function_exists('woocommerce_related_products')) { - function woocommerce_related_products( $posts_per_page = 4, $post_columns = 4, $orderby = 'rand' ) { - global $product, $woocommerce_loop; - - // Pass vars to loop - $woocommerce_loop['columns'] = $post_columns; - - $related = $product->get_related(); - if (sizeof($related)>0) : - echo ''; - wp_reset_query(); - endif; + function woocommerce_related_products( $pp = 4, $pc = 4, $ob = 'rand' ) { + global $product, $woocommerce_loop, $posts_per_page, $orderby; + + $woocommerce_loop['columns'] = $pc; + $posts_per_page = $pp; + $orderby = $ob; + woocommerce_get_template('single-product/related.php', false); } }