- Posts: 640
- Thank you received: 16
Disable add_cart button once added for 1 unit only
- PeterChain
-
Topic Author
- Offline
Less
More
11 years 8 months ago #187251
by PeterChain
Disable add_cart button once added for 1 unit only was created by PeterChain
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.x
I have a set of 1 unit only products.
When clients add them to cart the "add to cart" button should remain gray / disabled but stupidly it remains active so I can keep adding the same 1 unit only product for life.
Where to disable this?
-- Joomla version -- : 3.x
I have a set of 1 unit only products.
When clients add them to cart the "add to cart" button should remain gray / disabled but stupidly it remains active so I can keep adding the same 1 unit only product for life.
Where to disable this?
Please Log in or Create an account to join the conversation.
11 years 8 months ago #187268
by Xavier
Replied by Xavier on topic Disable add_cart button once added for 1 unit only
Hi,
We don't have default options for that, you will have to create a plugin based on the function "onAfterProductQuantityCheck()" in order to check if:
If you are in this if condition, so you can add session data to tell that this product can no more be added to cart.
www.hikashop.com/support/support/documen...r-documentation.html
Then edit the view "product / quantity" and check in the session the data for the current product, if it can't be added to cart so edit the button to display a greyed one without any actions onclick, or simply hide the button.
www.hikashop.com/support/support/documen...ize-the-display.html
We don't have default options for that, you will have to create a plugin based on the function "onAfterProductQuantityCheck()" in order to check if:
Code:
if( $displayErrors && $wantedQuantity > $quantity )
www.hikashop.com/support/support/documen...r-documentation.html
Then edit the view "product / quantity" and check in the session the data for the current product, if it can't be added to cart so edit the button to display a greyed one without any actions onclick, or simply hide the button.
www.hikashop.com/support/support/documen...ize-the-display.html
Please Log in or Create an account to join the conversation.
Time to create page: 0.166 seconds