• Store URL: http://www.icoins.com.ua
    WordPress version: 3.5.2
    WP e-Commerce version: 3.8.13
    Gold Cart version: no
    Theme:self made theme (based on natural-health, by jinsona designs)

    Hello)
    Introduction. I use on my site sort by price. Especially my site must be present all items, even those that out of stock. I want to show for user products like this:
    In stock
    Product1 price 100 (Max)
    Product2 price 90
    Product3 price 80
    Product4 price 70
    Product5 price 60
    ………………
    ProductN price Min

    Out of stock:
    Product1 price 100 (Max)
    Product2 price 90
    Product3 price 80
    Product4 price 70
    Product5 price 60
    ……………..
    ProductN price Min

    I did this:
    If I change main loop in wpsc-products_page.php to

    <?php while (wpsc_have_products()) : wpsc_the_product(); wpsc_the_product_title();?>
    (ADD THIS )<?php if(wpsc_product_has_stock()) : ?>
    ……
    <!--close default_product_display-->
    (ADD THIS )<?php endif; ?>

    This code incorrectly hide out of stock product. In options I have to show 40 items per page, with this changing I have 40 minus out_of_stock_items per page.

    I be glad to any idea that helps me to show all producs in stock, after them products out of stock.

    Best regards,
    Alexandr

    P.S. Sorry for my English)

    http://wordpress.org/plugins/wp-e-commerce/

Viewing 1 replies (of 1 total)
  • Thread Starter taktomedia

    (@taktomedia)

    I have idea) But have some problems. This solution:

    In Stock

    <?php /** start the product loop here */?>
          <?php while (wpsc_have_products()) : wpsc_the_product(); wpsc_the_product_title();?> 
    
        <?php if(wpsc_product_has_stock() >= 1 ) : ?>
    ............
         <?php endif; ?>
    	<?php endwhile; ?>
    <?php /** end the product loop here */?>

    Out of stock

    <?php /** start the product loop here */?>
          <?php while (wpsc_have_products()) : wpsc_the_product(); wpsc_the_product_title();?> 
    
        <?php if(wpsc_product_has_stock() == 0 ) : ?>
    ............
         <?php endif; ?>
    	<?php endwhile; ?>
    <?php /** end the product loop here */?>

    Now i have:

    In stock
    Product1 price 100 (Max)
    Product2 price 90
    Product3 price 80
    Product4 price 70
    Product5 price 60
    ………………
    ProductN price Min

    Out of stock:
    Product1 price 100 (Max)
    Product2 price 90
    Product3 price 80
    Product4 price 70
    Product5 price 60
    ……………..
    ProductN price Min

    But items sorted in each pages.

    How make “in stock” on first pages and “out of stock” in last?

    Best regards,
    Alexandr

    P.S. Sorry for my English)

Viewing 1 replies (of 1 total)
  • The topic ‘Show products "in stock" first’ is closed to new replies.