Support » Plugin: WooCommerce » Related Products

Viewing 5 replies - 1 through 5 (of 5 total)
  • I think this code need to add to functions.php would help you:

    [ Moderator note: please wrap code in backticks or use the code button. ]

    /**
    * WooCommerce Extra Feature
    * --------------------------
    *
    * Change number of related products on product page
    * Set your own value for 'posts_per_page'
    *
    */
    function woo_related_products_limit() {
    global $product;
    $args = array(
    'post_type' => 'product',
    'no_found_rows' => 1,
    'posts_per_page' => 6,
    'ignore_sticky_posts' => 1,
    'orderby' => $orderby,
    'post__in' => $related,
    'post__not_in' => array($product->id)
    );
    return $args;
    }
    add_filter( 'woocommerce_related_products_args', 'woo_related_products_limit' );
    Thread Starter waystudio

    (@waystudio)

    I added this to the top of woocommerce/woocommerce-functions.php
    Now the site loads blank pages.

    <?php
    /**
     * WooCommerce Functions
     *
     * Hooked-in functions for WooCommerce related events on the front-end.
     *
     * @author 		WooThemes
     * @category 	Core
     * @package 	WooCommerce/Functions
     * @version     1.6.4
     */
    
    /**
     * Handle IPN requests for the legacy paypal gateway by calling gateways manually if needed.
     *
     * @access public
     * @return void
     */
    * Change number of related products on product page
    * Set your own value for 'posts_per_page'
    *
    */
    function woo_related_products_limit(12) {
    global $product;
    $args = array(
    'post_type' => 'product',
    'no_found_rows' => 2,
    'posts_per_page' => 12,
    'ignore_sticky_posts' => 1,
    'orderby' => $orderby,
    'post__in' => $related,
    'post__not_in' => array($product->id)
    );
    return $args;
    }
    add_filter( 'woocommerce_related_products_args', 'woo_related_products_limit' );
    function woocommerce_legacy_paypal_ipn() {

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thread Starter waystudio

    (@waystudio)

    WordPress 3.6.1
    eStore 4.6 by Elegant Themes
    WooCommerce 2.o.14
    All plugins are up-to date!

    http://bizzydogbeds.com/newtest/product/small-beds/

    I’m having a hard time with getting a short code working. I’m trying to list all of a category to list when your on a product. The link above is an example. I’m trying to list all of the small dog beds so my customers can see what I have.

    Any ideas on what I’m doing wrong?

    Thread Starter waystudio

    (@waystudio)

    Ok I got “Related Products” to list a few more items but now I have 2 “Related Products” on http://bizzydogbeds.com/newtest/product/large-sunset-red-waves/
    but the code is showing. For the large beds I only have a total of 9 and need all 9 to show but only under one “Related Products”. Code for this

    [product_category category=”large-beds” per_page=”12″ columns=”2″ orderby=”date” order=”desc”]

    Under “Product Description” I was able to list all of the products but my goal was just to list the only the product description not all of the large beds.
    Code for this

    array(
    ‘per_page’ => ’12’,
    ‘columns’ => ‘2’,
    ‘orderby’ => ‘title’
    )

    [related_products per_page=”12″]

    Any thoughts on this? Any help would be much appreciated!

    Thread Starter waystudio

    (@waystudio)

    http://docs.woothemes.com/document/woocommerce-shortcodes/

    I posted what the documentation and this is what I was able to produce: http://bizzydogbeds.com/newtest/product … red-waves/

    I now have 2 “Related Products” but neither of them show all 9 of the Large beds.

    Plus my “Product Description” show all 9 of the large beds. While the product description is to the right of the items picture (I’m fine with that one)

    Any help would be great! Thank you so much

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Related Products’ is closed to new replies.