exists() ) { return; } $ascend = ascend_get_options(); if(!empty($ascend['related_item_column'])) { $product_related_column = $ascend['related_item_column']; } else { $product_related_column = '4'; } $woocommerce_loop['columns'] = $product_related_column; $rpc = array(); if ($product_related_column == '2') { $rpc = ascend_carousel_columns('2'); } else if ($product_related_column == '3'){ $rpc = ascend_carousel_columns('3'); } else if ($product_related_column == '6'){ $rpc = ascend_carousel_columns('6'); } else if ($product_related_column == '5'){ $rpc = ascend_carousel_columns('5'); } else { $rpc = ascend_carousel_columns('4'); } $rpc = apply_filters('ascend_related_products_columns', $rpc); if ( version_compare( WC_VERSION, '3.0', '>' ) ) { $related = wc_get_related_products($product->get_id(), $posts_per_page); } else { $related = $product->get_related($posts_per_page); } if ( sizeof( $related ) == 0 ) return; $args = apply_filters('woocommerce_related_products_args', array( 'post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => $posts_per_page, 'orderby' => $orderby, 'post__in' => $related, 'post__not_in' => array($product->get_id()) ) ); if(!empty($ascend['related_products_text'])) { $relatedtext = $ascend['related_products_text']; } else { $relatedtext = __( 'Related Products', 'ascend'); } $products = new WP_Query( $args ); if ( $products->have_posts() ) : ?>