Hi all,
I would much appreciate if someone could let me know how to display the sidebar on the right of the single product page (The WooCommerce default location). Abundance theme.
Thank you in advance!
Hi all,
I would much appreciate if someone could let me know how to display the sidebar on the right of the single product page (The WooCommerce default location). Abundance theme.
Thank you in advance!
Hi again,
After spending some time playing with the config.php file in the Abundance theme I found a solution. I would much appreciate a sanity check and recommendations on how to improve.
Thank you
Instructions
Remove the existing abundance sidebar by commenting this line : // get_sidebar();
function avia_woocommerceproduct_prev_image_after()
{
global $avia_config;
$avia_config['currently_viewing'] = "shop_single";
$avia_config['layout'] = 'sidebar_left';
echo "</div>"; //end content
// get_sidebar();
wp_reset_query();
}
Add a new action :
add_action( 'woocommerce_after_single_product_summary', 'rightside_woocommerceproduct_sidebar', 20 );
and a new function :
function ew_woocommerceproduct_sidebar()
{
global $avia_config;
$avia_config['currently_viewing'] = "shop_single";
$avia_config['layout'] = 'sidebar_right';
echo "</div>"; //end content
get_sidebar();
wp_reset_query();
}
Comment or remove these lines to use the default WooCommerce tabs location :
// remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10);
// add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 50);
The related product and upsells can be repositioned by modifying these lines :
add_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 15);
add_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_upsells', 16);
Add this to the custom.css file :
div.product {
float: left;
margin-right: 30px;
width: 690px;
}
Hey!
it would take some time for me to reproduce this, so I'll only test it if it's really needed, but it seems good. The only issue I can think of is that you could miss something that's originally in the get_sidebar();. Let us know if there's anything that comes up :)
Regards,
Chris
Hi Guys - I would LOVE to get this working. I just tried this and it almost worked but I got the following error ...
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'rightside_woocommerceproduct_sidebar' was given in /home/content/24/8177724/html/wp-includes/plugin.php on line 405
So my guess is that it is looking for a sidebar that does not yet exits? Is that correct?
How do I add this sidebar?
Your help would really be appreciated!
PS - I did manage to do something useful that I think others would appreciate ... I managed to add my own product information tabs, then added custom field for that tab, and finally disiplay that custom field so that utilizes shortcodes!
Sorry, I made a typo. ew_woocommerceproduct_sidebar should be rightside_woocommerceproduct_sidebar. I don't know how to edit the original post.
function rightside_woocommerceproduct_sidebar()
{
global $avia_config;
$avia_config['currently_viewing'] = "shop_single";
$avia_config['layout'] = 'sidebar_right';
echo "</div>"; //end content
get_sidebar();
wp_reset_query();
}
Hi
As I also having some problems with sidebars on single products page, I´d like to ask....this is not a native theme feature?
Thanks :-)
I did what you said eplison web, but i got an error: Fatal error: Cannot redeclare rightside_woocommerceproduct_sidebar() (previously declared in /home/donskussen.nl/www/wp-content/themes/Abundance/woocommerce-config/config.php:136) in /home/donskussen.nl/www/wp-content/themes/Abundance/woocommerce-config/config.php on line 151
do you know how i can solve this?
Hi!
stickFinger: no it isnt :)
koenvdvelden: seems you have added the same function called rightside_woocommerceproduct_sidebar two times. php doesnt allow that, you need to remove one of them
Regards,
Kriesi
You must log in to post.