Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, it looks like a plugin, theme, or PHP issue is causing the critical error. Try checking your admin email for details, or temporarily disable plugins/themes to identify the problem. Enabling debug mode can also help pinpoint the exact cause.

    Hi,

    Yes, it’s possible to add extra fields per product on the product category (shop/archive) page, but it requires some customization because WooCommerce doesn’t show custom fields by default on the category page.

    Here’s how you can do it: 1. Add Custom Fields to Products

    • You can use Advanced Custom Fields (ACF) or WooCommerce Product Add-Ons to add fields like dimensions or color to each product.

    2. Display Fields on the Category Page

    • You’ll need to modify the template file content-product.php in your theme (or via a child theme).
    • Example snippet to show custom fields below price and above add-to-cart button:

    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘show_custom_product_fields’, 15 );
    function show_custom_product_fields() {
    global $product;

    $dimensions = get_post_meta( $product->get_id(), ‘_product_dimensions’, true );
    $color = get_post_meta( $product->get_id(), ‘_product_color’, true );

    if ( $dimensions ) {
    echo ‘<p><strong>Dimensions:</strong> ‘ . esc_html($dimensions) . ‘</p>’;
    }
    if ( $color ) {
    echo ‘<p><strong>Color:</strong> ‘ . esc_html($color) . ‘</p>’;
    }
    }

    The 15 priority ensures it displays after price but before the add-to-cart button.

    3. Styling

    • Use CSS to make sure these fields look clean and match your theme.

    4. Alternative Plugins

    • WooCommerce Custom Fields or Product Table plugins can also show extra fields on archive pages without coding.
Viewing 2 replies - 1 through 2 (of 2 total)