- This topic has 11 replies, 4 voices, and was last updated 4 years, 5 months ago by
Leo.
-
AuthorPosts
-
March 21, 2021 at 11:44 am #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.
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.
March 21, 2021 at 11:34 pm #1704541Elvin
StaffCustomer SupportHi 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 usewoocommerce_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.
March 22, 2021 at 5:36 am #1704838sparkle
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?
March 22, 2021 at 7:21 am #1705191David
StaffCustomer SupportHi there,
not sure but have you tried:
Term counts > Recount Terms in Woocommerce > Status > Tools ?
March 22, 2021 at 7:29 am #1705196sparkle
oooh… that’s an entirely new section to me, but sadly, that didn’t change the count to exlude items not in stock.
March 22, 2021 at 8:16 am #1705268David
StaffCustomer SupportAre the Out of Stock items still being displayed in the relevant archives ?
March 22, 2021 at 8:44 am #1705312sparkle
see link. what you see is the category archive, right?
this is the category in the products list
https://imgur.com/s1BQrnKand i have this set in my woo settings.
https://imgur.com/Z5SdZSvMarch 22, 2021 at 9:59 am #1705425David
StaffCustomer SupportOdd – 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 cacheIn the Status > Tools.
March 22, 2021 at 10:23 am #1705461sparkle
same :-/
March 22, 2021 at 2:47 pm #1705720Leo
StaffCustomer SupportUnfortunately you might need to check with WooCommerce’s support team on this if the suggestions above don’t work.
March 25, 2021 at 3:29 am #1709149sparkle
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/
March 25, 2021 at 10:42 am #1709818Leo
StaffCustomer SupportSounds good.
Hopefully they are able to help!
-
AuthorPosts
- You must be logged in to reply to this topic.