[Skip to main content](#vessel-content)

#   Add to cart button when no stock

##

- **[ismael](/forum/user/63761-ismael "View ismael's Profile")**
- [![ismael's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/63761-ismael "View ismael's Profile") Topic Author
- [ Offline](/forum/user/63761-ismael)

Less More

- Posts: 54
- Thank you received: 7
-
-

4 years 8 months ago [\#340396](#340396) by [ismael](/forum/user/63761-ismael "View ismael's Profile")  *[Add to cart button when no stock](/forum/4-how-to/904168-add-to-cart-button-when-no-stock#340396 "Hi,  Whenever a product is out of stock, the add to cart button gets removed. But since my add to cart button has a position of relative, some parts of my product page break. Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable? Or any other solution will do.  Thanks in advance,  Ismael")* was created by *[ismael](/forum/user/63761-ismael "View ismael's Profile")*

Hi,

Whenever a product is out of stock, the add to cart button gets removed.
But since my add to cart button has a position of relative, some parts of my product page break.
Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable?
Or any other solution will do.

This message contains confidential information

Thanks in advance,

Ismael

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNDE2OC1hZGQtdG8tY2FydC1idXR0b24td2hlbi1uby1zdG9jaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

4 years 8 months ago -  4 years 8 months ago [\#340397](#340397) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Add to cart button when no stock](/forum/4-how-to/904168-add-to-cart-button-when-no-stock#340397 "Hi,  Whenever a product is out of stock, the add to cart button gets removed. But since my add to cart button has a position of relative, some parts of my product page break. Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable? Or any other solution will do.  Thanks in advance,  Ismael")*

Hello,

We can suggest to use some css to "***simulate***" a shutdown button, as shown on my screenshot :
[ ![alt](https://i.ibb.co/n3jRrR9/screenshot.png) ](https://i.ibb.co/n3jRrR9/screenshot.png "alt")

"***Click to better see screenshot details***"

**Note :** In order to learn how to add custom css command, have a look on this **[ documentation](https://www.hikashop.com/support/documentation/272-hikashop-display-by-color.html#custom)**.

Now for your display issue, a little like already said on another topic, your frontend is is very largely customized, by custom css commands, overrides coming from your template, and more, and your display problems seem to come directly from these customization, now which one will be complicated.
Hope this will help you to achieved what you need.

Regards

Last edit: 4 years 8 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

The following user(s) said Thank You: [ismael](/forum/user/63761-ismael "View ismael's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNDE2OC1hZGQtdG8tY2FydC1idXR0b24td2hlbi1uby1zdG9jaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ismael](/forum/user/63761-ismael "View ismael's Profile")**
- [![ismael's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/63761-ismael "View ismael's Profile") Topic Author
- [ Offline](/forum/user/63761-ismael)

Less More

- Posts: 54
- Thank you received: 7
-
-

4 years 7 months ago -  4 years 7 months ago [\#340582](#340582) by [ismael](/forum/user/63761-ismael "View ismael's Profile")  Replied by *[ismael](/forum/user/63761-ismael "View ismael's Profile")* on topic *[Add to cart button when no stock](/forum/4-how-to/904168-add-to-cart-button-when-no-stock#340582 "Hi,  Whenever a product is out of stock, the add to cart button gets removed. But since my add to cart button has a position of relative, some parts of my product page break. Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable? Or any other solution will do.  Thanks in advance,  Ismael")*

Hi,

I added the button but now i have another issue.
When product is not in stock its working fine.
My code:
div#hikashop_product_right_part div#hikashop_product_quantity_main.hikashop_product_quantity_main:after {
content: 'Aan Winkelwagen Toevoegen';
display: inline-block;
border: 1px solid #eee;
width: 225px;
color: white;
background-color: #185EA7!important;
height: 35px;
padding-top: 7px;
padding-left: 13px;
border-radius: 3px;
opacity: 70%;
margin-bottom: 40px;
left: 16px;
position: relative;
}

Whenever the product is in stock it now shows 2 buttons.
Screenshot in attachments.

- [ ![double&#95;addtocart.png](/forum/attachment/54619) ](/forum/attachment/54619 "...&#95;addtocart.png") [ ](/forum/attachment/54619?download=1 "...&#95;addtocart.png")

Last edit: 4 years 7 months ago by [ismael](/forum/user/63761-ismael "View ismael's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNDE2OC1hZGQtdG8tY2FydC1idXR0b24td2hlbi1uby1zdG9jaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 652
-
-

4 years 7 months ago -  4 years 7 months ago [\#340587](#340587) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Add to cart button when no stock](/forum/4-how-to/904168-add-to-cart-button-when-no-stock#340587 "Hi,  Whenever a product is out of stock, the add to cart button gets removed. But since my add to cart button has a position of relative, some parts of my product page break. Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable? Or any other solution will do.  Thanks in advance,  Ismael")*

Hello,

In order to avoid this issue, you have to use a more specific class that is relative to the state "no stock", see my screenshot :
[ ![alt](https://i.ibb.co/svBVLPH/screenshot.png) ](https://i.ibb.co/svBVLPH/screenshot.png "alt")

Hope this will help you to achieved what you eed.
Regards

Last edit: 4 years 7 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

The following user(s) said Thank You: [ismael](/forum/user/63761-ismael "View ismael's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNDE2OC1hZGQtdG8tY2FydC1idXR0b24td2hlbi1uby1zdG9jaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ismael](/forum/user/63761-ismael "View ismael's Profile")**
- [![ismael's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/63761-ismael "View ismael's Profile") Topic Author
- [ Offline](/forum/user/63761-ismael)

Less More

- Posts: 54
- Thank you received: 7
-
-

4 years 7 months ago [\#340602](#340602) by [ismael](/forum/user/63761-ismael "View ismael's Profile")  Replied by *[ismael](/forum/user/63761-ismael "View ismael's Profile")* on topic *[Add to cart button when no stock](/forum/4-how-to/904168-add-to-cart-button-when-no-stock#340602 "Hi,  Whenever a product is out of stock, the add to cart button gets removed. But since my add to cart button has a position of relative, some parts of my product page break. Is it possible to always keep the add to cart button, but whenever a product is out of stock, instead of removing it it becomes unclickable? Or any other solution will do.  Thanks in advance,  Ismael")*

Hi,

Thanks, working fine!

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNDE2OC1hZGQtdG8tY2FydC1idXR0b24td2hlbi1uby1zdG9jaz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.055 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
