Getting Notice Undefined index
-
Hi!
I’m having a PHP Notice:
Undefined index: loop in /wp-content/plugins/duracelltomi-google-tag-manager/integration/woocommerce.php
.I don’t really get what’s wrong, it happens when I request featured products in my theme. Here’s the function I use to query the featured products :
function featured_products() { $query = new WP_Query([ 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => 10, 'orderby' => 'date', 'order' => 'desc', 'tax_query' => [[ 'taxonomy' => 'product_visibility', 'field' => 'term_id', 'terms' => 'featured', 'operator' => 'IN', ]] ]); if ($query->have_posts()): while ($query->have_posts()) : $query->the_post(); wc_get_template_part('content', 'product-slider'); endwhile; endif; wp_reset_postdata(); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting Notice Undefined index’ is closed to new replies.