Check we're viewing a product Closes #2227
This commit is contained in:
parent
0d6e510b8d
commit
2cb5b73eb7
|
@ -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'] ) )
|
||||||
|
|
Loading…
Reference in New Issue