When I click on the link “See your store” on the dashboard of the seller, nothing is displayed. I have an error message telling me that it is not possible to reach the page.
here is my old file related.php:
<?php
/**
* Related Products
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if( !(wpo_theme_options(‘wc_show_related’, false)) ){
if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
global $product, $woocommerce_loop;
$posts_per_page = wpo_theme_options(‘woo-number-product-single’,6);
if ( empty( $product ) || ! $product->exists() ) {
return;
}
$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->id )
) );
$_id = wpo_makeid();
$_count =1;
$products = new WP_Query( $args );
$columns_count = wpo_theme_options(‘product-number-columns’,3);
$class_column = ‘col-md-‘ . floor( 12/$columns_count );
if ( $products->have_posts() ) : ?>
<div class=”widget widget-related-products widget-products products product-single”>
<div class=”background”></div>
<h3 class=”widget-title visual-title”>
<span><span><?php _e( ‘Related Products’, ‘woocommerce’ ); ?></span></span>
</h3>
<div class=”woocommerce”>
<div class=”widget-content <?php echo isset($style) ? esc_attr( $style ): ”; ?>”>
<?php wc_get_template( ‘widget-products/carousel.php’ , array( ‘loop’=>$products,’columns_count’=>$columns_count,’class$
</div>
</div>
</div>
<?php endif;
wp_reset_postdata();
}
I replaced it with this one:
<?php
/**
* Related Products By Same Author
* THIS FILE GOES IN /themes/YOURTHEME/woocommerce/single-product/related.php
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
global $product, $woocommerce_loop;
$artist = get_the_author_meta(‘ID’);
//Get url to put in related products title
$sold_by = WCV_Vendors::is_vendor( $artist )
? sprintf( ‘%s‘, WCV_Vendors::get_vendor_shop_page( $artist ), WCV_Vendors::get_vendor_sold_by( $artist ) )
: get_bloginfo( ‘name’ );
if ( class_exists( ‘WCVendors_Pro’ ) ) {
$store_url = WCVendors_Pro_Vendor_Controller::get_vendor_store_url( get_the_author_id() );
$sold_by = ‘‘.WCV_Vendors::get_vendor_sold_by( $artist ).’‘;
}
$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,
‘author’ => $artist,
‘post__not_in’ => array($product->id)
) );
$products = new WP_Query( $args );
$woocommerce_loop[‘columns’] = $columns;
if ( $products->have_posts() ) : ?>
<div class=”related products”>
<?php echo apply_filters(‘wcvendors_cart_more_work_by’, __( ‘More work by: ‘, ‘wcvendors’ )) . $sold_by . ‘<br/>’; ?>
<?php woocommerce_product_loop_start(); ?>
<?php while ( $products->have_posts() ) : $products->the_post(); ?>
<?php woocommerce_get_template_part( ‘content’, ‘product’ ); ?>
<?php endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
</div>
<?php endif;
wp_reset_postdata();