• Resolved deathbydisco

    (@deathbydisco)


    Hello everybody,

    does anyone know if it is possible to show the short description of the grouped items ?

    by default woocommerce shows the quantity box, the title and the price i would like to show the short description of each grouped item as well.

    (info: my grouped items are set to hidden cuz i don’t want that people can view the individual item single page, seting them to hidden removes the link of the title)

    i searched a few forums and the web but i didnt found any solution 🙁

    many thanks for any solutions or hints

    https://wordpress.org/plugins/woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thats all the data which is shown for child products by default. To show extra info about each you’ll need to customise the add to cart template for grouped products.

    Take a look at this doc for intructions on overriding template files:

    https://docs.woothemes.com/document/template-structure/

    Thread Starter deathbydisco

    (@deathbydisco)

    Thanks Mike 🙂

    i moved the file to my child theme and modified the code to get the description added.

    works great.

    deathbydisco,

    Which file specifically was moved/edited and which line of code was edited and what code did you use?

    Thank you.

    I could really use some help on this

    Moderator Hari Shanker R

    (@harishanker)

    Hey there!

    The file Mike referred to is: https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/add-to-cart/grouped.php

    Here, you will find the title of each variation being added under <label> tags in line 66: https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/add-to-cart/grouped.php#L66

    You can add the variation description here. This could be tricky. You could add something like like <?php echo $product->post_excerpt; ?>, here to display the product description. I would recommend looking at other WooCommerce files to see how you can achieve this.

    Thread Starter deathbydisco

    (@deathbydisco)

    Hi witwitalias,

    my code was looking like that:

    
    <label for="product-<?php echo $product_id; ?>">
    <?php echo $product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink(), $product_id ) ) . '">' . esc_html( get_the_title() ) . '</a>' : esc_html( get_the_title() ); ?>
    </label>
    <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>
    

    Thank you deathbydisco and harishanker !

    I simply copied the grouped.php file from woocommerce (plugins/woocommerce/templates/single-product/add-to-cart) to my Avada theme (themes/Avada/woocommerce/single-product/add-to-cart/)

    Then I edited themes/Avada/woocommerce/single-product/add-to-cart/grouped.php by adding the following code to line 66 <?php echo apply_filters( ‘woocommerce_short_description’, $post->post_excerpt ) ?>

    ——————-

    Additional notes:

    The best part is, with Avada, the short description area supports shortcodes such as tooltips, modals, etc

    This is for WooCommerce Version 2.6.4

    Here is a screenshot showing unformatted text http://i.imgur.com/gYq1jQE.png (notice it bumps the text up a bit and makes the +/- quantity button appear off-center due to product title taking up almost the maximum amount of space before touching the pricing).

    Below is a screenshot showing an Avada tooltip in the short description area that does NOT bump text up and keeps the +/- quantity button in the default location. An additional bonus for me is that now the short description appears within the actual product description. http://i.imgur.com/7xiMYDu.png

    Take notice that if I were to try to add the tooltip in the short description for the Priority service product that there is no room and it would bump the text up and make the +/- quantity button appear off-center.

    And yes, for anyone wondering, I am using the “WooCommerce Dynamic Pricing & Discounts” found here https://codecanyon.net/item/woocommerce-dynamic-pricing-discounts/7119279

    Thank you again deathbydisco and harishanker !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘grouped product – short description of grouped items’ is closed to new replies.