Check we're viewing a product Closes #2227

This commit is contained in:
Mike Jolley 2013-01-14 17:17:57 +00:00
parent 0d6e510b8d
commit 2cb5b73eb7
1 changed files with 3 additions and 0 deletions

View File

@ -1296,6 +1296,9 @@ function woocommerce_get_order_id_by_order_key( $order_key ) {
* @return void * @return void
*/ */
function woocommerce_track_product_view() { function woocommerce_track_product_view() {
if ( ! is_singular( 'product' ) )
return;
global $post, $product; global $post, $product;
if ( empty( $_COOKIE['woocommerce_recently_viewed'] ) ) if ( empty( $_COOKIE['woocommerce_recently_viewed'] ) )