Answer the question
In order to leave comments, you need to log in
How to add tab in woocommerce?
Friends, help me understand.
I'm trying to make additional tabs (TAV) in woocommerce.
I found a lesson and everything seems to be clear, but there are a number of questions.
Here is the link to the lesson itself: https://www.youtube.com/watch?v=VvLU89NBysM
The plugin is used there: "Manage WooCommerce Tabs Using filter"
I liked the plugin, but there is a problem, it does not display content and tabs on its own.
The lesson shows, using the example of adding a video, how to display it.
What have I done.
Here's the code I got:
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
//Переименовываю стандартные вкладки
print_r ($tabs);
$tabs ['description'] ['title'] = "Описание" ;
$tabs ['reviews'] ['title'] = "Ваши отзывы" ;
//Вывожу вкладку Видео
$tabs['product_video'] = array(
'title' => "Видео",
'priority' => 20,
'callback' => 'show_product_video'
);
// Вывожу вкладку Технические характеристики
$tabs['Tehnicheskie_harakteristiki'] = array(
'title' => "Техническик характеристики",
'priority' => 25,
'callback' => 'show_Tehnicheskie_harakteristiki'
);
return $tabs;
}
//Добавляю содержимое вкладки видео
function show_product_video() {
//Grab video url
$vid_url = get_field ('');
$step1 =explode ('v=', $vid_url);
$step2 =explode ('&', $step1[1]);
$video_id = $step2[0];
echo '<iframe width="420" height="315" src="https://www.youtube.com/embed/'. $video_id.'"frameborder="0"></iframe>';
}
// Добавляю содержимое вкладки Технические характеристики
function Tehnicheskie_harakteristiki() {
$variable = get_field('field_name');
}
/* Enable support for Post Formats. */
add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
Answer the question
In order to leave comments, you need to log in
Here in these two articles everything is described how to add.
https://medved.online/individual-order-form-...
Tabs (tabs) for woo website card (Wordpress website)
https://medved.online/tabs-tabs-for-card-sa...
With the help of WooCommerce Product Tabs plugin you can add Tabs to products. The tabs are displayed on the individual product pages to the right of the default “Description” tab. Please click on the link for the More details about this ploduct.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question