• For my website im using the product specifications plug-in. I would like to display the category name and SKU code as attributes in a product information table as default. So that after I filled them out in the normal product settings, they would display in the table. Does anyone know if this is possible (maybe with shortcodes) and if so, how it works.

Viewing 1 replies (of 1 total)
  • Plugin Author Dornaweb

    (@dornaweb)

    There is no straight-forward to what you need but you can grab the whole table HTML structure and modify it to fit your needs, here’s how you can do it:

    The output of [specs-table] shortcode which displays the table is located under : templates/shortcodes/table.php

    1. First you need to copy that file to your theme directory (e.g as mytable.php)
    2. Add below code to your functions.php file:

    add_filter('dw_specs_table_shortcode_output', 'my_custom_spec_table_markup', 10, 2 );
    function my_custom_spec_table_markup( $output, $args ){
        ob_start();
        extract( $args );
        include locate_template('<strong title="replace this with your path">PATH_TO_YOUR_{mytable}_FILE</strong>.php');
        return ob_get_clean();
    }

    3. After you follow the above steps, the table should be loaded from the new file you copied and you can modify the file and add as much custom groups and attributes you need.

    Note: on the copied file you have access to $post_id variable which you can retrieve production information you need based on it.

Viewing 1 replies (of 1 total)
  • The topic ‘shortcodes in this plug-in’ is closed to new replies.