Jump to content

hide add to cart button when out of stock


melo4kids

Recommended Posts

yes, 

the thing is when i only have  one product in stock and i add it to the cart, the button "add to cart" doesent change to out of stock, It changes only if the order is compleated. I would like it to change if we add the last product to the cart in to "out of stock". do you have any ideas? I only sell on quantity of a product. and its anooing when people try to add to the cart  products that I only have one in stock

The cart goes like this img

image.png.6e0969a9e30a41df5b997eddaeaa6a5e.png

I add the las product to cart

image.thumb.png.915edd8f6be9cce3edef4e82444694b6.png

so the last produt is gonne, and then the "add to cart" button does not disapperas

image.png.4cb09dbe4a435b6dc823eb5ff0ffa44d.png

 

I hope  you understand do to my bad inglish

Thanks for replying

image.png

Link to comment
Share on other sites

for the moment since i only have very litlle stock like one ore two peaces of a model, i will mysel deleat de abandon carts. later on, when i have a larger stock, i will leave the carts abandon for 7 days only. the thing is that i hate the fact that we can still clic on the button if we dont have any in stock. do you know a code for that? or at least change de "add to cart" to "its the last one" or something like that?

Link to comment
Share on other sites

or instead of this box

image.thumb.png.cd85fcce690213a770c87a8e9a1ec013.png

add a box in the same style, but instead of being empty in "Quntity (Quantité)" have something writtin like "were are sorry, it was the last one". I think is the best way for the moment.

what do you think? Is it possible?

Link to comment
Share on other sites

Adding a text to the page that this is the last product is rather easy. You should just add text to product.tpl: 

{if $product->quantity == 1}This is the last product{/if}

Having the same thing in the category page (product-list.tpl) might be a bit more difficult.

If you want a check for the content of your carts you should put a database query in controllers/front/productController.php and let it transfer a Smarty flag to product.tpl. So that is a more difficult to do.

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...