Question

I am integrating a WordPress template. But my category list is repeating again. This is the live site link: The products and pagination are repeating twice.

Following is my code:

<?php /** start the product loop here */?>  
            <ul class="list-products default_product_display product_view_<?php echo wpsc_the_product_id(); ?> <?php echo wpsc_category_class(); ?> group">
            <?php while (wpsc_have_products()) :  wpsc_the_product(); ?>

                <?php $last_class = ( ! (($i+1) % $last_each) ) ? ' last' : '' ?>

                <?php if( wpsc_category_transition() ) :?>
                    <h3 class='wpsc_category_boundary'>
                    <?php echo wpsc_current_category_name(); ?>
                    </h3>
                <?php endif; ?>

                <li class="productsdisplay default_product_display product_view_<?php echo wpsc_the_product_id(); ?> <?php echo wpsc_category_class(); ?><?php echo $last_class ?>">
                    <?php if( wpsc_show_thumbnails() ) :?>
                        <div class="product-image">
                            <?php if(wpsc_the_product_thumbnail()) : ?>
                                <a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo wpsc_the_product_permalink(); ?>">
                                    <img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
                                </a>
                            <?php else: ?>
                                <a href="<?php echo wpsc_the_product_permalink(); ?>">
                                    <img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="No Image" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="<?php echo get_option('product_image_width'); ?>" height="<?php echo get_option('product_image_height'); ?>" /> 
                                </a>
                            <?php endif; ?>    

                            <?php if( wpsc_product_on_special() ) : ?>
                                <div class="sale-icon-small">Sale!</div>
                            <?php endif; ?> 
                        </div>                
                        <div class="thumb-shadow">&nbsp;</div>
                    <?php endif; ?>

                    <?php
                    if(gold_cart_display_gallery()) :                   
                        echo gold_shpcrt_display_gallery(wpsc_the_product_id(), true);
                    endif;
                    ?>  

                    <p class="title-product">
                        <?php if(get_option('hide_name_link') == 1) : ?>
                            <?php echo wpsc_the_product_title(); ?>          
                        <?php else: ?> 
                            <a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>"><?php echo wpsc_the_product_title(); ?></a>
                        <?php endif; ?>
                    </p>            

                    <?php   
                        do_action('wpsc_product_before_description', wpsc_the_product_id(), ( ( isset( $wpsc_query->product ) ) ? $wpsc_query->product : null ) );
                        do_action('wpsc_product_addons', wpsc_the_product_id());
                    ?>

                    <?php if( !wpsc_show_stock_availability() OR wpsc_product_has_stock() ): ?>
                        <div class="price">
                        <?php 
                            $price = wpsc_the_product_price(get_option('wpsc_hide_decimals'));

                            if( get_option('wpsc_hide_decimals') )  
                                echo $price;
                            else
                                format_price( $price ); 
                        ?>
                        </div>
                    <?php else : ?>
                        <p><?php _e('Product not in stock', TEXTDOMAIN); ?></p>
                    <?php endif ?>

                    <?php echo do_shortcode('[button_icon href="'.wpsc_the_product_permalink().'" icon="arrow"]'.__( 'More details', TEXTDOMAIN ).'[/button_icon]') ?>    
                </li>   

                <?php if( !( ( $i + 1 ) % $last_each ) ) echo '<li style="display:block;height:0;with:100%;clear:both;visibility:hidden;margin:0;"></li>' ?>

            <?php $i++; endwhile; ?>
            </ul>
            <?php /** end the product loop here */?>

How can I remove this repetition?

Was it helpful?

Solution

The problem was with the theme template itself. I was using the kassyopea theme. In that Open the file wpsc-products_page.php, then look for and remove the last row:

<?php $wp_the_query = new WP_Query(); wp_reset_query(); ?>

Thats all. Every thing will now works fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top