New Landing How can we help? Themeforest Theme Support Dante PHP error tabs.php line 49

Viewing 14 posts - 31 through 44 (of 44 total)
  • Posted in: Dante
  • #141809
    alemarengo
    Member
    Post count: 695

    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.

    #141906
    alemarengo
    Member
    Post count: 695

    Sorry, 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?

    #141973
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Not 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

    #155762
    alemarengo
    Member
    Post count: 695

    Hi 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.
    #155937
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    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

    #157313
    alemarengo
    Member
    Post count: 695

    May I give you my credentials in order to you to test it on your own?

    #157317
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Sure, Provide it here in a private reply.
    -Rui

    #157319
    alemarengo
    Member
    Post count: 695
    This reply has been marked as private.
    #157483
    alemarengo
    Member
    Post count: 695

    Hey guys, can you help me with this? Would you like me to explain better my question?

    #157612
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi 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

    #157613
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Alternatively, 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

    #157910
    alemarengo
    Member
    Post count: 695

    Hi 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
    }
    ?>
    
    #157914
    alemarengo
    Member
    Post count: 695

    Yeah! 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 
            }
        }
    #157956
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Glad you sorted a solution 🙂

    – Ed

Viewing 14 posts - 31 through 44 (of 44 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register