$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugin development - Woocommerce Single Product Tabs Got Duplicate|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugin development - Woocommerce Single Product Tabs Got Duplicate

matteradmin8PV0评论

I have just change the order of these lines of code for some changing in single product template.

add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 10 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

After toggling the numeric digit at the first two lines i am getting duplicate tabs. If i reorder them it will revert back to the default position. Kindly assist me what can i do. Thanks

I have just change the order of these lines of code for some changing in single product template.

add_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 10 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

After toggling the numeric digit at the first two lines i am getting duplicate tabs. If i reorder them it will revert back to the default position. Kindly assist me what can i do. Thanks

Share Improve this question asked Feb 8, 2019 at 18:53 Ahtsham Ul HaqAhtsham Ul Haq 11 bronze badge 5
  • It's likely because you haven't removed the default hooks, which results in the same callback being hooked twice to the same action. – Sally CJ Commented Feb 10, 2019 at 13:10
  • Hi @SallyCJ, Could please assist me which file i need to edit – Ahtsham Ul Haq Commented Feb 10, 2019 at 19:05
  • You can add the code in the theme functions file (i.e. functions.php) and have a look at this example. – Sally CJ Commented Feb 12, 2019 at 6:20
  • 1 @SallyCJ Thanks a lot for help but that not work me, i dont know why but the good thing is i have fixed it through css to display:none the first child and works great. – Ahtsham Ul Haq Commented Feb 12, 2019 at 8:23
  • Ok then. But you should post an answer - and accept it - so that people know the question has an accepted solution. :) All the best. – Sally CJ Commented Feb 12, 2019 at 10:15
Add a comment  | 

1 Answer 1

Reset to default 0

Found a quick solution for this problem. Unable to remove action as Sally mentioned above with example.For me the display:none; is enough, i have remove the child div of summary class. See the code below:

.summary.entry-summary div:nth-child(5) {
    display: none;
}

For me its 5th child maybe it will help others.

Post a comment

comment list (0)

  1. No comments so far