Tagged: navigation, products, sidebar, woo commerce
-
AuthorPosts
-
July 3, 2017 at 7:15 pm #816025
Is there a trick to get the PRODUCTS display in WooCommerce to use the correct sidebar?
On all the other pages of my demo website, the sidebar displays correctly:
http://jewellery.waltoncreative.com
BUT on all of the PRODUCT pages, the sidebar displays below the image in wrong formatting:
http://jewellery.waltoncreative.com/product/silver-heart-shaped-earrings/
As far as I can see the only way to get the sidebar to display correctly is to use Enfold’s “Advanced Layout Editor” but this then means each product (of 5000) needs to be created from scratch rather than using the WooCommerce image features.
Any thoughts or suggestions?
- This topic was modified 7 years, 4 months ago by ColinWalton.
July 6, 2017 at 11:33 am #817153Hey ColinWalton,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJuly 6, 2017 at 11:42 am #817159Great – here we are…
July 6, 2017 at 8:01 pm #817481July 6, 2017 at 8:46 pm #817498Great thank you that’s very good. For the rest of the website I think the sidebar looks best on the LEFT.
Is there anyway of altering the function / CSS to place the sidebar on the LEFT instead of the right?
July 7, 2017 at 8:04 am #817655Hi ColinWalton,
The way people assess information on the web is left to right, top to bottom and the left top-center should be your product, not the sidebar info. The way it is now, looks very natural, but if you really need to have it on the left, we’ll try to come up with something.
Let me know what you think.
Best regards,
VictoriaJuly 7, 2017 at 10:03 am #817702That may well be true. But for me the sidebar in this instance is meant to be read first – so really HAS to be on the left.
I have every faith you can work a miracle! thank you x
July 7, 2017 at 11:15 am #817750Hi ColinWalton,
You could try a different action
function ava534345953_init() { add_action( 'woocommerce_before_single_product', 'avia_add_sidebar', 25); }
and adjust float to right, if left does not work for you. (Keep all the code form before)
Best regards,
VictoriaJuly 7, 2017 at 12:26 pm #817801Sorry, I can’t get this to work. Where EXACTLY should this extra function go?
If I put it at the end I either get a blank screen or the loading icon continues and page does not load. I have tried replacing the previous function about the right hand side bar and this has the same effect.
Can you possibly give me the whole script with the LEFT sidebar function in position please?
Sorry to be a pain!
July 8, 2017 at 5:46 am #818065Hi Colin,
The code Victoria sent you in her last reply should go into the end of the functions.php file in your child theme, please try that out.
Best regards,
RikardJuly 8, 2017 at 12:07 pm #818139Hiya, as I said, I have already tried that. If I put if after THE PREVIOUS CODE Victoria said to keep in – all I get is a blank screen.
This is the code I have already:
// fixes the sidebar to add correctly to PRODUCTS PAGES add_action('init','ava534345953_init', 50); function ava534345953_init() { add_action( 'woocommerce_after_single_product_summary', 'avia_add_sidebar', 25); } function avia_close_image_div() { echo "</div>"; } function avia_add_sidebar() { if(is_product()) { $avia_config['currently_viewing'] = "shop_single"; get_sidebar(); } }
If I add THIS afterwards:…
function ava534345953_init() { add_action( 'woocommerce_before_single_product', 'avia_add_sidebar', 25); }
I end up with a blank screen. I think the various functions are fighting against each other somehow?
TO SUM UP – THIS IS THE CODE AS I HAVE IT NOW…
// fixes the sidebar to add correctly to PRODUCTS PAGES add_action('init','ava534345953_init', 50); function ava534345953_init() { add_action( 'woocommerce_after_single_product_summary', 'avia_add_sidebar', 25); } function avia_close_image_div() { echo "</div>"; } function avia_add_sidebar() { if(is_product()) { $avia_config['currently_viewing'] = "shop_single"; get_sidebar(); } } function ava534345953_init() { add_action( 'woocommerce_before_single_product', 'avia_add_sidebar', 25); }
July 10, 2017 at 2:35 pm #818751Hi ColinWalton,
Function with adding the action has to be only one. Sorry, if I wasn’t clear enough.
Remove this one:function ava534345953_init() { add_action( 'woocommerce_after_single_product_summary', 'avia_add_sidebar', 25); }
So you should get this:
// fixes the sidebar to add correctly to PRODUCTS PAGES add_action('init','ava534345953_init', 50); function avia_close_image_div() { echo "</div>"; } function avia_add_sidebar() { if(is_product()) { $avia_config['currently_viewing'] = "shop_single"; get_sidebar(); } } function ava534345953_init() { add_action( 'woocommerce_before_single_product', 'avia_add_sidebar', 25); }
Best regards,
VictoriaJuly 10, 2017 at 2:40 pm #818754Hi Victoria,
Thank you for your work on the problem.
I have changed the function file as suggested. But I am afraid things go a bit weird:
http://jewellery.waltoncreative.com/product/silver-st-christopher/
- This reply was modified 7 years, 4 months ago by ColinWalton.
July 10, 2017 at 2:52 pm #818767I have changed the CSS, so it almost works now.
All I need to do is to float the product text panel to the right of the main image.
http://jewellery.waltoncreative.com/product/silver-necklace/
July 10, 2017 at 2:56 pm #818773PS – I think you have sorted it now for me – THANK YOU !
I think I can fix the other odd things with CSS.
Thanks again.
Colin x
July 11, 2017 at 12:55 pm #819303Hi ColinWalton,
Glad we got it working for you! :)
I looked at you page, looks just like you wanted! Great job!
If you need further assistance please let us know.
Best regards,
VictoriaJuly 11, 2017 at 1:21 pm #819323Thanks to you! It’s amazing what can be done with CSS.
Let’s hope the client realises all the effort that has gone into it!
Thanks again Colin x
-
AuthorPosts
- You must be logged in to reply to this topic.