WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Related Products (6 posts)

  1. waystudio
    Member
    Posted 10 months ago #

    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/sunset-red-waves/

    I'm trying to get where it says "Related Products" to show more. Like 2 columns and x amount of rows. All of the code I find to modify do not work. On the link provided above my over all goal is to show all of the Large beds at the bottom of each Large bed post and the same for all of the beds sizes to show all of the related products. Any help on this would be a huge help!

    Nathen

    http://wordpress.org/plugins/woocommerce/

  2. jumjum
    Member
    Posted 10 months ago #

    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' );
  3. waystudio
    Member
    Posted 10 months ago #

    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.]

  4. waystudio
    Member
    Posted 10 months ago #

    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?

  5. waystudio
    Member
    Posted 10 months ago #

    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!

  6. waystudio
    Member
    Posted 10 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic