Home Forums WC Vendors Free Support Related products by vendor code Reply To: Related products by vendor code

#12643
Global
Participant

I did check first … but couldn’t see anything in the file … did manage to change wording to shop more: 🙂

But checked 7 times and can’t see a way to change number of products to display.

I did a find on products and 4 which is the amount currently shown but still couldn’t see a way.

Maybe it was a trick question 🙂 🙂 but must be blind as cant see a way to change even though I could understand Mongolian language better than code 🙂

Thanks for your continued help Ben 🙂

<?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’ );
$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’, __( ‘Shop More: ‘, ‘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();

This website uses cookies to ensure you get the best experience on our website.