Viewing 2 posts - 1 through 2 (of 2 total)
  • #105627
    KrullDesign
    Member
    Post count: 56

    Hi, I have added some code to the child theme that adds custom accordions to the single product pages but in the latest update 1.81 there seems to be another description tab like the theme code has changed completely. Which php file would I find this new tab that has been added?
    You can view an example page here
    http://apothecarange.com/product/in-lighten-eventone-serum/

    I used the code form the older theme versions and just added new tabs, as you’ll see below

    /* SINGLE PRODUCT
    ================================================== */

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5);
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10);
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20);
    remove_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_show_product_sale_flash’, 10);
    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10);
    remove_action( ‘woocommerce_product_tabs’, ‘woocommerce_product_description_tab’, 10 );
    remove_action( ‘woocommerce_product_tab_panels’, ‘woocommerce_product_description_panel’, 10 );

    $options = get_option(‘sf_neighborhood_options’);
    if (isset($options[‘enable_default_tabs’])) {
    $enable_default_tabs = $options[‘enable_default_tabs’];
    } else {
    $enable_default_tabs = false;
    }

    if ($enable_default_tabs) {
    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 35);
    } else {
    add_action( ‘woocommerce_single_product_summary’, ‘sf_product_accordion’, 35);
    }
    add_action( ‘woocommerce_single_product_summary’, ‘sf_product_share’, 45);

    if (!function_exists(‘sf_product_accordion’)) {
    function sf_product_accordion() {
    global $woocommerce, $product, $post;

    $tabdirections = get_post_meta($post->ID, “tabdirections”, true);
    $tabingredients = get_post_meta($post->ID, “tabingredients”, true);
    $tabcontra = get_post_meta($post->ID, “tabcontra”, true);

    $options = get_option(‘sf_neighborhood_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 = get_post_meta($post->ID, ‘sf_product_description’, true);
    ?>
    <div class=”accordion” id=”product-accordion”>

    <div class=”accordion-group”>
    <div class=”accordion-heading”>

    <?php _e(“DESCRIPTION”, “swiftframework”); ?>

    </div>
    <div id=”product-desc” class=”accordion-body collapse in”>
    <div class=”accordion-inner”>
    <?php
    if ($enable_pb_product_pages) {
    echo do_shortcode($product_description);
    } else {
    the_content();
    }
    ?>
    </div>
    </div>
    </div>

    <div class=”accordion-group”>
    <div class=”accordion-heading”>

    <?php _e(“DIRECTIONS FOR USE”, “swiftframework”); ?>

    </div>
    <div id=”directions” class=”accordion-body collapse”>
    <div class=”accordion-inner”>
    <?php echo $tabdirections; ?>
    </div>
    </div>
    </div>

    <div class=”accordion-group”>
    <div class=”accordion-heading”>

    <?php _e(“INGREDIENTS”, “swiftframework”); ?>

    </div>
    <div id=”ingredients” class=”accordion-body collapse”>
    <div class=”accordion-inner”>
    <?php echo $tabingredients; ?>
    </div>
    </div>
    </div>

    <div class=”accordion-group”>
    <div class=”accordion-heading”>

    <?php _e(“CONTRA-INDICATIONS”, “swiftframework”); ?>

    </div>
    <div id=”contra” class=”accordion-body collapse”>
    <div class=”accordion-inner”>
    <?php echo $tabcontra; ?>
    </div>
    </div>
    </div>
    <?php if ( comments_open() ) : ?>
    <div class=”accordion-group”>
    <div class=”accordion-heading”>

    <?php _e(“Reviews”, “swiftframework”); ?> (<?php echo comments_number( ‘0’, ‘1’, ‘%’ ); ?>)

    </div>

    Thanks
    Nick

    #105820
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    We just changed the code for the accordions so that they all use the same line, which is found in tabs.php in the woocommerce folder

    – Kyle

Viewing 2 posts - 1 through 2 (of 2 total)

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

License required for the following item
Login and Registration Log in · Register