Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › PHP error tabs.php line 49
New Landing › How can we help? › Themeforest Theme Support › Dante › PHP error tabs.php line 49
- This topic has 43 replies, 6 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Dante
-
January 15, 2015 at 5:39 pm #141809
But anyway….
today I noticed that error disappeared.
Maybe I think I discovered which plugin caused that: Skyverge PIP.
Or at least I think it was its fault.January 16, 2015 at 6:10 am #141906Sorry, to triple post, but I’m trying to understand if it was that plugin to cause that issue, because I temporarily deactivated it yesterday evening, but didn’t read error.log in the previous couple of days. That’s not enough to know if it’s Skyverge’s plugin fault. 🙂 Hope you understand.
Finally, Ed: should I download the zip you sent to me and install it overwriting DANTE folder?
January 16, 2015 at 10:50 am #141973Not sure if it was that plugin at fault – the build I provided you simply checked the tab array before outputting each tab, to avoid errors showing up where data was missing.
You should be fine to still use that plugin.
– Ed
March 8, 2015 at 1:39 pm #155762Hi Ed!
Sorry to bother you again regarding product tabs.
I simply switched from default tabs mode to Dante’s one: the thing is that the snippet you suggested to me[...] unset($tabs['description']);
in order to hide Description if its content is void doesn’t work at all. Thus, Description tab is shown.
How can I fix this?Attachments:
You must be logged in to view attached files.March 9, 2015 at 11:39 am #155937Hi,
Can you provide the link to that page?
Tried other product pages but the layout was using tabs not sure if is inactive at the moment.-Rui
March 14, 2015 at 8:39 am #157313May I give you my credentials in order to you to test it on your own?
March 14, 2015 at 9:28 am #157317Sure, Provide it here in a private reply.
-RuiMarch 14, 2015 at 9:29 am #157319This reply has been marked as private.March 16, 2015 at 5:25 am #157483Hey guys, can you help me with this? Would you like me to explain better my question?
March 16, 2015 at 10:44 am #157612Hi there,
The accordion is output not using the standard WooCommerce code. You can hide the description tab with the following:
#product-accordion .panel:first-child { display: none!important; }
– Ed
March 16, 2015 at 10:44 am #157613Alternatively, you could override the accordion function in a child theme:
/* PRODUCT ACCORDION ================================================== */ if (!function_exists('sf_product_accordion')) { function sf_product_accordion() { global $woocommerce, $product, $post; $options = get_option('sf_dante_options'); if (isset($options['enable_pb_product_pages'])) { $enable_pb_product_pages = $options['enable_pb_product_pages']; } else { $enable_pb_product_pages = false; } $product_description = sf_get_post_meta($post->ID, 'sf_product_description', true); ?> <div class="panel-group" id="product-accordion"> <div class="panel panel-default"> <div class="panel-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#product-accordion" href="#product-desc"> <?php _e("Description", "swiftframework"); ?> </a> </div> <div id="product-desc" class="accordion-body collapse in"> <div class="accordion-inner" itemprop="description"> <?php if ($enable_pb_product_pages) { echo do_shortcode(sf_add_formatting($product_description)); } else { the_content(); } ?> </div> </div> </div> <div class="panel"> <div class="panel-heading"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#product-accordion" href="#additional-information"> <?php _e("Additional Information", "swiftframework"); ?> </a> </div> <div id="additional-information" class="accordion-body collapse"> <div class="accordion-inner"> <?php $product->list_attributes(); ?> </div> </div> </div> <?php if ( comments_open() ) : ?> <div class="panel"> <div class="panel-heading"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#product-accordion" href="#reviews"> <?php _e("Reviews", "swiftframework"); ?> (<?php echo comments_number( '0', '1', '%' ); ?>) </a> </div> <div id="reviews" class="accordion-body collapse"> <div class="accordion-inner"> <?php comments_template(); ?> </div> </div> </div> <?php endif; ?> </div> <?php } }
– Ed
March 16, 2015 at 7:29 pm #157910Hi Ed!
Thanks for your reply.
What’s gonna happen by overriding function? Does it hide Description tab if it’s void? Or should I customize it in order for it to reach my goal?***EDIT***
I think I have to customize function right in this point:... <div class="panel-group" id="product-accordion"> <!-- custom php in order to show Description panel or not, right? --> <?php global $post; $exists = sf_get_post_meta($post->ID, 'sf_product_description', true); if ($exists == "") { ?> <div class="panel panel-default"> <div class="panel-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#product-accordion" href="#product-desc"> <?php _e("Description", "swiftframework"); ?> </a> </div> <div id="product-desc" class="accordion-body collapse in"> <div class="accordion-inner" itemprop="description"> <?php if ($enable_pb_product_pages) { echo do_shortcode(sf_add_formatting($product_description)); } else { the_content(); } ?> </div> </div> </div> <?php } ?>
March 16, 2015 at 8:19 pm #157914Yeah! That’s correct! I just added it and it’s perfect!
The following is the whole function with a little trick in it: if there’s a Product Description, its toggle will be shown and visible; otherwise, the second toggle, Additional Information, will be shown and visible by default as the first one.
/* PRODUCT ACCORDION ================================================== */ if (!function_exists('sf_product_accordion')) { function sf_product_accordion() { global $woocommerce, $product, $post; $options = get_option('sf_dante_options'); if (isset($options['enable_pb_product_pages'])) { $enable_pb_product_pages = $options['enable_pb_product_pages']; } else { $enable_pb_product_pages = false; } $product_description = sf_get_post_meta($post->ID, 'sf_product_description', true); ?> <div class="panel-group" id="product-accordion"> <!-- custom php in order to show Description panel or not, right? --> <?php global $post; $exists = sf_get_post_meta($post->ID, 'sf_product_description', true); if ($exists != "") { ?> <div class="panel panel-default"> <div class="panel-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#product-accordion" href="#product-desc"> <?php _e("Description", "swiftframework"); ?> </a> </div> <div id="product-desc" class="accordion-body collapse in"> <div class="accordion-inner" itemprop="description"> <?php if ($enable_pb_product_pages) { echo do_shortcode(sf_add_formatting($product_description)); } else { the_content(); } ?> </div> </div> </div> <?php } ?> <div class="panel panel-default"> <div class="panel-heading"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#product-accordion" href="#additional-information"> <?php _e("Additional Information", "swiftframework"); ?> </a> </div> <?php global $post; $exists = sf_get_post_meta($post->ID, 'sf_product_description', true); if ($exists == "") { ?> <div id="additional-information" class="accordion-body collapse in"><?php } else { ?> <div id="additional-information" class="accordion-body collapse"><?php } ?> <div class="accordion-inner"> <?php $product->list_attributes(); ?> </div> </div> </div> <?php if ( comments_open() ) : ?> <div class="panel"> <div class="panel-heading"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#product-accordion" href="#reviews"> <?php _e("Reviews", "swiftframework"); ?> (<?php echo comments_number( '0', '1', '%' ); ?>) </a> </div> <div id="reviews" class="accordion-body collapse"> <div class="accordion-inner"> <?php comments_template(); ?> </div> </div> </div> <?php endif; ?> </div> <?php } }
March 17, 2015 at 1:12 am #157956Glad you sorted a solution 🙂
– Ed
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.