WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Custom products loop breaks woocommerce template (3 posts)

  1. gopeter
    Member
    Posted 1 year ago #

    I'm trying to list all products of a category in the content-product_cat.php template.

    But if i use the official snippet for custom loops, the woocommerce loop breaks
    global $woocommerce_loop;

    Without using the snippet, the $woocommerce_loop contains this informations:

    First iteration:
    Array ( [loop] => 1 [columns] => 3 )

    Second iteration:
    Array ( [loop] => 2 [columns] => 3 )

    When using the snippet, the $woocommerce_loop gets empty:

    Array ( [loop] => [columns] => 3 [column] => )

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

  2. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    In content-product_cat? Are you sure? That is the file for displaying a single product cat within the product archives (loop).

    Loops within loops can get a bit hairy. I'm assuming you're either editing the wrong template file, or typod it here?

  3. gopeter
    Member
    Posted 1 year ago #

    Yes, i want to list all products under each single category in the product archive, so i have to create a new loop in this file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic