• Resolved mcdeth

    (@mcdeth)


    Hi, I can’t get snippet with own functions to work. Overall my table works, I’m adding column product_region and it shows the column Product Region, but value is always blank. I create wc_product_table_custom_column_product_region using snippet, I tried simlple and advanced methods but I can’t get table to show any data. Cache is off. I tried also with priority 1. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Saiful Islam

    (@codersaiful)

    Can you provide your code and explain how u have added?
    Plz explain details

    Thread Starter mcdeth

    (@mcdeth)

    Thanks for quick reply. So I create a snippet with Code Snippet, where I use code:

    add_filter( 'wc_product_table_custom_column_product_region', function( $data, WC_Product $product, $args ) { 
        $data = 'Something'; // create your data here
        return $data;
    }, 10, 3 );

    Then I use a shortcode:

    [product_table columns="image,name,att:size,price,product_region"]
    

    I disable website cache and plugin cache. Any other changes I make, like add or remove standalone column, takes immediate effect so it’s not caching. I’ve also tried pasting advanced snippet and there’s no effect. I can see column Product region, but it’s empty. I’ve tried with

    return "123";
    echo "123";

    Also no effects

    • This reply was modified 12 months ago by mcdeth.
    Plugin Author Saiful Islam

    (@codersaiful)

    May, u r using any other product table plugin. Bcz our table shortcode is different as well.

    Btw tomorrow I will give u full video tutorial for making custom column.

    In the mean time, see article https://wooproducttable.com/docs/doc/advance-uses/how-to-add-custom-column-using-action-and-filter-hooks/

    It will help u to create custom column in our table.

    Thread Starter mcdeth

    (@mcdeth)

    Thank, you’re right it was other plugin. I will test yours. Thanks!

    Plugin Author Saiful Islam

    (@codersaiful)

    I see. Ok, I am closing this ticket.

    Feel free to knock us any time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘snippet doesn’t work’ is closed to new replies.