Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1284126

    I have a client that wants a certain layout of information for each product displayed on the main shop page product grid.
    Currently by default you get image, product name, price, and action button. They would like the info of product brand, type (such as shorts or pants), size, then price. I have tried to search out this info and not been able to find anything other then look and feel changes to the template.

    Thank You

    #1284234

    Hey dschneekloth,

    Here are the links for you, maybe they can give you some ideas:

    Products By Attributes and Variations for WooCommerce

    Managing Product Categories, Tags and Attributes

    Using custom attributes in menus and taxonomy archives

    https://medium.com/@shareblogtips/top-5-plugins-for-woocommerce-custom-product-options-use-case-update-2019-35c9124079f6

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1284280

    Victoria thank you for the reply! I will be checking it out so I can better refine my fix.
    I managed to figure it out mean time its not pretty but works for what I need. I will share the code functions below for anyone else that may run into this.

    /* Add brand and size to shop page working */

    add_action(‘woocommerce_after_shop_loop_item_title’, ‘dstm_display_product_category’, 5);

    function dstm_display_product_category()
    {
    global $product;
    $brand = $product->get_attribute(‘brand’);
    if (empty($brand)) {
    } else {
    if(isset($brand)){
    echo ‘Brand: ‘ . $brand . ‘<br />’;
    }
    }
    }

    add_action(‘woocommerce_after_shop_loop_item_title’, ‘cstm_display_product_category’, 5);

    function cstm_display_product_category()
    {
    global $product;
    $size = $product->get_attribute(‘size’);
    if (empty($size)) {
    } else {

    if(isset($size)){
    echo ‘Size: ‘ . $size . ‘<br />’;
    }
    }
    }
    require_once( ‘functions-enfold.php’);

    • This reply was modified 3 years, 8 months ago by dschneekloth.
    #1284324

    Hi,
    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1284484

    Yes this can be closed
    thanks

    #1284488

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add fields to products display on shop page WooCommerce’ is closed to new replies.