Okay
  Public Ticket #2316658
Filter additional information by product categories
Closed

Comments

  • Walter started the conversation

    Hi! I'm trying to do some changes in the product page.

    I'm showing the additional information on the right of the product.

    I would like to show the additional information in different ways depending of the product categories. For example. If if a wine is shown, I would like to show a table with some technique information, but if a fruit is show, I would like show another thing.

    It's possible? 

    Right now I'm trying to do some changes in the "product-attributes.php" but i don't know how to filter by categories.

    Thanks in advantage!

  •  2,636
    Kevin replied

    Hi Walter !

    additional information section of the product tab and information taken from product attributes

    add_filter('woocommerce_product_tabs', 'remove_additional_information_tab', 100, 1);
    function remove_additional_information_tab ($tabs) {
        unset($tabs['additional_information']);     return $tabs;
    } add_action('woocommerce_single_product_summary', 'additional_info_under_add_to_cart', 35);
    function additional_info_under_add_to_cart() {
        global $product;     if ($product && ($product-> has_attributes () || apply_filters('wc_product_enable_dimensions_display', $product-> has_weight () || $product-> has_dimensions()))) {
            wc_display_product_attributes ($product);
        }
    }


    #product attribute.php is a template that displays the properties of the existing product set with each product (plguin / woocommerce / templates / single-product / product-attributes.php)
    You can add this file to the theme's woocommerce / single-product file to edit it

    thank you