Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #703008

    Hi there everyone

    I have product detail pages set up on my development site, and at the bottom use a “related products” element with the intention to show up to 4 products from the same sub-category of the focus product. this works ok if the Parent Category only has 1 sub-category.

    However, if I have a Parent category with several other sub-categories, I run into difficulty with what is displayed.
    Example:
    Parent Category: Libeluile (brand)
    Sub Category 1: Gourmet Oils
    Sub Category 2: Gourmet Vinegars
    Sub Category 3: Gift Boxes

    If I have a Product detail page from Gourmet Vinegars, I want the “related products” element to only show up to 4 other Gourmet Vinegars from that range. But, unfortunately this element is currently displaying Gourmet Vinegars but also products from the other 2 sub categories of Gourmet Oils and Gift Boxes. I am guessing because it refers to the Parent category for selection.

    Is there a way to tweak the settings/code so that the related products element on these pages only displays products from that same subcategory rather than all of them from the parent category?

    I did think I could use Linked Products/Upsells when creating the product, and then specify 4 from the same sub category, and then specify “Upsells only” in the Related Product element on the Product Detail page. Which should theoretically work, but I wondered if there were a more automated method that wouldn’t require me to set it up manually each time?

    #704111

    Hey craigriches,

    Thank you for using Enfold.

    Please create a woocommerce/templates/single-product directory in your child theme folder then add a related.php file. In the file, use this code. http://pastebin.com/LKRRSNXV

    Based on: https://github.com/woocommerce/woocommerce/issues/850

    I’m not sure if that is going to work but it’s worth a try. There is no available filter for the woocommerce_related_products function query so it’s the only solution we got for now.

    Best regards,
    Ismael

    #1033671

    Hello… BUMP, MAJOR BUMP!!!


    @ismael

    What can I do to get this code working again? Meaning, what do I have to erase in the woocommerce enfold config that is overriding the child theme function that used to work?

    #1034306

    Hi,

    What is not working? Can you explain the issue? Please provide a link to the actual page so that we can check it.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.