Hello,
I’ve tried to use hook avia_layout_filter for changing sidebar position on Single Product page.
Tried also change prior from 1 to 99999
add_filter('avia_layout_filter', 'avia_change_post_layout', 9999999, 2);
function avia_change_post_layout($avia_config, $post_id){
$result = 'sidebar_left';
$avia_config['layout']['current'] = $avia_config['layout'][$result];
$avia_config['layout']['current']['main'] = $result;
return $avia_config;
}
Okay, as I understand, I can’t change it because it overrided by avia_woocommerce_before_main_content function.
Hi mdxclr,
Do you still need help or you figured it out?
If you need further assistance please let us know.
Best regards,
Victoria
Yeap, still want to change it without overriding function =)
Hi,
This link should help you with the overwritten problem: https://docs.woocommerce.com/document/introduction-to-hooks-actions-and-filters/
Best regards,
John Torvik
In my first post I’ve present my filter hook, but it doesnt work, with any priority.
Hi mdxclr,
So you could hook it to the avia_woocommerce_before_main_content action and see if that works.
Best regards,
Victoria
Okay, so the only one way to replace it – rewrite avia_woocommerce_before_main_content hook?
Hi mdxclr,
Not rewrite, check what code is there and maybe add your own. Or remove this action, and add your own which will be avia_woocommerce_before_main_content + your code. Does it make sense?
Best regards,
Victoria
After that moves my theme will not ‘Upgrade Safe’. Want to change it using Child theme only
Hi,
I am sorry but could you please explain what you mean?
Best regards,
Basilis