Site logo

[Resolved] product archive navigation & product count

Home Forums Support [Resolved] product archive navigation & product count

Home Forums Support product archive navigation & product count

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1704200
    sparkle

    i found this article:

    https://generatepress.com/forums/topic/how-to-add-pagination-to-top-of-archive-posts-page/ and while i was able to get the navigation at the top of every archive with it, what i would really like is for it to be next to the woocommerce shop archive breadcrumb, but aligned to the right of that line. i tried messing around in generatepress elements to see if i could make this happen, but wasn’t able to get the navigation to show up in the page.

    https://imgur.com/a/vYmqupv

    further, this little snippet doesn’t replicate the pagination used at the bottom of the page, which i would prefer. i did try to do some custom styling, and got about 80% there… how to just duplicate the one at the bottom?

    lastly, my product counts are showing out of stock products in their count. where do i adjust this? you can see this in the link in the category ‘chakra balancing’ it says we have 29 products but not all of those are in stock.

    #1704541
    Elvin
    Staff
    Customer Support

    Hi there,

    There are two sides you’ll have to change things on.

    First, you’ll have to change the hook you’re using. The code provided generate_before_main_content but if you want it to be “with” the breadcrumb, you’ll have to use woocommerce_before_main_content.

    You can actually just do this:

    add_action( 'woocommerce_before_main_content', 'woocommerce_pagination', 30 );

    So you don’t have to bother writing the CSS to replicate the default pagination style as this literally copies the classes.

    You then align them with css:

    nav.woocommerce-breadcrumb + nav.woocommerce-pagination {
        margin-top: 0px;
    }
    
    nav.woocommerce-breadcrumb, nav.woocommerce-pagination {
        display: inline-block;
    }

    You may have to add margins and padding.

    Stock counts of each item are set individually on Admin dashboard > All Products and find the product you have to change the stock count.

    #1704838
    sparkle

    love your .sig! lol

    thank you for the function. that did just what i wanted it to. i can manage the styling i think…

    for the stock count, i think i didn’t explain myself properly. i’ve got items that are out of stock that are being counted toward the quantity of items available in the category (count) on the shop page. so for example, for this category (runes) it says we have (2) in the category, but only one is in stock, so the other is hidden. how do i tell that (X) to only show in stock items?

    https://imgur.com/xk0rQVW

    #1705191
    David
    Staff
    Customer Support

    Hi there,

    not sure but have you tried:

    Term counts > Recount Terms in Woocommerce > Status > Tools ?

    #1705196
    sparkle

    oooh… that’s an entirely new section to me, but sadly, that didn’t change the count to exlude items not in stock.

    #1705268
    David
    Staff
    Customer Support

    Are the Out of Stock items still being displayed in the relevant archives ?

    #1705312
    sparkle

    see link. what you see is the category archive, right?

    this is the category in the products list
    https://imgur.com/s1BQrnK

    and i have this set in my woo settings.
    https://imgur.com/Z5SdZSv

    #1705425
    David
    Staff
    Customer Support

    Odd – to the best of my knowledge the count is based upon the loop count itself.
    Can you try clearing the:

    WooCommerce transients
    Expired transients
    Clear template cache

    In the Status > Tools.

    #1705461
    sparkle

    same :-/

    #1705720
    Leo
    Staff
    Customer Support

    Unfortunately you might need to check with WooCommerce’s support team on this if the suggestions above don’t work.

    #1709149
    sparkle

    just so you know, i’ve opened a ticket with woocommerce. it happens with storefront too. 🙁

    https://wordpress.org/support/topic/bad-math-product-count-includes-out-of-stock-items/

    #1709818
    Leo
    Staff
    Customer Support

    Sounds good.

    Hopefully they are able to help!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.