-
AuthorPosts
-
March 28, 2023 at 8:23 pm #1402816
Hello to the team,
I want to add a menu in the product sheet but I don’t want to use advanced page builder (need to work on all products) because it’s the final customer who will work on products. It’s better to have a template.
I managed to put the menu on the shop page (without constructor) using the menu code :
[av_submenu ...] … [/av_submenu] (it’s an example)
https://lebazargraphik.com/produit02.jpg
__________
I have this : https://lebazargraphik.com/produit01.jpg
I would have this : https://lebazargraphik.com/produit03.jpgDo you have any suggestion how can we achieve this?
Kind regards,March 29, 2023 at 4:18 am #1402853Hey mescalytequila,
Thank you for the inquiry.
You can use the “ava_after_main_title” hook to insert the submenu element after the main title container. Just add it in the functions.php file.
Example:
add_action("ava_after_main_title", function() { echo do_shortcode("[av_submenu ...] … [/av_submenu]"); }, 10, 1);
Best regards,
IsmaelMarch 29, 2023 at 12:26 pm #1402893Hi Ismael,
Thanks for your response. But it doesn’t work.An other idea ?March 31, 2023 at 5:12 am #1403079Hi,
Thank you for the update.
We modified the code in the functions.php file a bit and added another filter to allow execution of theme shortcodes outside the builder. This is the modified code.
add_action("woocommerce_before_main_content", function() { echo do_shortcode("[av_submenu which_menu='' menu='58' position='center' sticky='aviaTBsticky' color='main_color' mobile='disabled' mobile_switch='av-switch-768' alb_description='' id='' custom_class='' template_class='' av_uid='av-ldyiqu1t' sc_version='1.0'] [av_submenu_item title='Élément 1 de menu' button_style='' link='' linktarget='' av_uid='av-gb0n7' sc_version='1.0'] [av_submenu_item title='Élément 2 de menu' button_style='' link='' linktarget='' av_uid='av-bn1kr' sc_version='1.0'] [/av_submenu]"); }, 20); function avf_custom_exec_sc_only_mod( $exec_sc_only, $obj_sc, $atts, $content, $shortcodename, $fake ) { return true; } add_filter( 'avf_alb_exec_sc_only', 'avf_custom_exec_sc_only_mod', 10, 6 );
The submenu is now displaying correctly in the single product page but it might require a few css adjustments.
Best regards,
IsmaelMarch 31, 2023 at 4:19 pm #1403122Many many Thanks Ismael !!!
It works perfectly
Best regardsMarch 31, 2023 at 7:50 pm #1403153Hi mescalytequila,
I’m glad that Ismael could help you :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Menu in a single product layout (with woocommerce)’ is closed to new replies.