Replies: 2 comments 4 replies
-
You can hide any element if product is out of stock with <div data-v-if="product.stock_quantity < 1">
Out of stock product page
</div> for product page and for product listing you need to use <div data-v-if="prod.stock_quantity < 1">
Out of stock product listing
</div> You can also use <button class="btn btn-primary" data-v-attr-if-disabled="product.stock_quantity < 1">
Add to cart
</button> Or you can use <a class="btn btn-primary" data-v-class-if-disabled="product.stock_quantity < 1">
Add to cart
</button> For product page you need to edit public/themes/landing/product/product.html For product listing you need to edit multiple templates like npm i
npm run gulp inside I added code to disable add to cart for out of stock products https://demo.vvveb.com/product/product-seventeen-17 in the latest.zip update, you can redownload the zip and update the files on your server. |
Beta Was this translation helpful? Give feedback.
-
So I can set any class or attribute with conditional with… |
Beta Was this translation helpful? Give feedback.
-
Where would I conditionally check for the stock status of the product so I can "disable" the "add to cart" button on the product page in code?
Beta Was this translation helpful? Give feedback.
All reactions