Product tabs

Hello,

I use the BeBabyShop template.

Now I want to create an extra tab there for the products where I want to display a quotation form with contactform7. Normally this can be done with a small piece of code in the functions.php. But it doesn't work with this theme. So I don't dare to buy a plugin with which it is possible because there is a chance that it will not work either. In the past I have already used Xforwoocommerce.

So now I just added the content to the description tab. However, it is now at the very top and I want it below the description information.

testsite

Not sure if you can help me or give me advice on this.

Thanks

Roy

Comments

  • Hi,

    Please, go to Betheme -> Theme options -> Global -> Advnaced, change the Content display order to BeBuilder - WP Editor, and check if the form displays at the end then.

    If this will not work, please, tell me how did you place this form there? Did you use a shortcode for that?


    Best regards

  • Hello,

    That works.

    i used this for adding the contactform, placed it in functions.php:

    /**

     * Add a custom product contact form

     */

    add_filter('the_content', 'cf7_form_to_all_products');

    function cf7_form_to_all_products($content) {

        if ( class_exists( 'woocommerce' ) && is_product() && is_main_query() ) { 

        return $content . '[contact-form-7 id="1" title="Contactformulier 1"]';

      }   

      return $content;

    }

    add_filter( 'woocommerce_product_tabs', 'cf7_add_description_tab', 20 );

    function cf7_add_description_tab( $tabs ) {

      global $product, $post;


      if ( ! $post->post_content ) {

        $tabs['description'] = array(

          'title'  => __( 'Description', 'woocommerce' ),

          'priority' => 10,

          'callback' => 'woocommerce_product_description_tab',

    );

    }

       

      return $tabs;

     }


    And i tried this code for adding a extra tab, but that seems not to work.


    /**

     * Add a custom product data tab

     */

    add_filter( 'woocommerce_product_tabs', 'wc_new_product_tab' );

    function wc_new_product_tab( $tabs ) {

    $tabs['test_tab'] = array(

    'title' => __( 'New Product Tab', 'woocommerce' ),

    'priority' => 50,

    'callback' => 'wc_new_product_tab_content'

    );

    return $tabs;

    }

    function wc_new_product_tab_content() {

    // The new tab content

    echo '<h2>New Product Tab</h2>';

    }


    The best solution for me is that i can add a new tab where the contactform shows.


    Thanks for the great support!

    Roy

  • Custom product templates do not have tabs and are divided into elements in BeBuilder.

    If you would like to put them in a tab that would require further file customization which we do not provide help with, unfortunately.


    Best regards

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.