Want to add shortcode on existing plugin

Viewed 14

I'm using woocommerce add-ons plugin to extend the warranty, this plugin no has a shortcode feature. I want to show addons on my single product page sidebar. write now working like this- https://prnt.sc/THC_sKbAIXFU

i see here main function load plugin is - add_action( 'plugins_loaded', 'woocommerce_product_addons_init', 9 );

I tried to add a shortcode like the below code, But not working.

add_shortcode('addons','myplugin_main');function myplugin_main($atts){echo woocommerce_product_addons_init(); return;}

can someone help me with a better way to show this on the sidebar?

thank you

0 Answers
Related