Tagged: loop, navigation, visibility, woocommerce
-
AuthorPosts
-
January 27, 2014 at 11:28 am #215287
Hi Kriesi,
When viewing a product in die single product view, there’s two navigation items that shows either the previous or next product in line. This works fine except that it also shows products that is set to “hidden” in the visibility section of the product (in the backend).
Please see screenshot for more info at: http://goo.gl/AXtloy
Thanks in advance
January 27, 2014 at 11:32 am #215288PS – to see this in action, compare the following pages:
Single Product View: http://tinygiantstudios.co.za/store/wp-job-manager-auto-location
Overall Shop View: http://tinygiantstudios.co.za/productsYou’ll notice that in the Overall Shop View, there is no product entitled “Auto Job Suggest” – this is because it’s been set to hidden in the backend…
January 28, 2014 at 9:41 am #215693Hi!
Yes, unfortunately these buttons will ignore the “hidden” product settings. We use the standard wordpress get_previous_post() and get_next_post() post functions to query the previous/next product posts and these functions ignore the “special” WooCommerce data fields like “catalog visibility”, etc.
The only solution I can provide is to completely remove the next/previous buttons from the single product pages if you want to avoid that users can view hidden products. Open up functions.php and insert following code
add_filter('avia_post_nav_settings','avia_remove_next_prev_from_products', 10, 1); function avia_remove_next_prev_from_products($settings) { if(is_product()) $settings['is_fullwidth'] = true; return $settings; }
at the very bottom of the file.
Cheers!
PeterJune 26, 2015 at 4:09 pm #465039I have a similar query…
I am trying to setup the shop in Enfold similar to your grouped product here…http://kriesi.at/themes/enfold/product/nomu-salt-pepper-and-spice-grinders/?skin=SplashGreen
I have noticed that all the “single” products listed on yours don’t show up in the previous/next arrows but for some reason in mine they are please see the site I have attached in the private content… in this site the single products of the grouped ones are showing up in previous and next how can I hide these like your demp store?
Many thanks – Rachel
June 30, 2015 at 9:57 am #466254Hi!
not sure what you mean @greenlinkweb because I can’t see any previous and next button on the link you have provided in private content. Could you already fix it?
Cheers!
AndyJune 30, 2015 at 11:19 am #466318Hi Andy I did hide the previous/next using the above filters as I couldn’t work out why the single products of the grouped ones were showing up when they didn’t in your test I will un-hide so you can see what I mean? see private link if you click the “next” button it takes you to the single product of the grouped one on that page whereas your test site doesn’t show the single products of the grouped one in the previous/next buttons or the catalog.
July 2, 2015 at 1:59 pm #467488Hi!
sorry, but I can see a coming soon page only. I think we might need admin access, to see what you mean, right? post login details here as private reply.
Best regards,
AndyJuly 5, 2015 at 1:13 pm #468553Hi Andy good idea! I will private message login details thanks Rachel
July 6, 2015 at 1:58 pm #468904Hi!
you can hide it using this code in Quick CSS field:
a.avia-post-nav.avia-post-next.with-image { display: none; }
Hope this helps.
Regards,
Andy -
AuthorPosts
- The topic ‘Single Product View Showing Hidden Products’ is closed to new replies.