Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 2
rishisavera

Hiding price on out of stock items?

Question

13 answers to this question

Recommended Posts

  • 1

There’s a pure CSS solution for this problem. Make sure the price and sold out mark are siblings in your HTML:


{@|product-status}
{@|product-price}

Then you can target the price class with a general sibling combinator selector (~) in CSS:


.sold-out ~ .product-price {
   display: none;
}

The price will only disappear when the sold out class is active.

Edited by JulesHugal

Share this post


Link to post
  • 1
Guest

@JulesHugal

This worked great for a few months.. then it stopped. Here's my fork to get it working again:

page > #productList > .sold-out > div > .product-overlay > .product-meta > .product-price {display: none;}

http://cjohn.design

Share this post


Link to post
  • 0

I just deleted the sales price on my item and typed in a decimal point and made item quantity 0. This allowed the item to show ‘sold out’, and $0.00 as the price.

If there is a better way, I would love to hear, but for now, this is the solution I came up with.

Share this post


Link to post
  • 0

I just deleted the sales price on my item and typed in a decimal point and made item quantity 0. This allowed the item to show ‘sold out’, and $0.00 as the price.

If there is a better way, I would love to hear, but for now, this is the solution I came up with.

Edited by 16simplelife

Share this post


Link to post
  • 0

Something along the lines of this:


YUI().use('node', function (Y) {
   Y.all('.product').each(function(){
       if (this.one('.sold-out')) {
           this.one('.product-price').hide();
       }
   });
});

Insert in Code Injection (in script tags)

Share this post


Link to post
  • 0

Hi @Alex -- Thanks. This works great on the product list page - but then price still shows on the product detail page, along with an ADD TO CART button (which is very confusing). Would you mind to let us know how to get rid of price and add to cart on that page?Thanks a lot

Share this post


Link to post
  • 0

Hello,

This article looks like just what I need but I am having difficulty using it to hide the prices on all sold out items in my Shop & Product pages:

Shop page: http://www.ashleighdix.com/shop/Product page: http://www.ashleighdix.com/shop/flushed

Please could someone advise...?

FYI: - I am running some JS to change ‘Sold Out’ to ‘Sold’ and to hide the ‘Add-to-Cart/Purchase’ button for out of stock items.

Many thanks in advance… :)

Edited by JakeNaude

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...