• Resolved matmal

    (@matmal)


    Hello,

    I can see that TablePress is a very nice plugin and gives a lot of opportunities.

    However I have one thing I am wondering how to do.

    I have many products. Every product has it’s own SKU for instance XXX000123. Every product has a custom tab named SIZING CHART. In that Tab I would like to inject automatically a shortcode from Table Press [table id=XXX000123 /].

    I assume that every product I have has a TablePress table already created.

    Issues for resolving:
    1. Checking if the SIZING CHART custom tab exist on the page
    2. Checking if the table with ID exists

    Kind regards and big thanks for any ideas how this function could look like in functions.php

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Checking whether a table exists in PHP can be done with the function

    <?php
    $table_exists = TablePress::$model_table->table_exists( 'XXX000123' );
    

    Unfortunately, I don’t know how to check for that Sizing Chart tab, or how to dynamically insert content into it. That depends on your theme (or the plugin that gives you this tab functionality).

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Product Tabs with Dynamic Table ID SHortcode’ is closed to new replies.