Home Forums WC Vendors Free Support Related Products by Vendor

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20936
    Abdoulaye Coulibaly
    Participant

    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();

    #20960
    WC Vendors Support
    Participant

    If you’ve replaced code, and now things don’t work, you’ll just have to debug your custom code. We do not have time to debug 11,000 WC Vendors Sites custom code for you. 🙁 Sorry!

    Ben

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.