Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter shaunjeffrey

    (@shaunjeffrey)

    Hi @soumyaroyy, I haven’t received any response yet.

    As mentioned for my particular situation, the forms that appeared multiple times were simple forms that didn’t have any conditional statements, so I was able to disable this function easily by removing and/or re-adding the gform_get_form_filter_multiple filter for specific forms.

    Unfortunately, this solution will not work for you if the forms that appear on the page multiple times use conditional statements. If the latest version doesn’t work, you are unable to find a solution and the plugin developer is unable to assist further, then you may need to forego this plugin entirely and just create a duplicate of the forms that you want to use on different parts of the page.

    Thread Starter shaunjeffrey

    (@shaunjeffrey)

    Hi Marcel,

    For some reason the plugin didn’t display the link by default, but that may have been due to a conflict with one of the other plugins or custom templates.

    It’s working well for the time being. Thank you for such a handy tool.

    Thanks again.

    Hi Guys,

    I was just about to create a ticket for the same issue. Version 6.16 has the same issue, but for line 1105 instead.

    $json_feed is still trying to be accessed as though it were an array, even though there’s the distinct possibility that it is still a WP_Error. I manually modified my copy of the plugin to include a check beforehand.

    if ( is_wp_error( $json_feed ) ) {
        return 'ERROR';
    }
    Thread Starter shaunjeffrey

    (@shaunjeffrey)

    @PhilipHoy Unfortunately anything I code for our clients is the propriety of the company I work for. Regardless, at this point it still involves a little bit of coding, but once we nut out a pretty UI I’ll convince them to let me post it to github or something.

    I’ve updated my local copy of the plugin, and it seems my suggestion may have been taken into consideration.

    I did create a file and place it in wp-content/mu-plugins. It overwrites the wcapf_list_terms function to make it much more efficient, but lacks the ability to properly display hierarchical items. Let me know if it helps.

    <?php
    /**
     * Replace default wcapf_list_terms function to only have a single sql query
     * - No heirarchy possible at this point
     * @global type $wcapf
     * @global type $wpdb
     * @param type $attr_args
     * @return type
     */
    function wcapf_list_terms( $attr_args ) {
        global $wcapf;
    
        extract( $attr_args );
    
        $parent_args = array(
            'orderby'    => 'name',
            'order'      => 'ASC',
            'hide_empty' => true
        );
    
        if ( $enable_hierarchy === true ) {
            $parent_args['parent'] = 0;
        }
    
        $parent_terms = get_terms( $taxonomy, $parent_args );
    
        $html = '';
        $found = false;
    
        if ( sizeof( $parent_terms ) > 0 ) {
            $html .= '<div class="wcapf-layered-nav">';
            $html .= '<ul>';
    
            // store term ids from url for this attribute
            // example: attra_size=9,29,45
            $term_ids = array();
    
            if ( key_exists( $data_key, $url_array ) && ! empty( $url_array[$data_key] ) ) {
                $term_ids = explode( ',', $url_array[$data_key] );
            }
    
            // store the ancestor ids for this term
            $chosen_filters = $wcapf->getChosenFilters();
            $term_ancestors = $chosen_filters['term_ancestors'];
            $ancestors = array();
    
            if ( sizeof( $term_ancestors ) > 0 && key_exists( $data_key, $term_ancestors ) ) {
                foreach ( $term_ancestors[$data_key] as $chosen_filter ) {
                    foreach ( $chosen_filter as $ancestor ) {
                        array_push( $ancestors, $ancestor );
                    }
                }
            }
    
            $ancestors = array_unique( $ancestors );
            $prod_ids = ( $query_type === 'and' ) ? $wcapf->filteredProductIds() : $wcapf->unfilteredProductIds();
    
            global $wpdb;
            $all_prod_term_ids = array_count_values( $wpdb->get_col( "SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr WHERE tr.object_id IN (" . implode( ',', $prod_ids ) . ")" ) );
    
            foreach ( $parent_terms as $parent_term ) {
                $parent_term_id = $parent_term->term_id;
    
                $count = ( array_key_exists( $parent_term_id, $all_prod_term_ids ) ) ? $all_prod_term_ids[ $parent_term_id ] : 0;
    
                $force_show = false;
    
                // if this term id is present in $term_ids array we will force
                if ( in_array( $parent_term_id, $term_ids ) ) {
                    $force_show = true;
                }
                // if child term is selected we will force
                elseif ( sizeof( $ancestors ) > 0 && in_array( $parent_term_id, $ancestors ) ) {
                    $force_show = true;
                }
    
                if ( $count > 0 || $force_show === true ) {
                    $found = true;
    
                    $html .= ( in_array( $parent_term_id, $term_ids ) ) ? '<li class="chosen dekk-attr">' : '<li class="dekk-attr">';
                    
                    $html .= '<a href="javascript:void(0)" data-key="' . $data_key . '" data-value="' . $parent_term_id . '" data-multiple-filter="' . $enable_multiple . '">' . $parent_term->name . '</a>';
                    
                    if ( $show_count === true ) {
                        $html .= '<span class="count">(' . $count . ')</span>';
                    }
                    
                    $html .= '</li>';
                }
            }
    
            $html .=  '</ul>';
            $html .= '</div>';
        }
    
        return array(
            'html'  => $html,
            'found' => $found
        );
    }
    
    Thread Starter shaunjeffrey

    (@shaunjeffrey)

    The Link to find your API key is outdated. For reference, the correct link is https://help.infusionsoft.com/userguides/get-started/tips-and-tricks/api-key

Viewing 6 replies - 1 through 6 (of 6 total)