• Resolved reshielwebstra

    (@reshielwebstra)


    Hello,
    I would like to ask if Relevanssi plugin can search contents inside the Woocommerce custom tabs?
    We had problem searching contents inside tablepress which was called inside the custom tabs. If we eliminate tablepress and add the content directly to Custom Tabs, will Relevanssi can search/find the keyword?

    Hope someone can answer this.
    Thanks in advance,
    Reshiel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I don’t know how WooCommerce Custom Tabs works, so I can’t say for sure. Probably yes. If you can show me how the tabs look like when you look at the post in the wp_posts database table, I can give a better answer.

    Thread Starter reshielwebstra

    (@reshielwebstra)

    Thanks Mikko for your reply.
    I checked wp_posts and Custom Tabs was not saved there.
    It was at the wp_postmeta table save on meta values attribute with meta keys as “yikes_woo_products_tabs”
    Does Relevanssi plugin can search from wp_postmeta table?

    Plugin Author Mikko Saari

    (@msaari)

    Set Relevanssi to index the custom field yikes_woo_products_tabs or set indexing to visible custom fields and reindex, and that should probably cover it for you.

    Thread Starter reshielwebstra

    (@reshielwebstra)

    Hello Mikko,

    Thanks for your reply.
    I did try your suggestion but it didn’t work. I also did try a few options but still no luck.
    The problem was I need to search the content inside the tablepress, where the tablepress shortcode was added inside the WooCommerce Custom Tabs.
    Is there a way to do that? Or do I have to modify the search function/query?

    Thanks a lot!

    Plugin Author Mikko Saari

    (@msaari)

    Ah, I see; shortcodes are not expanded inside custom field content by default, that’s why it’s not working.

    This should get you started:

    add_filter( 'relevanssi_custom_field_value', 'rlv_expand_shortcodes', 10, 2 );
    function rlv_expand_shortcodes( $value, $field ) {
      if ( 'yikes_woo_product_tabs' === $field ) {
        relevanssi_enable_tablepress_shortcodes();
        $value = do_shortcode( $value );
      }
      return $value;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using Relevanssi on Woocommerce Custom Tabs’ is closed to new replies.